Formula Parser
Free scientific Formula Parser: Interpret element counts, parentheses, and hydrates. Verified laboratory formulas, dynamic unit conversion, and stoichiometry protocol reference.
Interpret element counts, parentheses, and hydrates.
Ready to evaluate based on current input parameters.
How Formula Parser Works?
The Formula Parser works by reading a chemical formula character by character and expanding every element symbol, subscript, bracket group and hydrate term into an atom count. Mg(OH)₂ resolves to 1 Mg, 2 O and 2 H.
- 1Enter the formula string
Type the formula as written on the reagent label, including brackets and the hydrate dot, for example K₃[Fe(CN)₆].
- 2Review the element breakdown
The parser lists each element with its atom count, which exposes miscounted brackets immediately.
- 3Check the hydrate term
Water molecules after the dot appear as a separate contribution so the anhydrous and hydrated masses stay distinguishable.
- 4Use the atom counts
Feed the parsed counts into molar mass summation, elemental percentage composition or ion stoichiometry.
Capitalisation changes the chemistry. CO parses as carbon plus oxygen at 28.01 g/mol, while Co parses as cobalt at 58.93 g/mol.
Formula Parser Formula
Formula parsing applies the rule count(element) = subscript × every enclosing bracket multiplier, then sums atomic masses over the expanded counts.
Rearranged Forms
- MWtotal = MWanhydrous + x × 18.015
- % element = (Ar × n) / MW × 100
- formula units = m / MW × NA
Worked Example
Parse ammonium iron(II) sulfate hexahydrate, (NH₄)₂Fe(SO₄)₂·6H₂O.
- N = 2, H = 8 from (NH₄)₂; Fe = 1
- S = 2, O = 8 from (SO₄)₂
- Hydrate adds H = 12, O = 6
- Totals: N 2, H 20, Fe 1, S 2, O 14 → MW = 392.13 g/mol
Formula Parser Conversion Table
The table shows how six notation patterns expand into atom counts. Each row isolates one parsing rule.
| Formula | Pattern | Expanded atom counts | Molar mass |
|---|---|---|---|
| H₂O | Simple subscript | H 2, O 1 | 18.015 g/mol |
| Ca(OH)₂ | Bracket multiplier | Ca 1, O 2, H 2 | 74.09 g/mol |
| Al₂(SO₄)₃ | Nested multiplier | Al 2, S 3, O 12 | 342.13 g/mol |
| CuSO₄·5H₂O | Hydrate dot | Cu 1, S 1, O 9, H 10 | 249.69 g/mol |
| K₃[Fe(CN)₆] | Square brackets | K 3, Fe 1, C 6, N 6 | 329.24 g/mol |
| CH₃COONa | Condensed organic | C 2, H 3, O 2, Na 1 | 82.03 g/mol |
Square brackets around a coordination sphere behave the same as round brackets for counting purposes; the distinction is structural notation only.
What is Formula Parser?
A formula parser is a tool that converts chemical formula notation into an explicit list of elements and atom counts. The output feeds molar mass, percentage composition and ion stoichiometry calculations.
Chemical formula notation compresses structural information through subscripts, nested brackets, charge annotations and hydrate dots. Manual expansion of a formula such as (NH₄)₂Fe(SO₄)₂·6H₂O miscounts oxygen often; oxygen appears in two separate groups plus the hydrate. Mechanical parsing removes that arithmetic step and makes the atom inventory auditable.
- ●Hill notation orders formulas carbon first, hydrogen second, then remaining elements alphabetically.
- ●A centred dot separates stoichiometrically bound water that still counts toward molar mass.
- ●Coordination compounds place the inner sphere in square brackets, as in [Cu(NH₃)₄]SO₄.
- ●Charge superscripts affect ion balance calculations without changing the molar mass sum.
What are the uses of Formula Parser?
Formula parsing serves 5 chemical calculations: molar mass summation, percentage composition, ion stoichiometry, hydrate accounting and formula error detection.
Produce the exact atom inventory needed to sum atomic masses without manual bracket arithmetic.
Report the mass fraction each element contributes, used in elemental analysis comparisons.
Determine how many of each ion a dissolving formula unit releases into solution.
Separate lattice water from the anhydrous core so both molar masses stay available.
Catch unbalanced brackets, lowercase element symbols and missing subscripts before a preparation starts.