Chemistry

Electron Configuration Calculator

Get the electron configuration of any of the 118 elements — full, noble-gas shorthand, orbital diagram, unpaired and valence electrons, and whether it breaks the Madelung rule.

Real Larzscript running in your browser847 automated checksOpen source · MITNo sign-up · your inputs never leave your device

Enter an element

Full configuration
—
Noble-gas notation
—
Unpaired electrons
—
Valence electrons
—
Period, group, block
—
Follows the Madelung rule?
—

Orbital diagram

One box per orbital, arrows for electrons: filled singly first (Hund's rule), then paired.

Show the Larzscript program that just ran
Run a calculation to see the exact program.

This is the real program the page sent to the Larzscript interpreter (compiled to WebAssembly) in your browser. The library it imports is the same code the automated tests check.

The rule and the order

1s 2s 2p 3s 3p 4s 3d 4p 5s 4d 5p 6s 4f 5d 6p 7s 5f 6d 7p

This is the Madelung (n + l) order: subshells fill in order of increasing n + l, and for equal n + l the lower n first. That is why 4s (n + l = 4) fills before 3d (n + l = 5). Iron, Z = 26: 18 electrons fill up to 3p, then 4s² and 3d⁶ — written by increasing n as 1s2 2s2 2p6 3s2 3p6 3d6 4s2 ([Ar] 3d6 4s2).

Exceptions, computed above

Chromium (Z = 24) is predicted [Ar] 4s² 3d⁴ but measured [Ar] 3d5 4s1; copper is [Ar] 3d10 4s1 and gold [Xe] 4f14 5d10 6s1. Each moves one s electron into d to reach a half-filled or filled subshell. Uranium (Z = 92) is [Rn] 5f3 6d1 7s2. The calculator compares the measured configuration with the Madelung prediction and reports the exceptions.

What is verified

Every configuration for Z = 1–118 must contain exactly Z electrons with no over-filled subshell, in both the Madelung and the measured versions. The set of elements where the two differ must equal the 19 textbook exceptions exactly; unpaired-electron counts for Sc–Zn, period 1–2 and the lanthanides Eu and Gd are asserted, and mutation tests confirm the checks fail when the fill order or capacities change.

Limits: neutral atoms in the ground state (ions lose their outermost electrons first: Fe²⁺ is [Ar] 3d⁶, not 4s²). Heavy-element entries above Z = 103 are predictions.

Frequently asked questions

What is an electron configuration?

A list of how a neutral atom's electrons are distributed over subshells, written as the subshell (1s, 2s, 2p ...) with the number of electrons as a superscript. Iron is 1s2 2s2 2p6 3s2 3p6 3d6 4s2; the noble-gas shorthand is [Ar] 3d6 4s2.

How do I write an electron configuration?

Fill subshells in the Madelung (Aufbau) order — 1s 2s 2p 3s 3p 4s 3d 4p 5s 4d 5p 6s 4f 5d 6p 7s 5f 6d 7p — with at most 2 electrons in s, 6 in p, 10 in d and 14 in f, until you have used up the atomic number. Then write the subshells in order of increasing n.

What is the noble-gas (shorthand) notation?

Replace the inner filled shells by the symbol of the noble gas with that configuration in brackets: sodium 1s² 2s² 2p⁶ 3s¹ becomes [Ne] 3s1.

Which elements break the Madelung rule?

Nineteen of the first 118 in the data used here: Cr, Cu, Nb, Mo, Ru, Rh, Pd, Ag, La, Ce, Gd, Pt, Au, Ac, Th, Pa, U, Np and Cm. Chromium is [Ar] 3d5 4s1 instead of the predicted [Ar] 3d⁴ 4s², copper is [Ar] 3d10 4s1, and gold [Xe] 4f14 5d10 6s1: half-filled and filled d subshells are unusually stable. The calculator marks them.

What are valence electrons?

The electrons in the outermost shell, which take part in bonding. Oxygen has 6 (2s² 2p⁴), sodium 1; for transition metals the group number is used.

How many unpaired electrons does an atom have?

By Hund's rule, electrons occupy separate orbitals of a subshell before pairing. Oxygen (2p⁴) has 2 unpaired electrons, iron 4 (3d⁶), chromium 6 (3d⁵ 4s¹) — which is why iron is magnetic. Unpaired electrons make an atom paramagnetic.

Are the heavy-element configurations measured?

No. Elements above lawrencium (103) have never been made in quantities that allow spectroscopy, so their configurations are theoretical predictions. Even for lawrencium the older dataset gives 6d¹ while a 2015 measurement points to 7p¹.

Every number on this page is computed by the open-source larzscript-chem library (econfig, elements, physmath), written in Larzscript, and checked against independent references in its test suite. How it is verified →