Skip to content
LumenaryAcademy
Foundations 60 min

Atomic structure and the periodic table

Shells, subshells and orbitals, the rules that fill them, and why the table has the shape it has.

Code tested · 5AI-draftedAwaiting review by a chemist

Your guides: Chloe · The Chemist, Margaret · The Analyst, Gideon · The Sceptic

MotivationH

Why does the table have that shape?

In 1869 Dmitri Mendeleev arranged the 63 elements then known in order of atomic weight and noticed that their properties repeated. Lithium, sodium and potassium are soft metals that react briskly with water; fluorine, chlorine and bromine form salts with them in the same one-to-one ratio. By lining up elements with similar behaviour in columns, he produced a table, and he trusted the pattern enough to leave gaps in it. For three of the gaps he predicted the properties of elements nobody had yet seen. When gallium (1875), scandium (1879) and germanium (1886) were found, their densities, atomic weights and oxides came out close to his predictions.

Mendeleev did not know why the pattern existed. Nobody did: the electron was discovered in 1897 and the nucleus in 1911. In 1913 Henry Moseley measured the X-rays given off by different elements and found that their frequencies increased in neat steps from one element to the next. The step counted something inside the atom: the charge of the nucleus, the atomic number ZZ. Ordering by ZZ instead of by weight fixed the few places where Mendeleev had had to swap elements by hand (tellurium and iodine, for example), and it told chemists exactly how many elements were still missing.

This lesson answers Mendeleev's question with what came after: the arrangement of electrons in shells and subshells. By the end you will be able to predict, from ZZ alone, where an element sits in the table, which ions it tends to form, roughly how big it is and how tightly it holds its electrons, and you will know where those predictions fail.

In Atoms and elements you met the atom as a tiny nucleus surrounded by electrons. Now we look more closely at how those electrons are arranged.

IntuitionH

Shells: the evidence first

An atom is mostly empty space. The nucleus, made of ZZ protons and some neutrons, has a radius of a few femtometres (10−1510^{-15} m), while the electrons spread over a region tens of thousands of times wider, around 10−1010^{-10} m, or 100 picometres. Almost all the mass is in the nucleus; almost all the chemistry is in the electrons. Atoms of the same element with different numbers of neutrons are isotopes: they have the same ZZ, the same electrons and nearly identical chemistry, but different masses.

How do we know electrons are arranged in shells? Not by looking: no microscope resolves an electron's position inside an atom. The evidence is energetic. Two kinds of measurement point the same way.

Line spectra. Hot hydrogen gas does not glow in a smooth rainbow but at a few sharp colours. Each line is a photon emitted when the electron drops from one allowed energy to a lower one, so the allowed energies must be separate steps, not a continuum. Every element has its own set of lines, which is how astronomers know what stars are made of.

Ionisation energies. The energy needed to pull electrons off an atom one at a time jumps sharply at certain points.

Sodium's first electron is easy to remove; the second comes from a full, tightly held inner shell. That jump is the fingerprint of a shell structure, and its position tells us how many electrons are in the outermost shell. Those outer electrons, the valence electrons, are the ones that take part in bonding, so this is the first link between electron arrangement and chemical behaviour.

Analogy, not a formal construction

Think of a theatre with tiers of seats. The stalls (nearest the stage) have few seats and fill first; each tier further back has more seats and costs less to leave. The audience members in the back row decide how quickly the theatre empties at the interval. Like any analogy this one breaks somewhere: electrons are not little people sitting at fixed points, as the next section explains.

DefinitionsH

Shells, subshells, orbitals and spin

Quantum mechanics, which you will meet properly in Quantum mechanics for chemists, describes each electron in an atom by a wavefunction, and labels the allowed states with four quantum numbers. For now we need only their names and what they count.

Definition— shell

A shell is the set of electron states with the same principal quantum number n=1,2,3,…n = 1, 2, 3, \ldots Larger nn means, on average, farther from the nucleus and higher in energy.

Definition— subshell

Within shell nn, the angular momentum quantum number ll takes the values 0,1,…,n−10, 1, \ldots, n-1, labelled s, p, d, f for l=0,1,2,3l = 0, 1, 2, 3. A subshell is a pair (n,l)(n, l), written 1s, 2p, 3d and so on.

Definition— orbital

An orbital is one spatial state of a single electron: a standing wave around the nucleus, whose square gives the probability of finding the electron in each small region. A subshell with angular momentum ll has 2l+12l + 1 orbitals (labelled by ml=−l,…,+lm_l = -l, \ldots, +l): one s orbital, three p, five d, seven f.

Definition— spin and the Pauli exclusion principle

Each electron also has a spin, ms=+12m_s = +\tfrac12 or −12-\tfrac12 ("up" or "down"). The Pauli exclusion principle: no two electrons in an atom share all four quantum numbers. So an orbital holds at most two electrons, and then with opposite spins.

Counting follows at once: a subshell holds 2(2l+1)2(2l+1) electrons (2, 6, 10, 14 for s, p, d, f), and shell nn holds ∑l=0n−12(2l+1)=2n2\sum_{l=0}^{n-1} 2(2l+1) = 2n^2 electrons: 2, 8, 18, 32.

−++−++−−xznode1s2s2px2pz3dxy
Shapes of some orbitals, drawn as the region where the electron spends most of its time, with the sign of the wave shown by shading. An s orbital is spherical; 2s has a spherical node (dashed) where the wave changes sign. The three 2p orbitals are dumbbells along the x, y and z axes (two are shown); a 3d orbital has four lobes. Sizes are not to scale.

An orbital is not a path. The electron does not travel round the lobes of a p orbital; the drawing shows where a measurement would be likely to find it. The sign (+ or −) is the sign of the wave, which matters when orbitals on neighbouring atoms overlap to make bonds, as you will see in Chemical bonding.

Three rules decide which orbitals the electrons of an atom occupy in its lowest-energy state, the ground state:

Definition— aufbau principle (and the Madelung rule)

Aufbau (German for "building up"): electrons fill subshells in order of increasing energy. For neutral atoms the order follows the Madelung rule: lower n+ln + l first, and for equal n+ln + l, lower nn first. This gives 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p.

Definition— Hund's rule

Within a subshell, electrons occupy separate orbitals with parallel spins before any orbital takes a second electron. Nitrogen's three 2p electrons sit one in each 2p orbital, all spin-up.

Definition— electron configuration

An electron configuration lists the occupied subshells with their electron counts as superscripts, for example nitrogen 1s² 2s² 2p³. A filled noble-gas core is abbreviated in brackets: sodium is [Ne] 3s¹.

Worked examplesH

Writing configurations

Example— Oxygen, iron and the iron ions

Oxygen (Z=8Z = 8): 1s² 2s² 2p⁴, or [He] 2s² 2p⁴. By Hund's rule the four 2p electrons occupy all three 2p orbitals, one of them doubly, so oxygen has two unpaired electrons. (This is related to, but not the same as, the reason oxygen gas is attracted by a magnet, which needs molecular orbitals to explain.)

Iron (Z=26Z = 26): following the Madelung order, 1s² 2s² 2p⁶ 3s² 3p⁶ 4s² 3d⁶, usually written [Ar] 3d⁶ 4s², with subshells in order of nn. The six 3d electrons fill five orbitals: five go in singly, the sixth pairs up, leaving four unpaired electrons.

Iron ions. Iron forms Fe²⁺ and Fe³⁺. You might expect to remove the last electrons added, from 3d. In fact the 4s electrons go first: Fe²⁺ is [Ar] 3d⁶ and Fe³⁺ is [Ar] 3d⁵. Once the atom is positively charged, the 3d subshell drops below 4s in energy. This is true across the transition metals: their ions have no 4s electrons.

The Madelung rule is an empirical rule for neutral atoms in their ground state, not a law. Python makes it easy to apply, and to see where it fails.

python
SYMBOLS = ("H He Li Be B C N O F Ne Na Mg Al Si P S Cl Ar K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn "
           "Ga Ge As Se Br Kr Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe").split()
LETTER = "spdf"

# Every subshell up to n = 7, sorted by the Madelung rule: lower n + l first; on a tie, lower n first.
SUBSHELLS = sorted(((n, l) for n in range(1, 8) for l in range(min(n, 4))),
                   key=lambda s: (s[0] + s[1], s[0]))
print("filling order:", " ".join(f"{n}{LETTER[l]}" for n, l in SUBSHELLS[:15]))

def aufbau(Z):
    """Ground-state configuration predicted by the Madelung rule, as {(n, l): electrons}."""
    config, left = {}, Z
    for n, l in SUBSHELLS:
        if left == 0:
            break
        k = min(left, 2 * (2 * l + 1))      # a subshell holds 2(2l + 1) electrons
        config[(n, l)] = k
        left -= k
    return config

def written(config):
    """Noble-gas core in brackets, then the rest by n and l (so 3d is written before 4s)."""
    core = max(z for z in (0, 2, 10, 18, 36) if z < sum(config.values()))
    rest = {s: k for s, k in config.items() if s not in aufbau(core)} if core else config
    text = " ".join(f"{n}{LETTER[l]}{k}" for (n, l), k in sorted(rest.items()))
    return f"[{SYMBOLS[core - 1]}] {text}" if core else text

# Measured ground states that break the rule (from atomic spectra), among Z <= 54.
EXCEPTIONS = {"Cr": "[Ar] 3d5 4s1", "Cu": "[Ar] 3d10 4s1", "Nb": "[Kr] 4d4 5s1",
              "Mo": "[Kr] 4d5 5s1", "Ru": "[Kr] 4d7 5s1", "Rh": "[Kr] 4d8 5s1",
              "Pd": "[Kr] 4d10", "Ag": "[Kr] 4d10 5s1"}

for sym in ["O", "Na", "Ar", "K", "Ca", "Fe", "Cr", "Cu", "Br", "Pd"]:
    Z = SYMBOLS.index(sym) + 1
    note = f"   measured: {EXCEPTIONS[sym]}" if sym in EXCEPTIONS else ""
    print(f"{sym:2} Z={Z:2}  {written(aufbau(Z))}{note}")

misses = [s for s in SYMBOLS if s in EXCEPTIONS]
print(f"\nThe rule is right for {len(SYMBOLS) - len(misses)} of the first {len(SYMBOLS)} elements;",
      "exceptions:", ", ".join(misses))
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Run it: in the first 54 elements the rule fails eight times. Every exception is a transition metal, where the (n−1)(n-1)d and nns subshells are so close in energy that small effects decide the winner. Chromium moves one electron from 4s to 3d and ends with six unpaired electrons; copper completes its 3d subshell. The usual explanation, that "half-filled and filled subshells are extra stable", is a summary rather than a cause: the real reason is a balance between the repulsion of electrons sharing an orbital and the exchange energy that favours parallel spins, and it has to be computed. Further down the table the exceptions multiply (platinum and gold behave like palladium and silver, and several lanthanoids and actinoids have a d electron where the rule predicts f), and in the heaviest elements relativistic effects reorder the levels.

ExplanationH

Reading the periodic table

Put the elements in order of ZZ, start a new row every time a new shell begins to fill, and the table assembles itself. The period (row) number is the highest nn occupied in the ground state. The group (column), numbered 1 to 18 in IUPAC's convention, collects elements with the same arrangement of valence electrons, and so similar chemistry.

1234567121314151617183456789101112s-blockd-blockp-blockf-blocklanthanoidsactinoidsHHe
The periodic table drawn as blocks. Each block is named after the subshell being filled across it: s in groups 1 and 2 (and helium), p in groups 13 to 18, d in groups 3 to 12 from period 4 on, and f in the two rows usually printed underneath to keep the table a convenient width.
  • s-block (groups 1 and 2): the last electron enters an s orbital. Group 1, the alkali metals (lithium to caesium), has one valence electron, ns¹, and forms 1+ ions; group 2, the alkaline-earth metals, has ns² and forms 2+ ions. Hydrogen (1s¹) is placed above lithium for its configuration, but it is a gas whose chemistry is its own. Helium (1s²) is s-block by configuration but sits above neon in group 18 because, like the other noble gases, it has a full outer shell.
  • p-block (groups 13 to 18): ns² np¹ to ns² np⁶. It contains all the non-metals except hydrogen, the metalloids such as silicon and germanium, and some metals such as aluminium, tin and lead. Group 17 are the halogens (ns² np⁵), one electron short of a full shell; group 18 are the noble gases, with full shells.
  • d-block (groups 3 to 12): the transition metals, filling (n−1)(n-1)d. Many form ions of several charges and coloured compounds, which Coordination chemistry explains.
  • f-block: the lanthanoids (filling 4f) and actinoids (5f), printed separately. Which elements belong in group 3 of the main table, lanthanum and actinium or lutetium and lawrencium, has been debated for decades, and IUPAC has studied the question; the chemistry does not depend on how we draw it.

Elements in the same group behave alike because they share a valence configuration, but they are not identical: lithium reacts gently with water, potassium vigorously. The next section explains why.

ExplanationH

The professional view

Where the numbers come from. Ionisation energies and electron configurations are measured by atomic spectroscopy and evaluated by groups such as the NIST Atomic Spectra Database, which lists ground-state configurations and ionisation energies for every element with uncertainties. Standard atomic weights are evaluated by IUPAC's Commission on Isotopic Abundances and Atomic Weights, which since its 2009 evaluation has given some elements, such as hydrogen, carbon and chlorine, as intervals rather than single numbers, because their isotope mixture really does vary between sources on Earth. Professionals cite the database and version they used, as the code above does in its comments, because tables in different books disagree in the last digit.

Relativity in the heavy elements. In heavy atoms the inner electrons move at a substantial fraction of the speed of light, and relativistic effects contract the s orbitals and change their energies. These effects explain why gold is yellow rather than silvery and contribute to mercury being a liquid at room temperature. Quantum chemists include them routinely in calculations on heavy elements, a topic for Computational chemistry.

The end of the table. The seventh row was completed in 2016, when IUPAC approved the names nihonium (113), moscovium (115), tennessine (117) and oganesson (118) after the discoveries were assessed by a joint IUPAC–IUPAP working group. New elements are made a few atoms at a time by firing beams of nuclei at heavy targets, at laboratories such as RIKEN (Japan), the Joint Institute for Nuclear Research (Dubna), GSI (Germany) and Lawrence Berkeley National Laboratory (United States). As of 2026, searches for elements 119 and 120 are under way; for such short-lived atoms, even measuring chemistry one atom at a time is a frontier, and whether they behave like their lighter group partners is an open question.

Using the table in practice. Chemists use the trends daily without computing anything: to predict that a group 1 metal and a group 17 element will form an ionic salt, that a C–F bond is strongly polar, or that potassium gives up an electron more readily than lithium. Materials scientists use the same trends to choose dopants and alloying elements; see bonding in solids in Lumenary Materials.

History & global context

A short history

  • 1869–1871: Dmitri Mendeleev and, independently, Lothar Meyer publish periodic tables. Mendeleev's predictions of undiscovered elements make his version famous.
  • 1894–1898: William Ramsay and colleagues discover argon, helium, neon, krypton and xenon, and a whole new group is added.
  • 1913: Niels Bohr's model of the hydrogen atom explains its line spectrum with quantised energy levels; Henry Moseley establishes atomic number as the ordering principle. Moseley was killed in the First World War two years later, aged 27.
  • 1925: Wolfgang Pauli states the exclusion principle; Samuel Goudsmit and George Uhlenbeck propose electron spin. With Erwin Schrödinger's wave equation (1926), the shell structure acquires its modern explanation.
  • 1944–1945: Glenn Seaborg proposes that the elements after actinium form a separate actinoid series, giving the table its modern layout.
  • 1962: Neil Bartlett makes the first compound of a noble gas, a xenon compound, ending the belief that group 18 is completely inert.
Common misconceptionsH

Common misconceptions

Misconception

"Electrons orbit the nucleus like planets." Bohr's 1913 model did picture circular orbits, and it explains hydrogen's spectrum, but it fails for every other atom. Electrons in atoms are described by orbitals, which give probabilities of position, not paths.

Misconception

"4s is always lower in energy than 3d." For the neutral atoms of potassium and calcium it is. For transition-metal ions it is not, which is why Fe²⁺ is [Ar] 3d⁶ and not [Ar] 3d⁴ 4s². The order of filling and the order of removal are different questions.

Misconception

"Atoms want a full outer shell." Atoms want nothing; a full shell is simply a low-energy arrangement. Sodium does not "want" to lose an electron: removing it costs 5.14 eV. Ionic compounds form because the energy released when ions attract each other in a crystal more than pays for that cost, as the next lesson shows.

Misconception

"Noble gases never form compounds." Xenon forms fluorides and oxides, krypton a fluoride. They are unreactive, not inert.

ExplanationH

Something safe to try at home

You can see that atoms emit light only at certain colours with a cheap diffraction grating (sold as "spectroscope glasses") or an old CD or DVD held at a slant. With an adult, look at the reflection of a compact fluorescent lamp or a street light in the grating, from a comfortable distance, and you will see separate bright lines rather than a smooth rainbow: they come from mercury atoms inside the lamp, or sodium atoms in an orange street lamp. An ordinary incandescent bulb gives a continuous rainbow instead, because its light comes from a hot solid. Never point a grating or anything else towards the Sun, and do not open or break lamps: fluorescent tubes contain mercury.

Optional Christian reflection · Order that can be trusted

A reflection from the Christian tradition that inspires Lumenary Academy. It is not part of the mathematics and you are welcome to skip it.

Mendeleev left gaps in his table because he expected nature to be consistent: if the pattern held for 63 elements, it should hold for the next three. Many scientists, Robert Boyle and Michael Faraday among them, saw confidence in the regularity of creation as a reason to do science at all. Whatever one makes of it, the periodic table is one of the strongest cases in the history of science of a pattern that was trusted before it was understood, and then understood.

Exercises

Exercises

1. Atomic structure and the periodic table

Warm-upHuman

What is the ground-state electron configuration of the iron(II) ion, Fe²⁺? (Iron has Z=26Z = 26; the neutral atom is [Ar] 3d⁶ 4s².)

Choose one

2. Atomic structure and the periodic table

Warm-upHuman

What is the largest number of electrons that the shell with principal quantum number n=4n = 4 can hold?

3. Atomic structure and the periodic table

CoreHuman

Which of these elements are in the p-block? Type their symbols separated by commas.

Al, Ca, Se, Zn, He, Sn, Br, Ga, Fe

Write elements separated by commas. Order and repeats don’t matter — just like in a set!

4. Atomic structure and the periodic table

CoreHuman

Which element has the ground-state configuration [Ar] 3d¹⁰ 4s² 4p⁵? Give its name or symbol.

5. Atomic structure and the periodic table

CoreHuman

The first ionisation energy of oxygen (13.62 eV) is lower than that of nitrogen (14.53 eV), although oxygen has a larger nuclear charge. What is the best explanation?

Choose one

6. Atomic structure and the periodic table

CoreHuman

Which list is in order of increasing covalent radius?

Choose one

7. Atomic structure and the periodic table

CoreComputational

Write unpaired(l, k), the number of unpaired electrons when k electrons occupy a subshell with angular momentum quantum number l (0 for s, 1 for p, 2 for d, 3 for f), following Hund's rule. For example, a p subshell with 4 electrons (as in oxygen) has 2 unpaired electrons. Raise ValueError if k is negative or more than the subshell can hold.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

8. Atomic structure and the periodic table

StretchComputational

Write configuration(Z) returning the ground-state configuration of element Z (1 to 118) predicted by the Madelung rule, as a string of subshells in filling order, each followed by its electron count, separated by single spaces. For example configuration(11) is '1s2 2s2 2p6 3s1' and configuration(26) is '1s2 2s2 2p6 3s2 3p6 4s2 3d6'. Use the letters s, p, d, f for l=0,1,2,3l = 0, 1, 2, 3. (Ignore the real exceptions such as chromium and copper.)

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources