Electron Configuration Calculator: How to Write the Arrangement of Electrons

An electron configuration calculator writes how electrons are arranged in shells and subshells for a neutral atom. It takes an atomic number and returns a notation such as 1s2 2s2 2p4 for oxygen. That notation is a compact summary of an atom’s structure, and it is the starting point for explaining chemical bonding, periodic trends, and why some elements are reactive while others are not.

Electrons fill orbitals in a specific order, not simply shell by shell. The order follows increasing energy, which is why 4s fills before 3d, even though 3d belongs to a lower shell number. Each subshell holds a fixed maximum: s holds 2, p holds 6, d holds 10, and f holds 14. A configuration is complete when the total number of electrons equals the atomic number for a neutral atom.

What this calculator does

The filling order used here, for atomic numbers up to 36, is 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p. Each step takes electrons up to its capacity or until the atomic number is reached. For oxygen, atomic number 8, the filling is 1s2, which uses 2 electrons, 2s2, which uses 2 more for a total of 4, and 2p4, which uses the remaining 4 for a total of 8. The result is 1s2 2s2 2p4.

The calculator below follows that order and stops when the electron count is reached. It is intended for neutral atoms in their ground state. Ions need an adjustment, because removing or adding electrons changes the total and, for transition metals, the order in which electrons are removed is not simply the reverse of filling.

Formula

Fill in order 1s (2), 2s (2), 2p (6), 3s (2), 3p (6), 4s (2), 3d (10), 4p (6), stopping when electrons used equal the atomic number.

How to use it

  1. Enter the atomic number of the neutral atom.
  2. Fill 1s with up to 2 electrons.
  3. Continue through 2s, 2p, 3s, 3p, 4s, 3d, and 4p, taking up to each subshell capacity.
  4. Stop as soon as the total electrons used equals the atomic number.
  5. Add the superscripts to check that they sum to the atomic number.

Try the calculator

Worked example

Write the electron configuration for oxygen, atomic number 8. Filling in order: 1s takes 2 electrons, leaving 6. 2s takes 2 electrons, leaving 4. 2p takes the remaining 4 electrons, reaching the capacity of 6 only partly, which is fine. The configuration is 1s2 2s2 2p4, and the superscripts add to 2 + 2 + 4 = 8, matching the atomic number. The incomplete 2p subshell, with 4 of 6 places filled, helps explain why oxygen tends to gain two electrons in compounds.

For calcium, atomic number 20, the filling is 1s2 2s2 2p6 3s2 3p6 4s2. The superscripts add to 2 + 2 + 6 + 2 + 6 + 2 = 20. Note that 4s fills before 3d in this range, so calcium has a full 4s subshell and an empty 3d subshell.

How to check your answer

Add the superscripts. They must equal the atomic number for a neutral atom.

Check the last subshell. It should be partly or fully filled, never overfilled beyond its capacity.

Compare with the periodic table position. The last subshell often matches the block of the element, such as p-block for oxygen.

Common mistakes

  • Filling 3d before 4s, which reverses the correct energy order in this range.
  • Using the shell number alone to order subshells, instead of the energy filling order.
  • Forgetting that an ion has a different electron count from its neutral atom.
  • Writing a superscript larger than the subshell capacity, such as p7 or s3.

Frequently asked questions

What does 1s2 2s2 2p4 mean?

It means 2 electrons in the 1s subshell, 2 in 2s, and 4 in 2p, for a total of 8 electrons, which matches oxygen, atomic number 8.

Why does 4s fill before 3d?

Because 4s is lower in energy than 3d for the elements where this matters. Electrons fill lower-energy orbitals first, not simply lower shell numbers.

Does this work for ions?

Not directly. An ion has more or fewer electrons than the atomic number, and for transition metals, electrons are removed from the highest shell first, which needs a separate step.