Electron shells and electron configuration
An atom has a small, heavy nucleus with electrons around it. The electrons are not placed at random. They occupy energy levels called shells, and the way they fill the shells explains the whole shape of the periodic table.
Shells
Shells are numbered 1, 2, 3 and so on, starting nearest the nucleus. Each can hold only so many electrons: shell 1 holds 2, shell 2 holds 8, shell 3 holds 18 and shell 4 holds 32. The rule is 2 × n × n, where n is the shell number.
Example: sodium has 11 electrons. Two fill the first shell, eight fill the second, and one is left for the third. Its shells are written 2, 8, 1.
Sub-shells: s, p, d and f
Each shell is divided into sub-shells named s, p, d and f. An s sub-shell holds 2 electrons, p holds 6, d holds 10 and f holds 14. Shell 1 has only an s sub-shell. Shell 2 has s and p. Shell 3 has s, p and d.
Reading a configuration
The configuration of sodium is 1s2 2s2 2p6 3s1. Read each part as shell number, sub-shell letter, and number of electrons. To save space, the inner part is often replaced with the symbol of the previous noble gas in square brackets. Neon is 1s2 2s2 2p6, so sodium becomes [Ne]3s1.
The filling order
Sub-shells fill in order of energy, not strictly in order of shell number. The 4s sub-shell fills before 3d. That is why potassium is 2, 8, 8, 1, with its last electron in shell 4 although shell 3 is not full. The usual order is 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p. A few elements, such as chromium and copper, are small exceptions.
Why the outer shell matters
The electrons in the outermost shell are called valence electrons. They are the ones that take part in bonds. Atoms with a full outer shell, the noble gases, are stable and unreactive. Atoms with one outer electron, the alkali metals, lose it easily. Atoms one short of a full shell, the halogens, grab one eagerly. This is why a metal from group 1 and a halogen from group 17 react so readily to form a salt.
See it for any element
Every element page on this site shows the number of electrons in each shell, the full configuration and a ring diagram. Try iron, chlorine or uranium.