Ion/Atom Counter (per Formula Unit) Calculator
Tell me a chemical formula and what you want to count, and I’ll return how many of those atoms or ions are present in one formula unit.
Background
This calculator parses a chemical formula (supports parentheses, nesting, and hydrates) and counts either (1) a single element symbol (like O, Na, S) or (2) a polyatomic ion pattern (like PO4, NO3, SO4, NH4, OH). It also shows the full per-formula-unit element breakdown so you can double-check your work.
How to use the counter
1) Enter a valid chemical formula (case sensitive for element symbols).
2) Choose whether you are counting a single element (e.g., O) or a polyatomic ion (e.g., PO4).
3) Click Count to see the occurrences per formula unit and the full element breakdown.
Key Points
- Parentheses and nesting are supported: Al2(SO4)3.
- Hydrates (dot notation) work: CuSO4·5H2O.
- Ion matching looks for the queried sequence (e.g., P–O4) in the ordered expansion.
What is “per formula unit”?
A formula unit is the smallest whole-number ratio of ions or atoms represented by a chemical formula. For example, in Ca3(PO4)2, a single formula unit contains 3 Ca, 2 PO4 groups, and 8 O atoms (inside the two phosphate groups).
Example Problems
Example 1
Formula: Ca3(PO4)2. Count PO4 groups.
- (PO4) has a multiplier of 2 → 2 phosphate ions per formula unit.
- Element breakdown: Ca = 3, P = 2, O = 8.
Example 2
Formula: Al2(SO4)3·18H2O. Count SO4 and O.
- (SO4)3 → 3 sulfate ions per formula unit.
- O atoms: 3×4 in sulfates (= 12) + 18×2 in water (= 36) → 48 O atoms.
Frequently Asked Questions
Q: Do hydrates work (e.g., CuSO4·5H2O)?
Yes—use a dot (·) or period (.). The counter handles each part and its multiplier.
Q: Can I count any ion, or only common ones?
You can enter any sequence like PO4, NO3, OH, NH4, CO3, etc.
Q: Is the element breakdown also shown?
Yes, you get a full per-formula-unit element table for quick checks.