Skip to main content
Molar Concentration & Dilution Calculator
Concentration Molar CalculatorPro
Molarity & Solution Preparation

Formula Parser

Free scientific Formula Parser: Interpret element counts, parentheses, and hydrates. Verified laboratory formulas, dynamic unit conversion, and stoichiometry protocol reference.

Molarity & Solution Preparation
Formula Parser

Interpret element counts, parentheses, and hydrates.

Scientific Governing Model:M = m / (MW × V)
Input ParametersReal-Time Solving
Computed Output
Calculated Parameter Result
--
--
Bench Protocol Note:

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.

  1. 1
    Enter the formula string

    Type the formula as written on the reagent label, including brackets and the hydrate dot, for example K₃[Fe(CN)₆].

  2. 2
    Review the element breakdown

    The parser lists each element with its atom count, which exposes miscounted brackets immediately.

  3. 3
    Check the hydrate term

    Water molecules after the dot appear as a separate contribution so the anhydrous and hydrated masses stay distinguishable.

  4. 4
    Use 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.

nelement = satom × Π sbracket  →  MW = Σ (Ar × n)
satomSubscript written directly after the element symbol
sbracketMultiplier on each bracket group enclosing that atom
xHydrate coefficient written after the centred dot
nTotal atom count of one element per formula unit

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.

  1. N = 2, H = 8 from (NH₄)₂; Fe = 1
  2. S = 2, O = 8 from (SO₄)₂
  3. Hydrate adds H = 12, O = 6
  4. 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.

FormulaPatternExpanded atom countsMolar mass
H₂OSimple subscriptH 2, O 118.015 g/mol
Ca(OH)₂Bracket multiplierCa 1, O 2, H 274.09 g/mol
Al₂(SO₄)₃Nested multiplierAl 2, S 3, O 12342.13 g/mol
CuSO₄·5H₂OHydrate dotCu 1, S 1, O 9, H 10249.69 g/mol
K₃[Fe(CN)₆]Square bracketsK 3, Fe 1, C 6, N 6329.24 g/mol
CH₃COONaCondensed organicC 2, H 3, O 2, Na 182.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.

Molar mass summation

Produce the exact atom inventory needed to sum atomic masses without manual bracket arithmetic.

Percentage composition

Report the mass fraction each element contributes, used in elemental analysis comparisons.

Ion stoichiometry

Determine how many of each ion a dissolving formula unit releases into solution.

Hydrate accounting

Separate lattice water from the anhydrous core so both molar masses stay available.

Error detection

Catch unbalanced brackets, lowercase element symbols and missing subscripts before a preparation starts.