What this calculator does
A molecular weight calculator works out the mass of one mole of a compound, in grams per mole, directly from its chemical formula. Water, H2O, has a molecular weight of about 18.015 g/mol because it is made of two hydrogen atoms at roughly 1.008 g/mol each and one oxygen atom at roughly 15.999 g/mol, added together.
This is the everyday chemistry calculation behind converting between grams and moles, working out reaction stoichiometry, or preparing a solution of a known molar concentration. It starts from the formula itself, reading off each element and its subscript, which is a different starting point from working backwards to a molar mass from gas-law measurements of pressure, volume and temperature.
The formula
The formula is read element by element: each capital letter (optionally followed by one lowercase letter) is an element symbol, and any digits immediately after it are the number of atoms of that element. The atomic weight of each element, taken from the standard periodic table, is multiplied by its count and the results are added together. This calculator handles simple formulas without parentheses, such as H2O, NaCl, CaCO3 or C6H12O6.
| Term | Meaning |
|---|---|
| Molecular weight | The mass of one mole of the compound, in grams per mole, found by summing atomic weights across the formula. |
| Atomic weight | The standard average mass of one atom of an element, in grams per mole, as published for that element. |
| Subscript | The number written after an element symbol showing how many atoms of it appear in the formula; no number means one atom. |
The inputs explained
| Field | What to enter |
|---|---|
| Chemical formula (e.g. H2O, NaCl, C6H12O6) | Type the chemical formula exactly as written, with capital letters starting each element symbol, such as H2O, NaCl or C6H12O6. Formulas with parentheses are not supported. |
When to use it
Converting between grams and moles
Molecular weight is the conversion factor between the mass of a sample and the number of moles it contains, which is the starting point for almost every stoichiometry calculation.
Preparing a solution of known concentration
Making up a solution to a target molarity requires knowing how many grams of the compound correspond to one mole, which is exactly what molecular weight provides.
Checking a formula by hand
Working out a molecular weight by hand from a table of atomic weights is easy to get wrong through a missed subscript or a transposed digit; recalculating it here is a quick check.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
What is the molecular weight of some common compounds?
The same calculation applied to a handful of common compounds.
| Formula | Molecular weight |
|---|---|
| H2O | 18.015 g/mol |
| NaCl | 58.440 g/mol |
| CO2 | 44.009 g/mol |
| C6H12O6 | 180.156 g/mol |
| CaCO3 | 100.086 g/mol |
Questions
What is the difference between molecular weight and molar mass?
In practice the two terms are used interchangeably for most purposes: both describe the mass of one mole of a substance in grams per mole. Some texts reserve "molecular weight" for a technically dimensionless ratio, but the numeric value quoted is the same.
Why does this calculator not support parentheses?
Formulas with grouped subscripts, such as Ca(OH)2, need the group repeated by its own multiplier before summing, which this calculator does not parse. For those formulas, expand the group by hand first, for example writing Ca(OH)2 as CaO2H2, before entering it.
How is this different from the molar mass of a gas calculator?
The molar mass of a gas calculator works backwards to a molar mass from measured pressure, volume, temperature and mass, using the ideal gas law, without needing to know the formula. This calculator instead starts from a known chemical formula and sums atomic weights directly.
Why are atomic weights not whole numbers?
A published atomic weight is a weighted average across an element's naturally occurring isotopes, each with a slightly different mass and a different natural abundance, which is why chlorine, for example, averages to about 35.45 rather than a whole number.
If you are working from measured gas properties rather than a known formula, see the molar mass of a gas calculator.