The Balmer series is a series of lines in the emission spectrum of hydrogen, in optical and ultraviolet wavelengths. Specifically, they are produced by electron transitions from states with principal quantum number n>2 to n=2. As the energy of an electron in the n=2 state is lower than an electron in an n>2 state, an electron emits a photon with an energy equal to the difference in energy between the two shells. The wavelength of these lines varies between 656.3 nm (red) corresponding to a transition from n=3 to n=2, to 364.6 nm (ultraviolet) corresponding to n=∞ to n=2. 
For a transition from to , the difference in energy between the two is:
- is the mass of the electron
- is the elementary charge
- is Planck's constant
- is the permittivity of free space
The frequency of a photon can be related to its energy by Planck's formula, . As the wavelength may be related to frequency by and for the Balmer series, , the different wavelengths produced by the Balmer series my be expressed as:
The above formula for the difference between two energy levels comes from quantum mechanics, specifically an analysis of the most basic model of the hydrogen atom using the Schrodinger equation. There are may factors such as the spin of electrons and the effects of special relativity or any magnetic fields present that have not been accounted for. Whereas in the basic model the energy of an electron only depended on its shell, these other factors (or perturbations) lead to different energies between subshells and orbitals. The result is that on closer inspection, the lines in the Balmer series and other series for any atom, such as the Lyman series for hydrogen, are slightly shifted and also split into multiple lines. An example of this is the sodium doublet at 589.0 nm and 589.6 nm due to spin-orbit splitting.