Molar Mass Calculator
Enter any chemical formula to get its molar mass in g/mol, with a breakdown by element. Brackets, nested groups and hydrates are supported, and an optional sample mass gives moles.
How to Use
- Type the chemical formula: Start each element symbol with a capital letter and use whole-number subscripts, for example H2O, Ca(OH)2 or CuSO4·5H2O. Brackets and hydrate dots are supported, or tap an example button.
- Add a sample mass (optional): Enter a mass in grams to see how many moles and formula units it contains.
- Read the molar mass: The total in g/mol, the atom count and the value in kg/mol appear instantly.
- Check the breakdown: Each element shows its atom count, atomic weight, mass contribution and mass percent.
What You'll Discover
- Molar mass — the mass of one mole of the substance in g/mol, shown to up to three decimal places with trailing zeros trimmed (18.015, not 18.0150).
- Breakdown by element — how many atoms of each element the formula contains after brackets and hydrates are expanded, the atomic weight used, the mass each element contributes and its mass percent.
- Total atoms and kg/mol — the number of atoms in one formula unit, and the same molar mass in kg/mol for SI work.
- Moles and formula units — if you enter a sample mass in grams, the calculator divides it by the molar mass to give moles, then multiplies by the Avogadro constant for the number of formula units.
The calculator handles neutral formulas with whole-number subscripts. Ion charges and decimal subscripts are not supported, and the tool tells you when it cannot read a formula. Atomic weights follow the IUPAC 2024 table; the exact convention is explained below.
What Molar Mass Is and How It Is Calculated
Molar mass, written M, is the mass of one mole of a substance, given in grams per mole (g/mol). One mole is exactly 6.02214076 × 1023 particles, a value fixed by the definition of the SI unit of amount of substance. To find the molar mass of a compound, add the atomic weight of every atom in its formula:
M = Σ (ni × Ai)
Here ni is the number of atoms of element i in the formula and Ai is that element's atomic weight in g/mol. In practice: count the atoms of each element, expand any brackets by multiplying everything inside by the subscript after the closing bracket, multiply each count by its atomic weight, then add the results. Glucose, C6H12O6, shows the steps.
| Element | Atoms | Atomic weight (g/mol) | Subtotal (g/mol) |
|---|---|---|---|
| C | 6 | 12.011 | 72.066 |
| H | 12 | 1.008 | 12.096 |
| O | 6 | 15.999 | 95.994 |
| Total | 24 | 180.156 |
Several terms describe nearly the same number, which is why textbooks, labs and data sheets can look inconsistent.
| Term | Symbol and unit | What it means |
|---|---|---|
| Molar mass | M, g/mol | Mass of one mole of a substance. This is what the calculator reports. |
| Molecular weight (relative molecular mass) | Mr, no unit | The same sum of atomic weights, expressed relative to the atomic mass unit. Numerically equal to the molar mass in g/mol. |
| Formula mass (formula weight) | u or Da | The sum for one formula unit of an ionic or network compound such as NaCl, which has no discrete molecules. |
| Atomic weight (relative atomic mass) | Ar, no unit | The weighted average mass of an element's atoms across its natural isotopes. |
Molar Masses of Common Compounds
These values were calculated with the same atomic weights as the calculator, so you can use them to check your own working or a homework answer. Type any formula in the box above to confirm it.
| Compound | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H2O | 18.015 |
| Carbon dioxide | CO2 | 44.009 |
| Sodium chloride | NaCl | 58.44 |
| Sodium hydroxide | NaOH | 39.997 |
| Hydrogen chloride | HCl | 36.458 |
| Sulfuric acid | H2SO4 | 98.072 |
| Nitric acid | HNO3 | 63.012 |
| Ammonia | NH3 | 17.031 |
| Methane | CH4 | 16.043 |
| Ethanol | C2H5OH | 46.069 |
| Acetic acid | CH3COOH | 60.052 |
| Calcium carbonate | CaCO3 | 100.086 |
| Sodium bicarbonate | NaHCO3 | 84.006 |
| Glucose | C6H12O6 | 180.156 |
| Sucrose | C12H22O11 | 342.297 |
| Potassium permanganate | KMnO4 | 158.032 |
For a hydrate, the water of crystallisation counts as part of the formula. Copper(II) sulfate pentahydrate, CuSO4·5H2O, has 159.602 g/mol of CuSO4 plus 5 × 18.015 = 90.075 g/mol of water, a total of 249.677 g/mol. Water makes up 36.08% of that mass. To see every element's share of a formula as a percentage, use the percent composition calculator, and see all chemistry tools for the rest of the set.
Which Atomic Weights This Calculator Uses
The element data come from the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) Standard Atomic Weights 2024 and its abridged table. Three rules apply:
- Elements published as intervals. For 14 elements, isotope ratios vary between natural sources, so IUPAC gives a range. The calculator uses the IUPAC abridged (conventional) value for each, shown below.
- Other elements. The standard atomic weight is rounded to three decimal places. Some values therefore carry more digits than the shorter abridged tables, for example silver at 107.868 rather than 107.87.
- Elements with no standard atomic weight. Technetium, promethium and every element from polonium to oganesson except thorium, protactinium and uranium have no standard atomic weight, so the calculator uses the mass number of a long-lived isotope (for example Tc 98 and Pm 145). Molar masses that include them are approximate.
| Element | Value used (g/mol) | IUPAC 2024 interval |
|---|---|---|
| Hydrogen (H) | 1.008 | 1.00784 – 1.00811 |
| Lithium (Li) | 6.94 | 6.938 – 6.997 |
| Boron (B) | 10.81 | 10.806 – 10.821 |
| Carbon (C) | 12.011 | 12.0096 – 12.0116 |
| Nitrogen (N) | 14.007 | 14.00643 – 14.00728 |
| Oxygen (O) | 15.999 | 15.99903 – 15.99977 |
| Magnesium (Mg) | 24.305 | 24.304 – 24.307 |
| Silicon (Si) | 28.085 | 28.084 – 28.086 |
| Sulfur (S) | 32.06 | 32.059 – 32.076 |
| Chlorine (Cl) | 35.45 | 35.446 – 35.457 |
| Argon (Ar) | 39.95 | 39.792 – 39.963 |
| Bromine (Br) | 79.904 | 79.901 – 79.907 |
| Thallium (Tl) | 204.38 | 204.382 – 204.385 |
| Lead (Pb) | 207.2 | 206.14 – 207.94 |
Because of these conventions, a textbook that rounds chlorine to 35.5 or hydrogen to 1.01 will give a slightly different total than this page. Both are right for their own stated precision. Match the atomic weights your course or data sheet specifies when you submit work.
How to Find Molar Mass If...
What is the molar mass if the formula is H2O?
Water, H2O, has a molar mass of 18.015 g/mol. Two hydrogen atoms contribute 2 × 1.008 = 2.016 g/mol and one oxygen atom contributes 15.999 g/mol, giving 18.015 g/mol. By mass, hydrogen is 11.19% and oxygen 88.81%. A 36 g sample of water is about 1.998 mol.
What is the molar mass if the compound is table salt, NaCl?
Sodium chloride, NaCl, has a molar mass of 58.44 g/mol. Sodium is 22.99 g/mol and chlorine is 35.45 g/mol, so 22.99 + 35.45 = 58.44. NaCl forms an ionic lattice rather than separate molecules, so this is the formula mass of one NaCl unit. Sodium is 39.34% of the mass and chlorine 60.66%.
What is the molar mass if the formula has brackets, like Ca(OH)2?
Calcium hydroxide, Ca(OH)2, has a molar mass of 74.092 g/mol. The subscript 2 after the bracket multiplies everything inside, so the formula holds 1 Ca, 2 O and 2 H. Then 40.078 + 2 × 15.999 + 2 × 1.008 = 40.078 + 31.998 + 2.016 = 74.092 g/mol. Aluminium sulfate, Al2(SO4)3, works the same way: 2 Al, 3 S and 12 O give 342.132 g/mol.
What is the molar mass if the formula has nested brackets, like K4[Fe(CN)6]?
Potassium hexacyanoferrate(II), K4[Fe(CN)6], has a molar mass of 368.345 g/mol. Work from the inside out: (CN)6 gives 6 C and 6 N, inside the square bracket with 1 Fe, and the 4 K sits outside. That is 4 × 39.098 + 55.845 + 6 × 12.011 + 6 × 14.007 = 156.392 + 55.845 + 72.066 + 84.042 = 368.345 g/mol. The calculator accepts square and curly brackets as well as round ones.
What is the molar mass if the compound is a hydrate such as CuSO4·5H2O?
Copper(II) sulfate pentahydrate, CuSO4·5H2O, has a molar mass of 249.677 g/mol. Add the anhydrous salt (159.602 g/mol) to five waters (5 × 18.015 = 90.075 g/mol). Type it with a middle dot, a full stop (CuSO4.5H2O) or an asterisk; the calculator counts the water into one total of Cu 1, S 1, O 9 and H 10.
What is the molar mass if the element is diatomic, like O2 or N2?
Oxygen gas, O2, is 31.998 g/mol, nitrogen gas, N2, is 28.014 g/mol and chlorine gas, Cl2, is 70.9 g/mol. Gases such as these exist as two-atom molecules, so you must enter the molecular formula, not the single atom. Typing O gives 15.999 g/mol, the molar mass of oxygen atoms, which is only half of what you need for O2.
What is the molar mass if the compound is glucose, C6H12O6?
Glucose, C6H12O6, has a molar mass of 180.156 g/mol. Six carbons give 72.066, twelve hydrogens give 12.096 and six oxygens give 95.994 g/mol. Carbon is 40.00% of the mass, hydrogen 6.71% and oxygen 53.28%. Sucrose, C12H22O11, is 342.297 g/mol by the same method.
What is the molar mass if I know the mass and the moles but not the formula?
Divide the mass by the moles: M = m ÷ n. If 10 g of a pure substance is 0.25 mol, then M = 10 ÷ 0.25 = 40 g/mol. That is close to sodium hydroxide, NaOH, at 39.997 g/mol, but a number alone does not identify a compound: several substances can share similar molar masses. Use other evidence, such as composition or properties, to decide.
What is the molar mass if I have 50 g of CaCO3 and want moles?
50 g of calcium carbonate, CaCO3, is about 0.4996 mol. The molar mass of CaCO3 is 40.078 + 12.011 + 3 × 15.999 = 100.086 g/mol, and 50 ÷ 100.086 = 0.4996 mol. That is about 3.008 × 1023 formula units. Enter CaCO3 and 50 in the sample mass box above to see the same result.
What is the molar mass if my answer differs from my textbook?
A difference in the second or third decimal place almost always comes from rounding or from an older table of atomic weights, not from a mistake. Water is 18.015 g/mol here. Rounding to 1.01 and 16.00 gives 18.02, and older tables with 1.00794 and 15.9994 give 18.015. Check the atomic weights your course uses, and compare a measured result against an accepted one with the percent error calculator.
People Also Search For
How to calculate molar mass step by step
Write the formula, count the atoms of each element, multiply each count by its atomic weight and add the results. For Fe2(SO4)3: the 3 outside the bracket multiplies S and O, so there are 2 Fe, 3 S and 12 O. Then 2 × 55.845 = 111.69, 3 × 32.06 = 96.18 and 12 × 15.999 = 191.988, and the total is 399.858 g/mol. Keep every digit until the final sum, then round once.
Molar mass vs molecular weight vs formula mass
The three share the same number; they differ in units and in where each term is used. Molar mass is quoted in g/mol, molecular weight is a dimensionless relative mass, and formula mass is for ionic compounds such as NaCl and is quoted in atomic mass units (u). For H2O all three are 18.015 in their own units. In everyday lab work the terms are used interchangeably.
How to convert grams to moles and moles to grams
Moles = grams ÷ molar mass, and grams = moles × molar mass. For 25 g of NaCl: 25 ÷ 58.44 = 0.4278 mol. For 0.5 mol of H2SO4: 0.5 × 98.072 = 49.036 g. Both quantities must be in grams, so convert first if your mass is in kilograms or pounds with the weight converter.
How to find the percent of water in a hydrate
Divide the mass of the water in the formula by the molar mass of the whole hydrate and multiply by 100. For CuSO4·5H2O: 90.075 ÷ 249.677 × 100 = 36.08%. For MgSO4·7H2O the water is 7 × 18.015 = 126.105 g/mol out of 246.466 g/mol, or 51.17%.
How much does one atom or molecule weigh in grams
Divide the molar mass by the Avogadro constant, 6.02214076 × 1023 per mole. One iron atom is 55.845 ÷ 6.02214076 × 1023 = 9.273 × 10−23 g, and one water molecule is 18.015 ÷ 6.02214076 × 1023 = 2.991 × 10−23 g.
How many particles are in one mole
One mole contains exactly 6.02214076 × 1023 elementary entities. This is the Avogadro constant, which has no uncertainty since the 2019 redefinition of the SI, as listed in the NIST CODATA values. One mole of water is 18.015 g and contains that many water molecules. A 1 g sample of water holds about 3.343 × 1022 molecules.
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). For a compound you find it by adding the atomic weights of all the atoms in its formula. For water, H2O, that is 2 × 1.008 + 15.999 = 18.015 g/mol.
What units does the calculator use?
The main result is in grams per mole (g/mol). The panel also shows the same value in kg/mol, which is the SI form, and the mass contributed by each element in g/mol.
How do I enter a hydrate such as CuSO4·5H2O?
Type the salt, a dot, then the number of waters and the water formula: CuSO4·5H2O. You can use a middle dot, a full stop (CuSO4.5H2O) or an asterisk. The dot must be outside any brackets, and the number in front of the water must be a whole number. For a half-hydrate, double the formula, for example 2CaSO4·H2O, instead of writing CaSO4·0.5H2O.
Does it support brackets and nested groups?
Yes. Round, square and curly brackets are all read as brackets, and they can be nested, as in K4[Fe(CN)6] or (CH3)3C(CH2)2(CO2H). The number after a closing bracket multiplies every atom inside it. Unbalanced or empty brackets show a plain-language error instead of a result.
Which atomic weights does it use?
The IUPAC CIAAW 2024 standard atomic weights. Elements that IUPAC gives as intervals (such as H, C, O, S and Cl) use the IUPAC conventional value, and other elements use the standard value rounded to three decimals. Elements with no standard atomic weight use the mass number of a long-lived isotope. The table on this page lists the 14 interval elements.
Why does my answer differ slightly from my textbook?
Textbooks round atomic weights differently, and older tables use older values. Using 1.01 for hydrogen and 16.00 for oxygen gives 18.02 for water, while this calculator gives 18.015. The difference comes from rounding and is normally allowed within the precision of the data. Use the atomic weights your course or data sheet specifies.
Are element symbols case-sensitive?
Yes. Each symbol starts with a capital letter, optionally followed by one lowercase letter. Co is cobalt, but CO is carbon plus oxygen (carbon monoxide). Entering h2o or NACL returns an error that names the problem rather than guessing what you meant.
Can I enter ions with charges, such as SO4 2- or Fe3+?
No. Charges are not supported, and the calculator will ask you to enter the neutral formula. Each electron adds only about 0.0005 g/mol, less than the last digit the calculator shows, so adding or removing electrons barely changes a molar mass. For SO4 2-, enter SO4 to get 96.056 g/mol.
Does it work for ionic compounds like NaCl?
Yes. Ionic compounds are written as a formula unit and the calculation is the same: add the atomic weights. NaCl gives 22.99 + 35.45 = 58.44 g/mol. Strictly this is a formula mass, because NaCl has no separate molecules, but it is used as the molar mass in every mole calculation.
What about elements such as technetium or oganesson?
All 118 elements can be entered. Technetium, promethium and polonium onward (except thorium, protactinium and uranium) have no standard atomic weight, so the calculator uses the mass number of a long-lived isotope, for example 98 for Tc and 294 for Og. Treat the result for a compound containing them as approximate.
Can I calculate moles from grams with this tool?
Yes. Enter the formula, then type a mass in grams in the optional sample mass box. The calculator divides the mass by the molar mass to show moles, then multiplies by 6.02214076 × 1023 to show the number of formula units. For example, 36 g of H2O is about 1.998 mol.
Can it handle isotopes or a specific isotope mass?
No. This calculator uses average atomic weights for natural isotope mixtures. To work out an element's average atomic mass from isotope masses and abundances, use the atomic mass calculator.
What about polymers or fractional subscripts?
Subscripts must be whole numbers. For a polymer, enter the repeat unit and multiply the result by the number of repeat units yourself, because the average chain length is not part of the formula. Decimal subscripts are not supported, and a full stop is always read as a hydrate dot.
Is my data stored or sent anywhere?
No. All calculations run in your browser. Nothing you type is sent to a server or saved, and no account is needed.
Last reviewed: November 2026 — formulas and worked examples verified.