Chemical Formula Calculator
Parse chemical formulas and calculate molar mass and percent composition.
Acerca de esta herramienta
Enter any chemical formula — such as H2O, C6H12O6, Ca(OH)2, or NaHCO3 — and instantly get a full element breakdown, the molar mass in g/mol, and the percent composition by mass for each element. Handles nested parentheses, subscripts, and multi-letter element symbols. Click any element in the result table to view its periodic table data.
Cómo usar
- 1 Type a chemical formula in the input field (e.g., Ca(OH)2).
- 2 Click 'Calculate' or press Enter to parse the formula.
- 3 View the element breakdown table showing each element, count, atomic mass, and mass contribution.
- 4 Read the total molar mass and percent composition by mass for each element.
- 5 Click any element row to see its full periodic table entry.
What molar mass tells you, and how it is built
The molar mass of a compound is the mass, in grams, of one mole — that is, 6.022×1023 formula units — of that substance. It is the bridge between the world you can weigh on a balance and the world of individual atoms you can only count indirectly. To find it, you add up the standard atomic weight of every atom in the formula. Each element's atomic weight is itself a weighted average across that element's natural isotopes, which is why the values are not whole numbers: chlorine is 35.45, not 35, because real chlorine is a mix of chlorine-35 and chlorine-37. This calculator uses IUPAC standard atomic weights and does all the arithmetic in your browser.
How the formula is parsed
A chemical formula looks simple but is genuinely a small language, and the tool reads it the way a compiler reads code. It scans left to right: a capital letter starts an element symbol, an optional lowercase letter completes a two-letter symbol (so Ca is calcium, not carbon-then-something), and the digits that follow are the subscript count. Parentheses push a temporary group onto a stack; when a closing parenthesis is reached, the multiplier after it is distributed across every atom inside. This is what lets Ca(OH)2 correctly yield one calcium, two oxygen, and two hydrogen rather than being misread.
A worked example: calcium hydroxide, Ca(OH)2
Type Ca(OH)2 and the parser produces the atom counts Ca×1, O×2, H×2. Now multiply each by its atomic weight and sum:
| Element | Count | Atomic weight (u) | Mass contribution |
|---|---|---|---|
| Ca | 1 | 40.078 | 40.078 |
| O | 2 | 15.999 | 31.998 |
| H | 2 | 1.008 | 2.016 |
| Molar mass | 74.092 g/mol | ||
Percent composition then divides each contribution by the total: calcium is 40.078 / 74.092 = 54.09%, oxygen is 31.998 / 74.092 = 43.19%, and hydrogen is 2.016 / 74.092 = 2.72%. Notice the percentages sum to 100, which is a quick sanity check that the formula was parsed correctly.
Why percent composition is useful
Percent by mass is the workhorse number behind several common chemistry tasks. Given a compound's experimental percent composition, you can work backward to its empirical formula. It tells you the nutritional or industrial yield of a target element — for example, how much nitrogen a fertilizer delivers per kilogram. And it lets you compare sources: ammonium nitrate (NH4NO3) versus urea as nitrogen carriers, or different iron ores by their iron content. For glucose, C6H12O6, the tool reports a molar mass of 180.156 g/mol and carbon at exactly 40.00% — a clean number that often appears in textbook problems.
Practical tips
- Use parentheses for repeating groups. Write aluminium sulfate as
Al2(SO4)3, notAl2S3O12. Both give the same mass, but the parenthesized form shows the sulfate units and is what other tools expect. - Capitalization is meaningful.
COis carbon monoxide;Cois the element cobalt. The parser distinguishes them by case, so type symbols exactly. - Click any row for the element's data. Each result row expands to show atomic number, group, period, and atomic mass — handy when you are checking which element a symbol refers to.
- Check the percentages add to ~100%. Small rounding aside, a sum far from 100 means a typo somewhere in the formula.
Common mistakes
- Confusing molar mass with molecular weight. They are numerically identical; molecular weight is dimensionless (in atomic mass units, u) and molar mass carries g/mol. The tool reports both perspectives.
- Forgetting water of hydration. A hydrate like copper sulfate pentahydrate is
CuSO4(H2O)5in mass terms; omitting the water badly underestimates the molar mass. Include every atom that is actually present. - Mixing up subscripts and coefficients. In a balanced equation,
2 H2Omeans two molecules; here you only enter the formula of one unit,H2O. Coefficients belong in stoichiometry, not in the formula box. - Unbalanced parentheses. An extra or missing bracket throws an error rather than guessing — re-check that every
(has a matching).
Where this fits in your workflow
Molar mass and percent composition are the first step in almost every quantitative chemistry calculation: converting grams to moles for a reaction, computing theoretical yield, preparing a solution of known concentration, or interpreting elemental analysis results. Having the parse, the mass, and the composition in one place — with the element data a click away — turns a multi-step lookup into a single entry.