NMR spectroscopy works by placing a sample in a strong magnetic field and irradiating it with radiofrequency waves. The nuclei of certain atoms (most commonly hydrogen and carbon) absorb this energy and re-emit it at characteristic frequencies. These frequencies can be detected and translated into a spectrum, which gives information about the molecular structure.