What this calculator does
Type a compound or ion — add the overall charge after a space for
ions (Cr2O7 2-, NH4+) — and the calculator
assigns an oxidation state to every element, showing which rule
produced each number. For any single element whose state isn't fixed
by the standard rules, it solves the value algebraically from the
requirement that the sum of all oxidation states equals the overall
charge.
The assignment rules, in the order they're applied
| # | Rule | Assigned state |
|---|---|---|
| 1 | Elemental form (H₂, O₂, N₂, Cl₂, S₈, Fe, …) | 0 |
| 2 | Fluorine, in any compound | −1 |
| 3 | Group 1 metals (Li, Na, K, Rb, Cs, Fr) | +1 |
| 3 | Group 2 metals (Be, Mg, Ca, Sr, Ba, Ra) | +2 |
| 3 | Al · Zn · Cd · Ag (reliably fixed in practice) | +3 · +2 · +2 · +1 |
| 4 | Hydrogen — bonded to a nonmetal (default) | +1 |
| 4 | Hydrogen — in a metal hydride (NaH, CaH₂, LiAlH₄) | −1 |
| 5 | Oxygen — default | −2 |
| 5 | Oxygen — in a peroxide (H₂O₂, Na₂O₂, BaO₂, …) | −1 |
| 5 | Oxygen — in a superoxide (KO₂, NaO₂, …) | −½ |
| 5 | Oxygen — bonded to fluorine (OF₂) | solved (+2) |
| 6 | Any one remaining element | solved from charge balance |
Rule 6 only works when exactly one element is still unknown after rules 1–5. If two different elements are both variable-state (like nitrogen and chlorine in NH₄ClO₄), the charge-balance equation is under-determined and the calculator asks you to analyze each ion separately instead of guessing. Repeated atoms of the same unknown element — like the two chemically different nitrogens in NH₄NO₃ — aren't caught by this check, since they collapse into one combined unknown; see the FAQ below for why that formula needs to be split by hand instead.
Worked examples
1. HNO₃ (nitric acid). H is +1 (bonded to a
nonmetal). O is −2 × 3 = −6 (default, no peroxide/superoxide/OF₂
pattern). Overall charge is 0 (neutral molecule), so nitrogen must
make up the difference: N = 0 − (1 + (−6)) = 0 − (−5) = +5.
2. Cr₂O₇²⁻ (dichromate ion). O is −2 × 7 = −14.
The ion's overall charge is −2, and there are two chromium atoms, so
2 × Cr = −2 − (−14) = 12, giving
Cr = +6 per atom.
3. Fe₃O₄ (magnetite) — mixed valence. O is
−2 × 4 = −8. Overall charge is 0 and there are three iron atoms:
3 × Fe = 0 − (−8) = 8, so
Fe = 8/3 ≈ +2.67. This non-integer result is real — it's
the average of one Fe²⁺ and two Fe³⁺ ions in the actual crystal
structure, which the formula-level charge balance can't separate.
Common errors to avoid
Forgetting the hydride exception. Hydrogen is +1 almost everywhere, but flips to −1 when bonded only to a more electropositive metal (NaH, CaH₂). Applying +1 to hydride hydrogen gives the wrong sign for every other element in the compound too, since the charge balance is thrown off.
Applying −2 to every oxygen. Peroxides (−1) and superoxides (−½) are common enough in general chemistry (hydrogen peroxide, sodium peroxide, potassium superoxide) that assuming −2 everywhere silently breaks those specific compounds.
Treating a compound like NH₄NO₃ as one system. It has two nitrogens with genuinely different real oxidation states (−3 in the ammonium cation, +5 in the nitrate anion). Because they're the same element, entering the whole neutral formula won't raise an error — it silently averages both nitrogens into one number (+1) that balances the overall charge but isn't the true state of either one. Solve the cation and anion separately instead.