Electron Configuration Calculator Formula

Understand the math behind the electron configuration calculator. Each variable explained with a worked example.

Formulas Used

Total Electrons

total_electrons = atomic_number

Period

period_num = atomic_number <= 2 ? 1 : atomic_number <= 10 ? 2 : atomic_number <= 18 ? 3 : atomic_number <= 36 ? 4 : atomic_number <= 54 ? 5 : atomic_number <= 86 ? 6 : 7

Variables

VariableDescriptionDefault
atomic_numberAtomic Number (Z)11
periodDerived value= atomic_number <= 2 ? 1 : atomic_number <= 10 ? 2 : atomic_number <= 18 ? 3 : atomic_number <= 36 ? 4 : atomic_number <= 54 ? 5 : atomic_number <= 86 ? 6 : 7calculated

How It Works

Electron Configuration

How It Works

Electrons fill orbitals following three rules: 1. Aufbau Principle: Fill lowest energy orbitals first (1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, ...) 2. Pauli Exclusion: Each orbital holds at most 2 electrons with opposite spins 3. Hund's Rule: Within a subshell, one electron goes in each orbital before pairing

The order of filling follows the diagonal rule or is memorized from periodic table blocks.

Worked Example

Find the electron configuration of sodium (Z = 11).

atomic_number = 11
  1. 01Z = 11, so 11 electrons to place
  2. 021s² (2 electrons, 9 remaining)
  3. 032s² (2 electrons, 7 remaining)
  4. 042p⁶ (6 electrons, 1 remaining)
  5. 053s¹ (1 electron, 0 remaining)
  6. 06Configuration: 1s² 2s² 2p⁶ 3s¹
  7. 07Noble gas notation: [Ne] 3s¹
  8. 08Valence electrons: 1