Intermediate

Molecular Weight Calculator — Molar Mass by Formula

Type any chemical formula — H₂O, CO₂, C₆H₁₂O₆, or Ca(OH)₂ — to get the molar mass in g/mol instantly. Parentheses and nested groups are fully supported. Enter an optional sample mass to convert grams to moles.
Case-sensitive element symbols; parentheses supported

g

Enter to convert grams to moles via n = m / M
Molecular weight
18.015g/mol

Sum of standard atomic weights for every atom in the formula

H ×2
2.016 g/mol
O ×1
15.999 g/mol
11%
89%
H
O
Mass contribution of each element (% of total molecular weight)
Step by step
  1. 1

    H × 2

    1.008 × 2 = 2.016 g/mol
  2. 2

    O × 1

    15.999 × 1 = 15.999 g/mol
  3. 3

    Total molecular weight

    18.015
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Type a chemical formula and the calculator sums the IUPAC 2021 atomic weights of every atom: M = Σ (nᵢ × AWᵢ). H₂O → 18.015 g/mol; C₆H₁₂O₆ → 180.156 g/mol; Ca(OH)₂ → 74.093 g/mol. Parentheses supported. Enter a sample mass to convert grams to moles via n = m / M.

Formula
M = Σ (nᵢ × AWᵢ) where nᵢ = atom count, AWᵢ = standard atomic weight (IUPAC 2021, g/mol)
How this is calculated

The molecular weight (molar mass) is the sum of the standard atomic weights of every atom in the formula, expressed in g/mol. For H₂O that is 2 × 1.008 + 1 × 15.999 = 18.015 g/mol. The atomic weights used here follow IUPAC 2021 values for the most abundant natural isotope mix.

The formula parser handles element symbols (one uppercase letter optionally followed by one lowercase letter), numeric subscripts, and nested parentheses. Fe₂(SO₄)₃ expands to {Fe: 2, S: 3, O: 12} for a molar mass of 399.878 g/mol. Ca(OH)₂ becomes {Ca: 1, O: 2, H: 2} = 74.093 g/mol. Symbols must be correctly capitalised (Ca, not CA; Fe, not FE).

If you enter an optional sample mass in grams, the calculator converts it to moles via n = m / M. The elemental breakdown bar shows what fraction of the total molecular weight each element contributes — useful for understanding a compound's composition by mass.

Frequently asked questions

Molecular weight is a dimensionless ratio (relative to 1/12 the mass of carbon-12), while molar mass has units of g/mol — but their numerical values are identical. In everyday chemistry the terms are used interchangeably, and this calculator uses g/mol throughout.

The most common issue is capitalisation: symbols must use one uppercase letter and optional lowercase — Ca (calcium), not CA or ca. The parser also does not support isotope notation (²H, ¹⁴C) or the 10 rarest elements. Check the hint under the field for supported elements.

Divide the sample mass by the molar mass: n = m / M. For 36 g of water (M = 18.015 g/mol) you have 36 ÷ 18.015 ≈ 2 mol. Enter the sample mass in the optional field and the calculator performs this conversion automatically.

Also known as

molecular weight calculator
molar mass calculator
chemical formula weight
formula weight calculator
atomic mass calculator
compound molar mass
chemistry molecular weight

APA

TG we-Calculate Editorial Team. (2026). Molecular Weight Calculator — Molar Mass by Formula [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/molecular-weight-calculator

Chicago

TG we-Calculate Editorial Team. "Molecular Weight Calculator — Molar Mass by Formula." TG we-Calculate. 2026. https://we-calculate.com/calculator/molecular-weight-calculator.

IEEE

TG we-Calculate Editorial Team, "Molecular Weight Calculator — Molar Mass by Formula," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/molecular-weight-calculator

BibTeX

@misc{wecalculate_molecular_weight_calculator, title = {Molecular Weight Calculator — Molar Mass by Formula}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/molecular-weight-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?