How to Write Electron Configurations (Step by Step)

An electron configuration shows how the electrons in an atom are spread across its orbitals. To write one, you fill orbitals from lowest energy to highest energy until you run out of electrons. Three rules and one fill order guide the whole process. This guide walks through both, then works several real examples from start to finish.
What is an electron configuration?
An electron configuration is a shorthand list that names each occupied orbital and counts the electrons inside it. Oxygen, for example, is written 1s2 2s2 2p4. The numbers before each letter are energy levels. The letters name the subshell. The small superscript is the number of electrons in that subshell.
Every neutral atom holds the same number of electrons as its atomic number. Oxygen has an atomic number of 8, so its configuration must add up to 8 electrons. Add the superscripts in 1s2 2s2 2p4 and you get 2 plus 2 plus 4, which equals 8. That check works for any atom.
The three rules for filling orbitals
Three rules control the order and the way electrons occupy orbitals. Follow them in this order and you will not make mistakes. They are the Aufbau principle, the Pauli exclusion principle, and Hund's rule. Each one answers a different question about where an electron goes.
The Aufbau principle
The Aufbau principle says electrons fill the lowest available energy level first. You add electrons one at a time, always choosing the lowest empty or partly empty orbital. The word Aufbau is German for building up. You build the atom by stacking electrons from the bottom.
The Pauli exclusion principle
The Pauli exclusion principle says one orbital holds at most two electrons. Those two electrons must have opposite spins. One spins up and one spins down. This is why every subshell has a fixed capacity, and why you can never crowd three electrons into a single orbital.
Hund's rule
An atomic orbital set like the three p orbitals fills singly before it pairs up. That is Hund's rule. Electrons spread out across equal-energy orbitals first, each one alone, before any orbital takes a second electron. This lowers the atom's energy because like-charged electrons prefer to stay apart.
How many electrons fit in each subshell?
Each subshell type holds a fixed number of electrons because each has a set number of orbitals, and each orbital holds two. An s subshell has one orbital, so it holds two electrons. A p subshell has three orbitals and holds six. The table below lists all four common types.
| Subshell | Orbitals | Maximum electrons |
|---|---|---|
| s | 1 | 2 |
| p | 3 | 6 |
| d | 5 | 10 |
| f | 7 | 14 |
Keep these capacities in mind as you write. A superscript can never be larger than the subshell allows. If you write 2p7, you know at once that something is wrong, because a p subshell stops at six.
What is the correct fill order?
Orbitals do not fill in simple numerical order. The 4s subshell fills before the 3d subshell because 4s sits at lower energy. Memorize this sequence, which chemists call the Aufbau order:
1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p
A helpful trick is the diagonal rule. Write each energy level in a row, then draw arrows diagonally from top right to bottom left. Follow the arrows and you get the order above. Many students tape this chart inside a notebook until it becomes second nature.
How do you write an electron configuration step by step?
Writing a configuration takes four steps. First, find the atomic number, which equals the electron count. Second, start at 1s and follow the fill order. Third, place electrons into each subshell up to its capacity. Fourth, stop when the superscripts add up to the electron count. Then double-check the total.
- Find the atomic number from the periodic table.
- List subshells in fill order until you have enough seats.
- Fill each subshell to capacity, except the last one.
- Put the leftover electrons in the final subshell.
- Add all superscripts and confirm they match the atomic number.
Worked examples of electron configurations
The best way to learn is to watch several atoms filled one step at a time. Each example below tracks the running electron total so you can see where it stops. Every configuration here has been checked against its atomic number.
Oxygen (8 electrons)
Oxygen has 8 electrons. Fill 1s first with 2, leaving 6. Fill 2s with 2, leaving 4. Put the last 4 into 2p, which can hold 6. The result is 1s2 2s2 2p4. Add the superscripts: 2 plus 2 plus 4 equals 8. Correct.
Sodium (11 electrons)
Sodium has 11 electrons. Fill 1s2, then 2s2, then 2p6. That uses 10 electrons. One electron remains, so it goes into 3s. The full configuration is 1s2 2s2 2p6 3s1. The single 3s electron is the atom's lone valence electron.
Chlorine (17 electrons)
Chlorine has 17 electrons. Fill 1s2 2s2 2p6 3s2, which uses 12. That leaves 5 for the 3p subshell, which holds up to 6. The answer is 1s2 2s2 2p6 3s2 3p5. Check the total: 2 plus 2 plus 6 plus 2 plus 5 equals 17.
Calcium (20 electrons)
Calcium has 20 electrons. Fill through argon's pattern first: 1s2 2s2 2p6 3s2 3p6, which uses 18. Now the fill order says 4s comes before 3d. The last 2 electrons go into 4s. The result is 1s2 2s2 2p6 3s2 3p6 4s2.
Iron (26 electrons)
Iron has 26 electrons. Fill up to argon's 18, then add 4s2, reaching 20. The remaining 6 electrons enter the 3d subshell, which holds up to 10. The full configuration is 1s2 2s2 2p6 3s2 3p6 3d6 4s2. Notice that 3d is often written after 4s once both are filled.
How does noble-gas shorthand work?
Noble-gas shorthand replaces the inner electrons with the symbol of the previous noble gas in brackets. This saves space and highlights the outer electrons that drive chemistry. You find the noble gas that comes just before your element, write it in brackets, then add the remaining subshells.
Take iron again. The noble gas before iron is argon, which accounts for the first 18 electrons. So iron becomes [Ar] 3d6 4s2. Sodium becomes [Ne] 3s1, since neon covers its first 10 electrons. Chlorine becomes [Ne] 3s2 3p5. The bracket stands for a full inner shell pattern.
The atoms that break the pattern
A few atoms do not follow the plain fill order because half-filled and fully filled d subshells are extra stable. The two most famous exceptions are chromium and copper. Both borrow one electron from the 4s subshell to improve the 3d subshell. Memorize these two, since teachers test them often.
- Chromium has 24 electrons. The expected pattern is [Ar] 3d4 4s2. The real configuration is [Ar] 3d5 4s1. A half-filled 3d shell is more stable.
- Copper has 29 electrons. The expected pattern is [Ar] 3d9 4s2. The real configuration is [Ar] 3d10 4s1. A fully filled 3d shell is more stable.
Both still add up correctly. Chromium's [Ar] covers 18, plus 5 plus 1 equals 24. Copper's [Ar] covers 18, plus 10 plus 1 equals 29. When an answer looks like d4 or d9, pause and ask whether the atom prefers the more stable arrangement.
Frequently asked questions
Why does 4s fill before 3d?
The 4s subshell sits at slightly lower energy than 3d in a neutral atom, so electrons enter it first under the Aufbau principle. Once electrons occupy the 3d subshell, its energy drops below 4s. That is why many chemists write 3d before 4s in the final configuration even though 4s filled earlier.
How do I know how many electrons to use?
For a neutral atom, the electron count equals the atomic number on the periodic table. Carbon is number 6, so it has 6 electrons. For an ion, adjust the count. A positive charge means you removed electrons. A negative charge means you added them. Always match your superscript total to that adjusted number.
What is the difference between a shell and a subshell?
A shell is an energy level named by a number, such as the third shell. A subshell is a division within a shell named by a letter, such as 3s, 3p, or 3d. Each subshell holds a set number of orbitals.
Do exceptions only happen with chromium and copper?
No, but chromium and copper are the two you will most likely be tested on at the introductory level. Several heavier transition metals and many lanthanides also break the simple pattern. The reasons involve close orbital energies and the stability of half-filled or filled subshells. Learn the two common cases first.
How do I write the configuration of an ion?
Start with the neutral atom, then add or remove electrons for the charge. For a cation, remove electrons from the highest energy level first, which is often the outer s subshell. For an anion, add electrons using the normal fill order. Always confirm the new total matches the ion's electron count.