Molar Mass Calculator
Enter any chemical formula to get the molar mass in g/mol, plus element-by-element composition breakdown.
Case-sensitive: H not h. Supports parentheses: Ca(OH)₂, Fe₂(SO₄)₃
Common Formulas
Molar Mass
—
g/mol
Formula:
—
Elemental Composition
Element-by-Element Breakdown
| Element | Count | Atomic Mass (g/mol) | Contribution (g/mol) | % of Total |
|---|---|---|---|---|
| Total Molar Mass | 100.00% | |||
Embed This Calculator
Copy the code and paste it into any webpage to embed this calculator.
WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.
Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.
How to use this calculator
One input: the chemical formula.
Type the formula using standard chemical notation. The calculator reads element symbols, subscripts, parentheses, and hydrate dot notation. It returns the molar mass in g/mol with a full breakdown of each element’s contribution.
Input formats the calculator handles:
- Simple compounds: H2O, NaCl, CO2, HCl, NH3
- Compounds with parentheses: Ca(OH)2, Al2(SO4)3, Fe2(SO4)3
- Organic molecules: C6H12O6, C2H5OH, CH3COOH, C12H22O11
- Hydrates: CuSO4·5H2O, Na2CO3·10H2O, MgSO4·7H2O
- Complex inorganics: K2Cr2O7, KMnO4, Na2S2O3·5H2O
The calculator parses the formula as:
- Ca: 1 atom × 40.078 g/mol = 40.078
- O: 2 atoms × 15.999 g/mol = 31.998 (the subscript 2 after the closing bracket doubles both O and H)
- H: 2 atoms × 1.008 g/mol = 2.016
- Total molar mass: 74.092 g/mol
Without the parenthesis rule, a manual calculation might use only 1 O and 2 H, giving 58.093 g/mol. That’s a 27% error before the calculation even starts.
What molar mass actually is
Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol).
One mole is 6.022 × 10²³ units. That number is Avogadro’s constant. It’s the count of atoms in exactly 12 grams of carbon-12. The choice is arbitrary in one sense, but it makes molar mass numerically equal to atomic mass, which is the convenient property that makes the whole system work.
Carbon has an atomic mass of 12.011 atomic mass units (amu). Its molar mass is 12.011 g/mol. The number is the same, the units are different, and the scale is different by a factor of Avogadro’s number.
This equivalence means the periodic table doubles as a molar mass table. Look up an element, read its atomic mass, append “g/mol,” and you have the molar mass for one mole of that element.
For compounds, you add up the molar masses of every atom in the formula. The complexity is in parsing the formula correctly when it contains parentheses, subscripts, or hydrate notation.
The formula
For H₂O: M = (1.008 × 2) + (15.999 × 1) = 18.015 g/mol For CO₂: M = (12.011 × 1) + (15.999 × 2) = 44.009 g/mol For Ca(OH)₂: M = (40.078 × 1) + (15.999 × 2) + (1.008 × 2) = 74.092 g/mol
The Greek sigma (Σ) means “sum of.” Add up the (atomic mass × atom count) term for every element in the formula. The total is the molar mass.
Step-by-step parsing: how formulas are read
Understanding how the calculator parses formulas helps you enter them correctly and catch errors in your own manual calculations.
Simple subscripts
H₂O: the subscript 2 applies only to the immediately preceding element, hydrogen. So: 2 H atoms, 1 O atom.
CO₂: 1 C atom, 2 O atoms.
Parentheses and subscripts together
Ca(OH)₂: the subscript 2 is outside the closing parenthesis. It multiplies every atom inside the brackets by 2.
Inside the brackets: 1 O, 1 H. After applying the subscript 2: 2 O, 2 H. Plus the Ca: 1 Ca, 2 O, 2 H.
More complex parentheses: Al₂(SO₄)₃
The subscript 3 outside the bracket multiplies everything inside. Inside the bracket: 1 S, 4 O. After multiplying: 3 S, 12 O. Plus the prefix: 2 Al.
Hydrate dot notation
CuSO₄·5H₂O: the dot separates the main compound from the water of crystallisation. The 5 before H₂O means 5 water molecules per formula unit.
The anhydrous CuSO₄ has a molar mass of 159.607 g/mol. The pentahydrate adds 90.075 g/mol (5 × 18.015). Getting this wrong by using the anhydrous value introduces a 56% error in every mole calculation that follows.
Molar masses of common compounds
Element-by-element breakdowns for 15 compounds you’ll encounter frequently:
| Compound | Formula | Molar mass (g/mol) | Key elements |
|---|---|---|---|
| Water | H₂O | 18.015 | H×2 + O×1 |
| Carbon dioxide | CO₂ | 44.009 | C×1 + O×2 |
| Table salt | NaCl | 58.443 | Na×1 + Cl×1 |
| Ammonia | NH₃ | 17.031 | N×1 + H×3 |
| Glucose | C₆H₁₂O₆ | 180.156 | C×6 + H×12 + O×6 |
| Sulfuric acid | H₂SO₄ | 98.072 | H×2 + S×1 + O×4 |
| Sodium hydroxide | NaOH | 39.997 | Na×1 + O×1 + H×1 |
| Calcium carbonate | CaCO₃ | 100.086 | Ca×1 + C×1 + O×3 |
| Hydrochloric acid | HCl | 36.461 | H×1 + Cl×1 |
| Ethanol | C₂H₅OH | 46.068 | C×2 + H×6 + O×1 |
| Potassium permanganate | KMnO₄ | 158.034 | K×1 + Mn×1 + O×4 |
| Iron(III) oxide | Fe₂O₃ | 159.687 | Fe×2 + O×3 |
| Phosphoric acid | H₃PO₄ | 97.994 | H×3 + P×1 + O×4 |
| Sucrose | C₁₂H₂₂O₁₁ | 342.297 | C×12 + H×22 + O×11 |
| Copper sulfate (pentahydrate) | CuSO₄·5H₂O | 249.682 | Cu+S+4O + 5×(2H+O) |
Elemental composition percentages
The molar mass breakdown also gives you the mass percentage of each element in the compound. This is the elemental composition, and it’s used in analytical chemistry to verify unknown compounds.
For water (H₂O, molar mass 18.015 g/mol):
For glucose (C₆H₁₂O₆, molar mass 180.156 g/mol):
Combustion analysis burns an organic compound and measures the carbon dioxide and water produced. From the masses of CO₂ and H₂O, you calculate the carbon and hydrogen percentages. The oxygen percentage comes by difference (100% minus everything else). Then you compare those percentages to candidate formulas. Molar mass drives the entire comparison.
Where molar mass shows up in real calculations
Solution preparation
You need 500 mL of 0.5M KMnO₄ solution for a titration.
Molar mass of KMnO₄: K = 39.098 × 1 = 39.098 Mn = 54.938 × 1 = 54.938 O = 15.999 × 4 = 63.996 Total = 158.032 g/mol
Mass to weigh = 0.25 mol × 158.032 g/mol = 39.508 g
Weigh out 39.51 g of KMnO₄, dissolve in approximately 400 mL of distilled water, then make up to exactly 500 mL in a volumetric flask.
Every step depends on the molar mass being correct. A 5% error in molar mass gives a solution that’s 5% off in concentration, which propagates into every titration result using that solution.
Stoichiometry
Balanced equations work in mole ratios. To find how many grams of one substance react with a given mass of another, you need molar masses for both.
How much CO₂ (g) is produced from 10 g of CaCO₃?
Molar mass of CaCO₃ = 100.086 g/mol Moles of CaCO₃ = 10 ÷ 100.086 = 0.0999 mol
From the equation: 1 mol CaCO₃ produces 1 mol CO₂ Moles of CO₂ = 0.0999 mol
Molar mass of CO₂ = 44.009 g/mol Mass of CO₂ = 0.0999 × 44.009 = 4.397 g
Percent yield
Theoretical mass = moles expected × molar mass of product
If the theoretical yield is calculated with the wrong molar mass, your percent yield is wrong. A 10% error in molar mass gives a 10% error in theoretical yield, which makes an actually acceptable reaction (90% yield) appear either better or worse than it is.
Why atomic masses aren’t round numbers
Carbon’s atomic mass is 12.011, not 12. Chlorine is 35.45, not 35 or 37. These aren’t rounding errors or measurement uncertainty. They’re weighted averages of naturally occurring isotopes.
Chlorine in nature is always a mixture of ³⁵Cl (75.77% of all chlorine atoms, mass 34.969) and ³⁷Cl (24.23%, mass 36.966).
Every bottle of sodium chloride you buy contains this natural chlorine mixture. So does every HCl solution, every chlorine gas reaction, and every NaCl dissolved in water. Using 35.453 for chlorine is correct because that’s what you actually have.
If you’re using isotopically pure ³⁵Cl (like in some NMR experiments or nuclear applications), the molar mass would be based on 34.969 instead. But for all normal chemistry, the standard atomic weight is what applies.
Common entry errors
Case sensitivity. H is hydrogen. h is not recognised. Co is cobalt. CO is carbon monoxide (one carbon, one oxygen). Cu is copper. CU would be read as carbon and uranium if the parser is case-sensitive. Element symbols are always one uppercase letter, sometimes followed by one lowercase letter. Getting the case wrong changes the element.
Forgetting subscripts. H₂SO₄ without the subscripts becomes HSO (if you type HSO4 correctly it works; if you type HSOOOO instead you’ve made four separate oxygen atoms, which actually gives the same result, but it’s a bad habit). The most common omission is forgetting the subscript after hydrogen: HO instead of H₂O.
Missing the hydrate notation. CuSO4 and CuSO4·5H2O have molar masses of 159.607 and 249.682 g/mol respectively. If your sample is the blue pentahydrate crystals and you enter the anhydrous formula, you’re off by 56%.
Copying formulas from unreliable sources. Wikipedia is generally reliable for chemical formulas. Random homework websites aren’t. Verify against a chemical database (PubChem, ChemSpider, or your course textbook) if you’re unsure.
Standard atomic weights vs monoisotopic masses
For mass spectrometry, the molar masses from this calculator are wrong by design.
Mass spectrometry separates molecules by exact mass. Each molecule ionised in the mass spectrometer is a single molecular entity with a specific, exact mass based on which isotopes of each element it contains. The most common isotope combination is the monoisotopic mass.
| Element | Standard atomic weight | Monoisotopic mass | Difference |
|---|---|---|---|
| H | 1.008 | 1.00783 | +0.025% |
| C | 12.011 | 12.000 | -0.092% |
| N | 14.007 | 14.003 | -0.029% |
| O | 15.999 | 15.995 | -0.025% |
| Cl | 35.453 | 34.969 | -1.37% |
| Br | 79.904 | 78.918 | -1.23% |
For most elements the difference is small. For Cl and Br, which have two common isotopes in roughly equal abundance, the standard weight and monoisotopic mass differ by over 1%. In high-resolution mass spectrometry, that difference is the entire point of the technique.
Use this calculator for standard chemistry. For mass spec work, use a monoisotopic mass calculator.
Standard atomic masses are right for almost everything. Monoisotopic masses are right for mass spectrometry. Knowing which one you need prevents a category of errors that can take hours to diagnose.
The lab scenario: preparing 0.5M KMnO₄
A concrete example of molar mass in practice.
Potassium permanganate (KMnO₄) is a common oxidising agent used in redox titrations and water treatment. You need 250 mL of a 0.5M solution.
Step 2: Calculate molar mass of KMnO₄. K = 39.098 × 1 = 39.098 Mn = 54.938 × 1 = 54.938 O = 15.999 × 4 = 63.996 Total = 158.032 g/mol
Step 3: Calculate mass to weigh. 0.125 mol × 158.032 g/mol = 19.754 g
Step 4: Weigh 19.75 g of KMnO₄ on an analytical balance. Dissolve in about 200 mL of distilled water in a 250 mL volumetric flask. Make up to the 250 mL mark.
Result: 0.5M KMnO₄ solution.
If you used 158 g/mol instead of 158.032, your mass would be 19.750 g instead of 19.754 g. A 0.004 g difference. At this scale, that’s well within the balance’s precision, and it doesn’t matter.
If you used a rough approximation of 158 × 0.125 = 19.75 g, same result. The precision of your balance (±0.001 g on most analytical balances) dominates the uncertainty, not the molar mass precision.
The point: use full precision in the calculation, then let your measurement precision limit the final answer.
Molar mass calculation is not the hard part
The arithmetic is straightforward. Multiply atom count by atomic mass, sum the results.
What trips people up is formula parsing: subscripts that apply only to the preceding element, parentheses that multiply entire groups, hydrate notation that adds water molecules to the count. Miss any of these and your molar mass is wrong, which makes every calculation that follows wrong.
This calculator handles the parsing automatically. You enter the formula exactly as it’s written in your textbook or on the reagent bottle. You get the molar mass with a breakdown that shows where each gram per mole came from.
Check the breakdown against what you expect. If the atom counts don’t match the formula, the formula entry is wrong. Fix it before you run the calculation that depends on it.
Frequently Asked Questions
What is molar mass?
Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). It equals the sum of the atomic masses of all atoms in the molecular formula, weighted by their count.
What is the difference between molar mass and molecular mass?
Molecular mass (or molecular weight) is the mass of a single molecule in atomic mass units (u or Da). Molar mass is the same number but in g/mol — numerically identical but refers to a mole of molecules rather than one.
Why is molar mass important?
Molar mass lets you convert between grams (a measurable lab quantity) and moles (used in stoichiometry). It is essential for solution preparation, titrations, and limiting reagent calculations.
How do I handle ionic compounds like NaCl?
For ionic compounds, enter the empirical formula (NaCl, CaCO₃, etc.) and the calculator gives the formula mass — effectively the molar mass for ionic compounds. There is no true "molecule" for ionic lattices, but the formula mass is used identically.
What is the molar mass of glucose (C₆H₁₂O₆)?
C₆H₁₂O₆: (6 × 12.011) + (12 × 1.008) + (6 × 15.999) = 72.066 + 12.096 + 95.994 = 180.156 g/mol. This is one of the most important values in biochemistry — blood sugar levels are often expressed in mmol/L using this molar mass.
What is the molar mass of sulfuric acid (H₂SO₄)?
H₂SO₄: (2 × 1.008) + 32.065 + (4 × 15.999) = 2.016 + 32.065 + 63.996 = 98.077 g/mol. Concentrated sulfuric acid is 98% pure and has a density of 1.84 g/mL, making it 18.4 M (molar concentration).
How do I calculate percent composition from molar mass?
Percent composition of element X = (mass of X in formula / molar mass of compound) × 100. For H₂O: O contribution = 15.999 / 18.015 = 88.8%. H contribution = 2.016 / 18.015 = 11.2%. This is used in combustion analysis to verify compound identity.
What is the difference between empirical and molecular formula?
Empirical formula is the simplest whole-number ratio of atoms: CH₂O. Molecular formula shows the actual count: glucose is C₆H₁₂O₆ (6× the empirical formula). To find molecular formula from empirical: divide the known molar mass by the empirical formula mass and multiply all subscripts by that factor.
What is atomic mass unit (amu) and how does it relate to g/mol?
1 amu (atomic mass unit, also written u or Da) is 1/12 the mass of a carbon-12 atom = 1.66054 × 10⁻²⁴ g. By definition, the molar mass of an element in g/mol is numerically equal to its atomic mass in amu. Carbon has an atomic mass of 12.011 amu and a molar mass of 12.011 g/mol. This equivalence is due to Avogadro's number.
How do I enter a hydrate formula like CuSO₄·5H₂O?
Type it as CuSO4(H2O)5 in this calculator. The parser treats parentheses as groups and multiplies by the subscript. The result includes the water of crystallisation: CuSO₄ contributes 159.61 g/mol and 5H₂O contributes 90.08 g/mol, giving a total of 249.69 g/mol for copper(II) sulfate pentahydrate.
Related Calculators
Molarity Calculator
Calculate the molarity (molar concentration) of a solution — moles of solute per litre. Enter mass of solute, its molar mass, and volume of solution.
Grams to Moles Calculator
Convert grams of a substance to moles using molar mass. Supports any compound by entering its molar mass manually.
Atoms to Moles Calculator
Convert a number of atoms to moles using Avogadro's number (6.022 × 10²³). Supports scientific notation input.
Mole Calculator
Calculate moles from mass and molar mass, number of atoms/molecules, or gas volume at STP. Three modes via the "Calculate From" selector.
Percent Yield Calculator
Calculate percent yield of a chemical reaction by comparing actual yield to theoretical yield.
Theoretical Yield Calculator
Calculate the theoretical yield of a product from reactant mass, molar masses, and the stoichiometric molar ratio.