Molar Mass Calculator

Molar mass is the mass of one mole of a substance, expressed in g/mol. If you can write a chemical formula, you can convert between grams and moles, check solution prep calculations, and verify percent composition for empirical or molecular formulas.

This calculator parses formulas the same way you read them in chemistry: it understands parentheses multipliers like Ca(OH)2 and hydrate dot notation like CuSO4·5H2O (you may also type a period as a fallback, CuSO4.5H2O). For broader course tools, you can also explore the Chemistry Calculator or jump to calculate the theoretical percentage of water for the following hydrates when you specifically need water-of-crystallization calculations.

Looking for more lab-focused utilities? Browse the Scientific Calculators hub for related science tools.

Parses parentheses & hydrates
Shows step-by-step Σ(nᵢ × Aᵢ)
Includes percent composition
Runs locally in your browser

Calculator

Enter a chemical formula
Examples: H2O, Ca(OH)2, CuSO4·5H2O, Al2(SO4)3
Tip: The tool ignores whitespace. Use the middle dot · for hydrates; a period . also works.
Internal calculations keep full precision; rounding is applied only to displayed values.
Show percent composition
Parsing formula and computing molar mass…
Results for
Total molar mass
0g/mol
Unique elements:
Total atoms:
Normalized:
Composition highlights
0% Top element share
Top contributors by mass:
Element breakdown
M = Σ(nᵢ × Aᵢ) where nᵢ is the atom count and Aᵢ is the atomic weight in g/mol.
Element Atomic weight (g/mol) Atom count Contribution (g/mol) Mass %
Enter a formula and press Calculate.
Step-by-step Substituting your counts and atomic weights
Rounding & precision policy: calculations use full internal precision; values shown here are rounded to your selected decimal places.
Keyboard tip: press Enter while focused in the formula input to calculate.
Results will appear here after calculation.

How it works

The calculator expands your formula into element counts and then applies the molar mass formula: M = Σ(nᵢ × Aᵢ). Here, M is molar mass (g/mol), nᵢ is the number of atoms of element i in the formula, and Aᵢ is the atomic weight (g/mol). Parentheses multiply everything inside the group (including nested groups).

Hydrates use dot notation to indicate “addition” of a bound group—most commonly water. For example, CuSO4·5H2O means the total mass is the base compound CuSO4 plus 5 × (H2O). Ionic charges (like SO4^2−) do not change molar mass, because molar mass depends on atom counts, not charge.

Common mistakes

  • Typing co when you mean CO (cobalt vs carbon+oxygen).
  • Forgetting the multiplier after parentheses, e.g., reading (OH)2 as only one O and one H.
  • Using commas or other invalid characters (stick to letters, numbers, parentheses, and dot notation).
  • Mistyping the hydrate separator—use · if available; . is accepted as a fallback.
  • Entering decimal subscripts (not allowed). Subscripts must be integers like H2, not H2.5.

Quick tips

  • Copy-paste formulas without spaces; the tool ignores whitespace automatically.
  • Use the middle dot · for hydrates; the period . also works if your keyboard lacks ·.
  • Double-check capitalization: NaCl is different from Nacl.
  • Start with a known example like H2O to confirm your input style.
  • Increase decimal places for closer agreement with textbook values when needed.

Trust & Notes

  • Accuracy & method: The computation runs locally in your browser using embedded atomic weights and deterministic formula parsing.
  • Rounding & precision: Internal precision is kept during math; only displayed values are rounded to your selected decimal places.
  • Privacy-first: No data is sent anywhere. The widget does not fetch, track, or store your formulas.
  • Last Updated: January 21, 2026
  • Sources & references: Standard atomic weights (periodic table reference values) and conventional formula parsing rules used in general chemistry.

Use cases

  • Preparing solutions (grams ↔ moles): Convert a weighed mass into moles to prepare molar solutions and dilutions accurately.
  • Stoichiometry & limiting reagents: Use molar masses to translate balanced reaction coefficients into real mass relationships.
  • Interpreting hydrate formulas: Separate base salt and waters of crystallization to understand what you are weighing and why.
  • Percent composition checks: Compute mass % by element to compare with lab data or to validate empirical/molecular formulas.
  • Manufacturing & QC conversions: Convert between mass-based specs and amount-of-substance calculations for batching and quality control.

Examples

Example 1: Water (H2O)

Counts: H = 2, O = 1

  • H: 2 × 1.008 = 2.016
  • O: 1 × 15.999 = 15.999
  • Total: 2.016 + 15.999 = 18.015 g/mol
Example 2: Calcium hydroxide (Ca(OH)2)

Expand parentheses: (OH)2 means O = 2 and H = 2; plus Ca = 1

  • Ca: 1 × 40.078 = 40.078
  • O: 2 × 15.999 = 31.998
  • H: 2 × 1.008 = 2.016
  • Total: 40.078 + 31.998 + 2.016 = 74.092 g/mol
Example 3: Copper(II) sulfate pentahydrate (CuSO4·5H2O)

Hydrate split: total = mass(CuSO4) + 5 × mass(H2O)

  • Base part, CuSO4:
    • Cu: 1 × 63.546 = 63.546
    • S: 1 × 32.065 = 32.065
    • O: 4 × 15.999 = 63.996
    • CuSO4 subtotal: 63.546 + 32.065 + 63.996 = 159.607 g/mol
  • Hydrate part, 5H2O:
    • H2O = 18.015 g/mol (from Example 1)
    • 5 × 18.015 = 90.075 g/mol
  • Total: 159.607 + 90.075 = 249.682 g/mol

FAQ

1) What’s the difference between molar mass and molecular weight?
In everyday chemistry, people often use the terms interchangeably, but they come from slightly different ideas. Molar mass is a mass per amount of substance, reported in g/mol, and it’s the practical quantity used for gram-to-mole conversions. Molecular weight is historically a relative number compared to 1/12 of carbon-12 and is sometimes treated as dimensionless. For most calculations, the numeric values match because both are derived from the same atomic weights. When in doubt, use molar mass in g/mol for lab work and stoichiometry.
2) How do parentheses change atom counts in a formula?
Parentheses act like a grouping operator: you count everything inside them and then multiply those counts by the number that follows the closing parenthesis. For example, in Ca(OH)2, the group (OH) is multiplied by 2, so oxygen becomes 2 atoms and hydrogen becomes 2 atoms. This rule applies even when there are nested groups, like Al2(SO4)3, where the sulfate group repeats three times. If the multiplier is missing, it is treated as 1. This is why missing a multiplier is a very common source of wrong molar masses.
3) How are hydrates handled with dot notation (·) or a period (.)?
Hydrates are treated as an “addition” of a separate group to a base compound. The dot indicates that the compound includes extra molecules, most commonly water, in a fixed ratio. For example, CuSO4·5H2O means the total formula is CuSO4 plus 5 copies of H2O. This calculator accepts both the middle dot (·) and a period (.) as a separator, and it normalizes the display to ·. The final molar mass is the sum of the base part and the hydrate part, which is also shown in the step-by-step breakdown.
4) Do ionic charges affect molar mass?
No. Molar mass depends only on which atoms are present and how many of each atom the formula contains. Charges describe electron gain or loss and are essential for balancing reactions and understanding bonding, but they do not change the atomic counts. For example, sulfate might be written as SO4^2− in context, yet the molar mass is still based on one sulfur and four oxygens. If your input includes charge symbols or superscripts, remove them and enter only the neutral atom-count formula. You’ll get the same molar mass either way because the composition is unchanged.
5) Why are atomic weights decimals instead of whole numbers?
Atomic weights shown on the periodic table are typically weighted averages of the naturally occurring isotopes of each element. Because isotopes have different masses and natural abundances vary, the average is rarely a whole number. Chlorine is a classic example: it has two major isotopes, so the average ends up around 35.45 rather than exactly 35 or 37. Your textbook or lab manual may list slightly different values depending on rounding or reference updates. This calculator uses standard reference-style atomic weights and applies rounding only when displaying results, not during internal calculations.
6) How does rounding and decimal precision affect the final result?
Rounding affects the displayed number, not the underlying chemistry. Internally, the calculator keeps full precision for atomic weights and intermediate sums, and it only rounds at the end for display based on your selected decimal places. If you choose fewer decimals, the final molar mass may differ from a reference table by a few thousandths or hundredths due to display rounding. For homework or reports that compare against published values, increase the precision to see closer agreement. Percent composition values also use the unrounded internal totals, then round the final percentages for readability.
7) What are the most common input mistakes, and how do I fix them?
Most issues come from formatting rather than chemistry. First, check capitalization: “co” is cobalt (Co), while “CO” means carbon and oxygen. Next, verify parentheses and multipliers—unbalanced parentheses or a missing multiplier after a group will change counts. Avoid commas, plus signs, and charge symbols; the input should be letters, numbers, parentheses, and optional hydrate dots. For hydrates, use · if possible, but . also works. Finally, subscripts must be integers; decimal subscripts are not valid in standard formulas. If the calculator flags an unknown element, scan the formula for a mistyped symbol.
8) Do spaces or letter case matter when entering a formula?
Whitespace does not matter—spaces are ignored—so you can paste formulas with or without spacing. Letter case does matter because element symbols are case-sensitive: “Na” is sodium, but “NA” is not a valid element symbol in chemical notation. Similarly, “Cl” is chlorine, while “CL” is not correct. If you’re copying from a document, make sure the capitalization remains intact. The calculator normalizes the display by trimming extra spaces and standardizing hydrate separators to the middle dot. This helps you confirm that the parsed formula matches what you intended to enter.

Related Calculators

More Helpful Calculators

Copied! Text copied to clipboard.
🚧
Coming Soon

This calculator is being built.

×