HomeChemistry ToolsMolar Mass Calculator with Steps | StatsUnlock

Molar Mass Calculator with Steps | StatsUnlock

Molar Mass Calculator

Type any chemical formula or name to get its molar mass in g/mol, worked out element by element with the mass percent of each element. Brackets, hydrates and ions are read correctly, and the same tool finds molar mass from mass and moles, gas density, a titration, percent composition, a mixture or a protein sequence.

ChemistryMolar MassStep by StepClass 9 to 12, GCSE, APPercent CompositionFree

⚡ 0. Quick Answer

To calculate molar mass, multiply the atomic weight of each element by the number of its atoms in the formula and add the results; the answer is in grams per mole. For water, H2O:

M(H2O) = 2 × 1.008 + 1 × 15.999 = 18.015 g/mol

Rule of thumb: count every atom, including those inside brackets and the water in a hydrate. Ca(OH)2 has two O and two H, so M = 40.078 + 2 × 15.999 + 2 × 1.008 = 74.092 g/mol, not 57.085.

🔑 Key Takeaways

  • Molar mass is the mass of one mole of a substance, in g/mol: M = Σ (number of atoms × atomic weight).
  • Water is 18.015 g/mol, sodium chloride 58.440 g/mol, calcium carbonate 100.086 g/mol and calcium chloride 110.978 g/mol.
  • Multiply through brackets and add the water of a hydrate: CuSO4·5H2O is 249.677 g/mol, not 159.602.
  • Molar mass links grams and moles: n = m ÷ M and m = n × M, so 0.35 mol of CH4 weighs 5.6 g.
  • Without a formula, molar mass comes from data: M = m ÷ n, M = ρRT ÷ P for a gas, or mass ÷ moles from a titration.

📚 1. What Is Molar Mass, and What Does a Molar Mass Calculator Do?

Molar mass (symbol M) is the mass of one mole of a substance, measured in grams per mole (g/mol). One mole is exactly 6.022 140 76 × 1023 particles, so molar mass is also the mass of that many molecules, atoms or formula units. Because a mole of carbon-12 atoms weighs 12 g, the molar mass of any substance in g/mol is the same number as its relative formula mass (Mr) with no unit.

A molar mass calculator reads a chemical formula, counts the atoms of each element, multiplies each count by the element’s standard atomic weight and adds the products. This one also accepts names such as water or acetone, suggests the right capital letters when a formula is typed in lower case, shows the mass percent of each element, and converts between grams and moles in the same step.

A worked one-liner: what is the molar mass of sodium chloride? M(NaCl) = 22.990 + 35.45 = 58.440 g/mol, which is 58.44 g/mol to two decimal places.

How the molar mass of water is built: 2 hydrogen atoms give 2.016 g/mol and 1 oxygen atom gives 15.999 g/mol, adding to 18.015 g/mol M(H₂O) = 2 × 1.008 + 1 × 15.999 = 18.015 g/mol H O H: 2 atoms × 1.008 = 2.016 g/mol (11.19% of the mass, 67% of the atoms) O: 1 atom × 15.999 = 15.999 g/mol (88.81% of the mass, 33% of the atoms) Bar length is proportional to each element’s share of the molar mass.
The molar mass of water, split by element. Hydrogen is two of the three atoms but only about 11% of the mass.

Who uses it: CBSE and ICSE students meet molar mass in NCERT Class 9 (“Atoms and Molecules”) and Class 11 (“Some Basic Concepts of Chemistry”); JEE and NEET use it in nearly every numerical; GCSE, IGCSE, A level, AP Chemistry and IB courses call it relative formula mass or molar mass. In the lab it is how you weigh out a reagent, make a solution of known molarity, or identify an unknown from its mass and moles; in biochemistry it is how a protein’s mass in kDa is estimated from its sequence.

TermSymbolUnitWaterMeans
Molar massMg/mol18.015 g/molMass of one mole
Relative formula / molecular massMrnone18.015Same number, no unit
Molecular massmu (Da)18.015 uMass of one molecule
Mass of one moleculeM ÷ NAg2.991 × 10−23 gThe same, in grams
Atomic weightArnoneH 1.008, O 15.999Average atom mass relative to 12C ÷ 12

What this free online molar mass calculator solves

One tool covers every molar mass calculation in a typical course, and it doubles as a mass to moles calculator, a moles to mass calculator and an average molar mass calculator. Press Try it to load an example into the calculator, then press Calculate to see the full working.

ProblemWhat it works outExample
Molar mass of a compoundM from any formula, with each element’s shareH2O = 18.015 g/mol
Brackets and hydratesMultiplies through ( ) and [ ], adds water after the dotCuSO4·5H2O = 249.677 g/mol
Molar mass by nameOver 180 common names: water, acetone, citric acidAcetone = 58.080 g/mol
Mass from moles, moles from massm = n × M or n = m ÷ M in the same step0.35 mol CH4 = 5.6 g
Molar mass of a gasFrom density, or mass and volume, at any T and P1.25 g/L at 0 °C, 1 atm = 28.0 g/mol
Molar mass from a titrationUnknown mono-, di- or triprotic acid0.250 g diprotic acid = 1.80 × 102 g/mol
Molecular formula from percent compositionEmpirical formula, then the molecular formula from MC 40.0%, H 6.71%, O 53.3% → C6H12O6
Average molar massMixtures by mole or mass fraction, or isotopesDry air = 28.97 g/mol
Mass required for a molar solutionGrams to weigh, or molarity from % and density250 mL of 0.100 M NaCl = 1.46 g
Molar mass of a proteinFrom the one-letter amino acid sequenceUbiquitin = 8.56 kDa

Free, with no sign-up. Everything runs in your browser: nothing you type is sent to a server or stored.

How accurate is this molar mass calculator?

Atomic weights are the CIAAW 2024 standard atomic weights for all 118 elements (Prohaska et al., 2022), or rounded exam values if you choose them. Each subtotal is kept to full precision and only the final molar mass is rounded. The answer is checked two ways before it gets the Verified badge: the element subtotals must add back to M, and the mass percents must add to exactly 100%. An approximate uncertainty is shown, combined from the CIAAW uncertainty of each atomic weight; for water it is about ± 0.001 g/mol. The R and Python scripts in Sections 10 and 11 return the same 18.015 g/mol for water.

Studies of how students learn the mole find that most errors come from reading the formula, not the arithmetic: missed brackets, forgotten hydrate water and confusing subscripts with coefficients (Furió et al., 2002; Pekdağ & Azizoğlu, 2013). That is why every result shows the atom count first, then each multiplication, then the sum.

🧮 2. Enter Your Formula in the Molar Mass Calculator

1. What do you want to find?

Common compounds and symbol keys (tap to insert)

Capitals matter: Co is cobalt, CO is carbon monoxide. Brackets: Ca(NO3)2; hydrates: CuSO4.5H2O; ions: SO4^2-. Condensed formulas such as CH3COCH3 work too.

3. Also convert (optional)

Leave both empty for the molar mass only. If both are filled, the mass is used.

Press Enter in any box to calculate. Nothing is calculated until you press the button.

Units: g, mg, kg, µg, mol, mmol or µmol. Names such as acetone work too.

📊 3. Your Results: Molar Mass with Steps and Element Breakdown

Molar mass: ___ g/mol. Enter or load a problem above, then press Calculate Molar Mass. The element-by-element table, the steps, a breakdown bar and four charts will appear here.

🧠 4. What Does Your Molar Mass Mean?

Calculate a molar mass above to fill this box with your own numbers: ___ . The sub-sections below explain every part of the output.

4.1 Molar mass is a conversion factor between grams and moles

18.015 g/mol for water means 18.015 g of water is exactly one mole, 6.022 × 1023 molecules. Read as a fraction, it converts both ways: grams ÷ M gives moles, and moles × M gives grams. That is all you need to calculate mass from moles or moles from mass: 25.0 g of water is 25.0 ÷ 18.015 = 1.39 mol, and 0.800 mol of H2CO3 is 0.800 × 62.024 = 49.6 g.

4.2 Molar mass, molecular mass and molecular weight

They are the same number in different units. The molar mass of water is 18.015 g/mol; its relative molecular mass (Mr, often called molecular weight) is 18.015 with no unit; one water molecule weighs 18.015 u (daltons), or 2.991 × 10−23 g. For ionic compounds such as NaCl, which have no molecules, say formula mass rather than molecular mass.

4.3 Reading the mass percent column

Each element’s subtotal divided by M is its percent by mass. Hydrogen is two of the three atoms in water but only 11.19% of the mass, because an oxygen atom is almost 16 times heavier. The “% of atoms” column shows the contrast. Mass percent is what combustion analysis measures, which is why the percent composition mode in this calculator can run the calculation backwards to find a formula.

4.4 How many decimal places should a molar mass have?

Use what your course expects. Most textbooks and exam boards give atomic weights to one or two decimals (H 1.01, O 16.00, Cl 35.45), giving 18.02 g/mol for water; CBSE, GCSE and IGCSE papers often use whole numbers (H 1, O 16), giving 18 g/mol. This calculator shows three decimals from the CIAAW 2024 values and the same result rounded to two and one decimal. In a calculation, the molar mass is rarely what limits the significant figures: your measured mass or volume is.

SubstanceCIAAW 2024 (3 d.p.)2 d.p.Exam values
H2O18.01518.0218
NaCl58.44058.4458.5
CaCO3100.086100.09100
CaCl2110.978110.98111
Ca(OH)274.09274.0974

4.5 The uncertainty shown with the answer

CIAAW gives each standard atomic weight with an uncertainty that reflects natural variation in isotope abundances: hydrogen is 1.0080 ± 0.0002, oxygen 15.999 ± 0.001, chlorine 35.45 ± 0.01. The calculator combines these into an approximate uncertainty for M; for water it is about ± 0.001 g/mol, for NaCl about ± 0.01 g/mol because of chlorine. For almost all school and lab work it is far smaller than the uncertainty of the balance.

4.6 Molar mass of a gas, and density

For an ideal gas, density and molar mass are tied together by ρ = PM ÷ RT. A heavier gas is denser at the same temperature and pressure: at 0 °C and 1 bar, hydrogen (2.016 g/mol) is 0.0888 g/L and carbon dioxide (44.009 g/mol) is 1.938 g/L. The results table shows this density for any formula; the gas mode runs it backwards to find M from a measured density.

4.7 Average molar mass of a mixture

A mixture has an average molar mass weighted by mole fraction: M̄ = Σ xiMi. Dry air (78.08% N2, 20.95% O2, 0.93% Ar, 0.04% CO2 by moles) comes out at 28.97 g/mol. The same sum over isotope masses and abundances gives an element’s atomic weight: chlorine-35 (75.76%) and chlorine-37 (24.24%) average 35.453.

4.8 A field note on where molar mass goes wrong

In checking hundreds of student answers, nearly every wrong molar mass traces back to reading the formula, not to the addition. The usual culprits are Ca(OH)2 counted as one O and one H, hydrate water left out, O instead of O2 for oxygen gas, and Co typed for CO. Research on the mole concept reports the same: students can apply n = m ÷ M yet struggle to connect the formula to the atoms it stands for (Gabel & Sherwood, 1984; Staver & Lumpe, 1995). The calculator therefore shows the atom count before any arithmetic.

4.9 Where molar mass leads next

Molar mass is the first step of almost every quantitative chemistry problem: grams to moles, moles to particles, solution concentrations, gas volumes, stoichiometry with mole ratios, limiting reagent and percent yield, and empirical and molecular formulas.

✍ 5. How to Write a Molar Mass Answer

▶ Calculate a molar mass above to fill all five cards with your own answer.

1. Exam answer with working
M = Σ (atoms × atomic weight) = ___ g/mol
📌 Conventions examiners look for
  • Write each element as count × atomic weight, then add.
  • Give the unit g/mol (or g mol−1); Mr has no unit.
  • Use the atomic weights printed on your paper.
2. Final answer only
___ g/mol
📌 Conventions
  • Two decimal places is the usual standard: 18.02 g/mol.
  • Do not round a molar mass you will use in a later step.
3. Lab report sentence
The molar mass of ___ was ___ g/mol.
📌 Conventions
  • Name the atomic-weight source (CIAAW 2024, or your data book).
  • For an experimental molar mass, give the method and compare it with the expected value as a percent error.
4. Teacher’s answer-key line
Answer: ___
📌 Conventions
  • Accept small last-digit differences from rounded atomic weights.
  • Use the Batch tab to make a whole answer key.
5. Plain text for chat, forums or a spreadsheet
___
📌 Conventions
  • Write subscripts as plain digits: H2O, Ca(OH)2.
  • Write a hydrate with a dot: CuSO4.5H2O.

∑ 6. Molar Mass Formulas: How Molar Mass Is Calculated

The formula for calculating molar mass is M = Σ (atoms × atomic weight). This section lists it with every other molar mass calculation formula the calculator uses, each with a worked number.

①
Molar Mass from a Formula
M = Σ ni × Ar,i
niNumber of atoms of element i in one formula unit
Ar,iStandard atomic weight of element i (CIAAW 2024)
ExampleM(CaCO3) = 40.078 + 12.011 + 3 × 15.999 = 100.086 g/mol
②
Mass and Moles
M = m ÷ n  ·  n = m ÷ M  ·  m = n × M
Example4.40 g ÷ 0.100 mol = 44.0 g/mol (CO2); 0.35 mol × 16.043 g/mol = 5.6 g of CH4
Arrange itTo arrange the equation to calculate the molar mass M from n = m ÷ M, multiply both sides by M and divide by n: M = m ÷ n
③
Molar Mass of a Gas
M = ρRT ÷ P  ·  M = mRT ÷ PV
R8.314 462 618 L·kPa mol−1 K−1, with T in K and P in kPa
Example1.25 g/L × 8.314 × 273.15 ÷ 101.325 = 28.0 g/mol (N2 or CO)
④
Molar Mass from a Titration
M = macid ÷ (cbase × Vbase ÷ k)
kAcidic hydrogens per molecule: 1, 2 or 3
Example0.250 g ÷ (0.100 × 0.0278 ÷ 2) = 1.80 × 102 g/mol for a diprotic acid
⑤
Molecular Formula from Molar Mass
multiplier = M ÷ Mempirical
ExampleCH2O has 30.026 g/mol; 180.16 ÷ 30.026 = 6.00, so the molecular formula is C6H12O6
⑥
Average Molar Mass
M̄ = Σ xiMi  ·  M̄ = 1 ÷ Σ (wi ÷ Mi)
x, wMole fractions, or mass fractions
ExampleDry air: 0.7808 × 28.014 + 0.2095 × 31.998 + 0.0093 × 39.95 + 0.0004 × 44.009 = 28.97 g/mol
⑦
Solutions
m = c × V × M  ·  c = 10 ρ w ÷ M
Example0.100 mol/L × 0.250 L × 58.440 g/mol = 1.46 g NaCl; 37.0% HCl at 1.19 g/mL is 10 × 1.19 × 37.0 ÷ 36.458 = 12.1 mol/L
SourceAtomic weights: CIAAW 2024. Constants: NIST CODATA

🔀 7. How to Calculate Molar Mass: Flowchart, Step by Step

This flowchart shows how to calculate the molar mass of a compound, on the same example used in the Excel, R, Python and by-hand sections: what is the molar mass of water, H2O?

Start or result Data step Calculation step Yes or no check
StartWater, H2OFind M in g/mol
CheckIs the formula written correctly?
YesH2O: capital H, capital O.
NoFix the capitals first: h2o is not a formula; Co is cobalt, CO is carbon monoxide.
1
Count the atoms of each elementH: 2, O: 1Multiply through brackets and add hydrate water.
2
Look up the atomic weightsH = 1.008, O = 15.999CIAAW 2024 values (exam values: H = 1, O = 16).
3
Multiply each count by its atomic weight2 × 1.008 = 2.016; 1 × 15.999 = 15.999Subtotals in g/mol
4
Add the subtotalsM = 2.016 + 15.999M = 18.015 g/mol
CheckDo the mass percents add to 100%?
Yes11.19% H + 88.81% O = 100%. Verified.
No, stopA subtotal is wrong or an element was missed. Recheck step 1.
5
If asked, convert a massn = m ÷ M = 25.0 g ÷ 18.015 g/mol1.39 mol of water
ResultM(H2O) = 18.015 g/mol18.02 g/mol (2 d.p.) Mᵣ = 18.015One mole of water weighs 18.015 g.

Check any box yourself: the Excel sheet in Section 9, the R script in Section 10 and the Python script in Section 11 all return 18.015 g/mol for water.

📝 8. How to Use This Molar Mass Calculator

  1. Choose what you want to find. Pick molar mass from a formula, or one of the data modes: mass and moles, gas, titration, percent composition, mixture, solution or protein sequence.
  2. Type the formula or the name. Write it as H2O, Ca(OH)2 or CuSO4.5H2O, type a name such as acetone, or tap a common compound.
  3. Check the capital letters. Each element symbol starts with a capital: Co is cobalt and CO is carbon monoxide. If you type in lower case, the calculator suggests the right formula.
  4. Use brackets and dots exactly as written. Ca(NO3)2 has two nitrate groups; a dot adds water of crystallisation; ^2- marks an ion charge.
  5. Add a mass or moles if you want a conversion. Type grams to get moles, or moles to get grams, with the unit you need.
  6. For the data modes, enter your measurements. Type them exactly as measured, including trailing zeros, because they set the significant figures.
  7. Choose the atomic weights. Keep CIAAW 2024 values or switch to rounded exam values such as C 12 and O 16.
  8. Press Calculate Molar Mass. Nothing is calculated before you press it, and changing any input clears the old answer.
  9. Read the element table and the steps. The Verified badge means the subtotals add back to M and the mass percents add to 100%.
  10. Copy, share or batch. Copy the answer or the working, share a link, download a report, or calculate a whole list on the Batch tab.

📈 9. How to Calculate Molar Mass in Excel

Excel cannot read a chemical formula, so you lay the formula out as a small table: one row per element with its atom count and atomic weight. SUMPRODUCT then gives the molar mass, and one more column gives the mass percent. The sheet below uses the headline example, water, so it must return 18.015 g/mol, the same as the molar mass calculator above.

The whole thing in one cell: with atom counts in B2:B3 and atomic weights in C2:C3, type =SUMPRODUCT(B2:B3,C2:C3). That is the molar mass.

9.1 The functions you need

You wantExcel formulaNote
Subtotal for one element=B2*C2Atoms × atomic weight
Molar mass=SUMPRODUCT(B2:B3,C2:C3)Or =SUM(D2:D3)
Mass percent=D2/$D$4*100Lock the total with $
Moles from mass=F2/$D$4n = m ÷ M
Mass from moles=G2*$D$4m = n × M
Round to 2 decimals=ROUND(D4,2)Display only; keep the full value for later steps
Look up an atomic weight=XLOOKUP(A2,Elements[Symbol],Elements[Weight])With a table of elements on another sheet
The bracket trap. Excel will not multiply through brackets for you. For Ca(OH)2, type 2 in the O row and 2 in the H row, not 1.

9.2 Step by step

1 Lay out the formula as a table

One row per element: symbol in A, atom count in B, atomic weight in C. In D2 type =B2*C2 and fill down.

Xmolar-mass.xlsx - ExcelD2fx=B2*C2ABCD1ElementAtomsAtomic wtSubtotal2H21.0082.0163O115.99915.999

Water has 2 H and 1 O; subtotals 2.016 and 15.999 g/mol.

2 Add up the molar mass with SUMPRODUCT

In D4 type the formula. It multiplies each count by its weight and adds them.

=SUMPRODUCT(B2:B3,C2:C3)
Xmolar-mass.xlsx - ExcelD4fx=SUMPRODUCT(B2:B3,C2:C3)ABCD1ElementAtomsAtomic wtSubtotal2H21.0082.0163O115.99915.9994M (g/mol)18.015

The molar mass of water is 18.015 g/mol.

3 Add the mass percent of each element

In E2 divide each subtotal by the total and multiply by 100. The $ signs keep the total fixed as you fill down.

=D2/$D$4*100
Xmolar-mass.xlsx - ExcelE2fx=D2/$D$4*100ABCDE1ElementAtomsAtomic wtSubtotal% mass2H21.0082.01611.193O115.99915.99988.814Total18.015100.00

Water is 11.19% hydrogen and 88.81% oxygen by mass, adding to 100.00%.

4 A molar mass table for a whole list

For a worksheet, keep one compound per row with its molar mass in column B (worked out as above), then convert masses to moles in column D with =C2/B2.

Xmolar-mass.xlsx - ExcelD2fx=C2/B2ABCD1FormulaM (g/mol)Mass (g)Moles2H2O18.01510.00.5553NaCl58.44010.00.1714CaCO3100.08610.00.09995Ca(OH)274.09210.00.1356CaCl2110.97810.00.0901

Five compounds, each 10.0 g, converted in one column.

9.3 Awkward cases

  • Brackets. Count before typing: Ca(NO3)2 is 1 Ca, 2 N, 6 O.
  • Hydrates. Add the water as extra atoms: CuSO4·5H2O has 9 O and 10 H.
  • Condensed organic formulas. Add every C, H and O: CH3COCH3 is C3H6O.
  • Average molar mass. Use =SUMPRODUCT(fractions,molar_masses)/SUM(fractions).

9.4 Why your Excel answer might differ from R, Python or this page

SituationWhat happensFix
Last digit differsDifferent atomic weights (O 16 vs 15.999)Use the same table of weights
Answer too smallA bracket or hydrate was not multiplied outRecount the atoms
Percentages add to 99.99The percents were rounded before addingAdd the unrounded cells
18.02 instead of 18.015Cell format shows two decimalsFormat Cells → Number → 3 decimals
ToolMolar mass
Excel / Google Sheets=SUMPRODUCT(B2:B3,C2:C3)
Rsum(counts * W[names(counts)])
Pythonsum(n * W[e] for e, n in counts.items())
Casio fx-991EX2 × 1.008 + 15.999 =

9.5 Charting in Excel

  1. Select the element symbols and their subtotals (A2:A3, D2:D3).
  2. Insert → Charts → Pie or Doughnut to show each element’s share of the molar mass, as in Chart 1 above.
  3. For a mass-versus-moles line, make a column of moles (0 to 2), a column =moles*$D$4, then Insert → Scatter with Straight Lines.

9.6 Excel errors you will probably hit

Excel showsWhyFix
#VALUE!A symbol or unit typed in a number cellNumbers only in columns B and C
#DIV/0!The total cell is empty when you work out percentsCheck D4 first
#N/A from XLOOKUPThe symbol is spelled differently (CL instead of Cl)Use the correct capitals
Wrong percents after fill downThe total was not lockedUse $D$4

📈 10. How to Calculate Molar Mass in R

This base R script reads a chemical formula, multiplies through brackets and hydrate dots, prints a table of atoms, atomic weights, subtotals and mass percents, checks that the percents add to 100, converts a mass to moles and saves one 300 dpi chart. For water it prints 18.015 g/mol, matching the molar mass calculator on this page.

base R nothing to install
Copy the whole block. It runs top to bottom in RStudio or with Rscript molar_mass.R. Change only the formula and mass_g lines.

10.1 The complete script

R, base only, saves molar_mass.png

# ============================================================
# Molar mass calculator in R: M = sum(atoms x atomic weight)
# StatsUnlock - https://statsunlock.com/molar-mass-calculator/
# Base R only. No packages to install.
# ============================================================

# ---- 1. Your formula ---------------------------------------------
formula <- "H2O"     # brackets and hydrates work: Ca(OH)2, Ca(NO3)2, CuSO4.5H2O
mass_g  <- 25.0      # optional: a mass to convert to moles (or NA)

# CIAAW 2024 standard atomic weights (g/mol); add any element you need
W <- c(H = 1.008, Li = 6.94, C = 12.011, N = 14.007, O = 15.999, F = 18.998,
       Na = 22.990, Mg = 24.305, Al = 26.982, Si = 28.085, P = 30.974,
       S = 32.06, Cl = 35.45, K = 39.098, Ca = 40.078, Mn = 54.938,
       Fe = 55.845, Cu = 63.546, Zn = 65.38, Br = 79.904, Ag = 107.87,
       I = 126.90, Ba = 137.33, Au = 196.97, Pb = 207.2)

# Count atoms, multiplying through brackets and the hydrate dot
parse_formula <- function(f) {
  total <- c()
  parts <- strsplit(f, "[.*]")[[1]]
  for (i in seq_along(parts)) {
    part <- parts[i]; mult <- 1
    if (i > 1 && grepl("^[0-9]+", part)) {
      mult <- as.numeric(sub("^([0-9]+).*", "\\1", part))
      part <- sub("^[0-9]+", "", part)
    }
    tok <- regmatches(part, gregexpr("[A-Z][a-z]?|[0-9]+|[][()]", part))[[1]]
    stack <- list(numeric(0)); j <- 1
    while (j <= length(tok)) {
      t <- tok[j]; j <- j + 1
      if (t %in% c("(", "[")) { stack[[length(stack) + 1]] <- numeric(0); next }
      n <- 1
      if (j <= length(tok) && grepl("^[0-9]+$", tok[j])) { n <- as.numeric(tok[j]); j <- j + 1 }
      top <- length(stack)
      if (t %in% c(")", "]")) {
        inner <- stack[[top]] * n; stack[[top]] <- NULL; top <- top - 1
        for (k in names(inner)) stack[[top]][k] <- sum(stack[[top]][k], inner[k], na.rm = TRUE)
      } else {
        stack[[top]][t] <- sum(stack[[top]][t], n, na.rm = TRUE)
      }
    }
    for (k in names(stack[[1]])) total[k] <- sum(total[k], stack[[1]][k] * mult, na.rm = TRUE)
  }
  total
}

# ---- 2. Molar mass, element by element ----------------------------
counts <- parse_formula(formula)
if (any(!names(counts) %in% names(W))) stop("Add the atomic weight of ", paste(setdiff(names(counts), names(W)), collapse = ", "))
sub_mass <- counts * W[names(counts)]
M <- sum(sub_mass)
print(data.frame(element = names(counts), atoms = as.vector(counts), Ar = as.vector(W[names(counts)]),
                 subtotal = round(as.vector(sub_mass), 3),
                 pct_mass = round(100 * as.vector(sub_mass) / M, 2)))
cat(sprintf("Molar mass M(%s) = %.3f g/mol  (%.2f to 2 d.p.)\n", formula, M, M))

# ---- 3. Check: the mass percents add to 100 ------------------------
stopifnot(abs(sum(100 * sub_mass / M) - 100) < 1e-9)
cat("Verdict: Verified, mass percents add to 100%\n")

# ---- 4. Optional: grams to moles -----------------------------------
if (!is.na(mass_g)) cat(sprintf("n = m / M = %.1f g / %.3f g/mol = %s mol\n", mass_g, M, signif(mass_g / M, 3)))

# ---- 5. One 300 dpi figure: each element's share of M --------------
png("molar_mass.png", width = 2100, height = 1350, res = 300)
par(mar = c(4.5, 5, 3, 1))
barplot(sub_mass, names.arg = names(counts), las = 1, border = NA,
        col = c("#94a3b8", "#ea580c", "#2563eb", "#16a34a", "#9333ea")[seq_along(counts)],
        xlab = "Element", ylab = "Contribution to M (g/mol)",
        main = sprintf("M(%s) = %.3f g/mol", formula, M))
invisible(dev.off())
cat("Saved molar_mass.png\n")

Output: Molar mass M(H2O) = 18.015 g/mol (18.02 to 2 d.p.), Verdict: Verified, mass percents add to 100%, n = m / M = 25.0 g / 18.015 g/mol = 1.39 mol. With formula <- "Ca(NO3)2" it prints 164.086 g/mol.

10.2 R traps

  • round(M, 2) rounds to decimal places; signif() rounds to significant figures.
  • Named vectors must match: W[names(counts)] picks the right weight for each element.
  • Element symbols are case sensitive in the lookup, just as in chemistry: "Co" and "CO" differ.

10.3 What each part does

PartWhat it does
parse_formula()Counts atoms through brackets and the hydrate dot
counts * W[names(counts)]Each element’s subtotal
M <- sum(sub_mass)The molar mass
stopifnot(...)The check: mass percents add to 100

10.4 Using a package

The PeriodicTable package gives mass("O") for any element, and the CHNOSZ package has mass("H2O") for whole formulas. Check that their atomic weights match the edition your course uses.

10.5 The figure

The script saves molar_mass.png at 2100 × 1350 pixels and 300 dpi: one bar per element, its height the element’s contribution to M (2.016 and 15.999 g/mol for water).

🐍 11. How to Calculate Molar Mass in Python

This script does the same job in plain Python: it parses the formula, prints the element table with mass percents, checks the total, converts grams to moles and saves a 300 dpi chart. It uses the same method the molar mass calculator runs in your browser.

matplotlib for the chart only

Install once: pip install matplotlib

11.1 The complete script

Python, saves molar_mass.png

# ============================================================
# Molar mass calculator in Python: M = sum(atoms x atomic weight)
# StatsUnlock - https://statsunlock.com/molar-mass-calculator/
# pip install matplotlib
# ============================================================
import re
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt

# ---- 1. Your formula ---------------------------------------------
formula = "H2O"        # brackets and hydrates work: Ca(OH)2, Ca(NO3)2, CuSO4.5H2O
mass_g = 25.0          # optional: a mass to convert to moles (or None)

# CIAAW 2024 standard atomic weights (g/mol); add any element you need
W = {"H": 1.008, "Li": 6.94, "C": 12.011, "N": 14.007, "O": 15.999, "F": 18.998,
     "Na": 22.990, "Mg": 24.305, "Al": 26.982, "Si": 28.085, "P": 30.974,
     "S": 32.06, "Cl": 35.45, "K": 39.098, "Ca": 40.078, "Mn": 54.938,
     "Fe": 55.845, "Cu": 63.546, "Zn": 65.38, "Br": 79.904, "Ag": 107.87,
     "I": 126.90, "Ba": 137.33, "Au": 196.97, "Pb": 207.2}

def parse_formula(f):
    """Count atoms in a formula such as Ca(OH)2, Al2(SO4)3 or CuSO4.5H2O."""
    total = {}
    for i, part in enumerate(re.split(r"[.*·]", f)):
        mult = 1
        m = re.match(r"^(\d+)(.*)$", part)
        if m and i > 0:                        # the 5 in CuSO4.5H2O
            mult, part = int(m.group(1)), m.group(2)
        tokens = re.findall(r"[A-Z][a-z]?|\d+|[()\[\]]", part)
        stack, j = [{}], 0
        while j < len(tokens):
            t = tokens[j]; j += 1
            if t in "([":
                stack.append({}); continue
            n = 1
            if j < len(tokens) and tokens[j].isdigit():
                n = int(tokens[j]); j += 1
            if t in ")]":                      # close a bracket, multiply what is inside
                for k, v in stack.pop().items():
                    stack[-1][k] = stack[-1].get(k, 0) + v * n
            else:                              # an element symbol
                stack[-1][t] = stack[-1].get(t, 0) + n
        for k, v in stack[0].items():
            total[k] = total.get(k, 0) + v * mult
    return total

# ---- 2. Molar mass, element by element ----------------------------
counts = parse_formula(formula)
missing = [e for e in counts if e not in W]
if missing:
    raise SystemExit(f"Add the atomic weight of {missing} to W")
sub = {e: n * W[e] for e, n in counts.items()}
M = sum(sub.values())
print(f"{'Element':8}{'Atoms':>6}{'Ar':>9}{'Subtotal':>11}{'% mass':>9}")
for e, n in counts.items():
    print(f"{e:8}{n:>6}{W[e]:>9}{sub[e]:>11.3f}{100 * sub[e] / M:>8.2f}%")
print(f"Molar mass M({formula}) = {M:.3f} g/mol  ({M:.2f} to 2 d.p.)")

# ---- 3. Check: subtotals and percents ------------------------------
pct_total = sum(100 * s / M for s in sub.values())
assert abs(pct_total - 100) < 1e-9, "mass percents do not add to 100"
print(f"Verdict: Verified, mass percents add to {pct_total:.6f}%")

# ---- 4. Optional: grams to moles -----------------------------------
if mass_g:
    print(f"n = m / M = {mass_g} g / {M:.3f} g/mol = {mass_g / M:.3g} mol")

# ---- 5. One 300 dpi figure: each element's share of M --------------
fig, ax = plt.subplots(figsize=(7, 4.5))
ax.bar(list(sub), list(sub.values()), color=["#94a3b8", "#ea580c", "#2563eb", "#16a34a", "#9333ea"][:len(sub)])
ax.set_xlabel("Element")
ax.set_ylabel("Contribution to M (g/mol)")
ax.set_title(f"M({formula}) = {M:.3f} g/mol")
fig.tight_layout()
fig.savefig("molar_mass.png", dpi=300)
print("Saved molar_mass.png")

Output: Molar mass M(H2O) = 18.015 g/mol (18.02 to 2 d.p.), Verdict: Verified, mass percents add to 100.000000%, n = m / M = 25.0 g / 18.015 g/mol = 1.39 mol. With formula = "CuSO4.5H2O" it prints 249.677 g/mol.

11.2 Python traps

  • f"{M:.2f}" rounds to 2 decimal places; f"{x:.3g}" rounds to 3 significant figures.
  • round() rounds half to even, so round(55.845, 2) can give 55.84. Use the decimal module for exam-style rounding.
  • Dictionary keys are case sensitive: W["Co"] is cobalt.

11.3 Using a package

With pip install periodictable, periodictable.formula("Ca(OH)2").mass returns the molar mass directly, and .mass_fraction gives each element’s share. Package atomic weights may differ from CIAAW 2024 in the last digit for a few elements.

11.4 What each part does

PartWhat it does
parse_formula()Counts atoms through brackets and hydrates
sub = {e: n * W[e] ...}Each element’s subtotal
M = sum(sub.values())The molar mass
assert abs(pct_total - 100) ...The check

11.5 The figure

The script saves molar_mass.png at 300 dpi with each element’s contribution to the molar mass.

📋 12. Molar Mass Tables and Worksheet with Answers

12.1 Atomic weights of common elements

ElementSymbolStandard atomic weight (CIAAW 2024)Rounded exam value
HydrogenH1.00801
BoronB10.8111
CarbonC12.01112
NitrogenN14.00714
OxygenO15.99916
FluorineF18.99819
SodiumNa22.99023
MagnesiumMg24.30524
AluminumAl26.98227
SiliconSi28.08528
PhosphorusP30.97431
SulfurS32.0632
ChlorineCl35.4535.5
PotassiumK39.09839
CalciumCa40.07840
ManganeseMn54.93855
IronFe55.84556
CopperCu63.54663.5
ZincZn65.3865
BromineBr79.90480
SilverAg107.87108
IodineI126.90127
BariumBa137.33137
GoldAu196.97197
LeadPb207.2207

Source: CIAAW, abridged standard atomic weights. The molar mass of an element in g/mol is the same number; for diatomic gases double it: O2 is 31.998 g/mol, not 15.999.

12.2 Molar mass of common compounds

Each row was computed by the same engine as the molar mass calculator, from CIAAW 2024 atomic weights.

SubstanceFormulaMolar mass (g/mol)Rounded (2 d.p.)Mass of 1 molMoles in 10.0 g
WaterH2O18.01518.0218.015 g0.555 mol
Hydrogen peroxideH2O234.01434.0134.014 g0.294 mol
Oxygen gasO231.99832.0031.998 g0.313 mol
Carbon dioxideCO244.00944.0144.009 g0.227 mol
Carbon monoxideCO28.01028.0128.010 g0.357 mol
AmmoniaNH317.03117.0317.031 g0.587 mol
MethaneCH416.04316.0416.043 g0.623 mol
EthanolC2H5OH46.06946.0746.069 g0.217 mol
MethanolCH3OH32.04232.0432.042 g0.312 mol
AcetoneCH3COCH358.08058.0858.080 g0.172 mol
GlucoseC6H12O6180.156180.16180.156 g0.0555 mol
SucroseC12H22O11342.297342.30342.297 g0.0292 mol
Citric acidC6H8O7192.123192.12192.123 g0.0520 mol
Acetic acidCH3COOH60.05260.0560.052 g0.167 mol
AdrenalineC9H13NO3183.207183.21183.207 g0.0546 mol
AspirinC9H8O4180.159180.16180.159 g0.0555 mol
CaffeineC8H10N4O2194.194194.19194.194 g0.0515 mol
UreaCO(NH2)260.05660.0660.056 g0.167 mol
Hydrochloric acid (HCl)HCl36.45836.4636.458 g0.274 mol
Sulfuric acidH2SO498.07298.0798.072 g0.102 mol
Nitric acidHNO363.01263.0163.012 g0.159 mol
Carbonic acidH2CO362.02462.0262.024 g0.161 mol
Phosphoric acidH3PO497.99497.9997.994 g0.102 mol
Sodium hydroxideNaOH39.99740.0039.997 g0.250 mol
Calcium hydroxideCa(OH)274.09274.0974.092 g0.135 mol
Magnesium hydroxideMg(OH)258.31958.3258.319 g0.171 mol
Sodium chlorideNaCl58.44058.4458.440 g0.171 mol
Potassium chlorideKCl74.54874.5574.548 g0.134 mol
Calcium chlorideCaCl2110.978110.98110.978 g0.0901 mol
Magnesium chlorideMgCl295.20595.2195.205 g0.105 mol
Calcium carbonateCaCO3100.086100.09100.086 g0.0999 mol
Sodium hydrogen carbonateNaHCO384.00684.0184.006 g0.119 mol
Sodium carbonateNa2CO3105.988105.99105.988 g0.0944 mol
Calcium nitrateCa(NO3)2164.086164.09164.086 g0.0609 mol
Ammonium nitrateNH4NO380.04380.0480.043 g0.125 mol
Ammonium nitriteNH4NO264.04464.0464.044 g0.156 mol
Ammonium sulfate(NH4)2SO4132.134132.13132.134 g0.0757 mol
Potassium permanganateKMnO4158.032158.03158.032 g0.0633 mol
Copper(II) sulfate pentahydrateCuSO4·5H2O249.677249.68249.677 g0.0401 mol
Calcium metaborate hexahydrateCa(BO2)2·6H2O233.784233.78233.784 g0.0428 mol

12.3 Molar mass of common gases, and their density at STP

GasFormulaMolar mass (g/mol)Ideal density at 0 °C, 1 bar (g/L)Heavier or lighter than air?
HydrogenH22.0160.08877Lighter
HeliumHe4.0030.1762Lighter
MethaneCH416.0430.7064Lighter
AmmoniaNH317.0310.7499Lighter
Water vapourH2O18.0150.7932Lighter
NeonNe20.1800.8886Lighter
NitrogenN228.0141.234Lighter
Carbon monoxideCO28.0101.233Lighter
OxygenO231.9981.409Heavier
Hydrogen sulfideH2S34.0761.500Heavier
Hydrogen chlorideHCl36.4581.605Heavier
ArgonAr39.9501.759Heavier
Carbon dioxideCO244.0091.938Heavier
PropaneC3H844.0971.942Heavier
ButaneC4H1058.1242.559Heavier
Sulfur dioxideSO264.0582.821Heavier
ChlorineCl270.9003.122Heavier
Sulfur hexafluorideSF6146.0486.431Heavier

ρ = PM ÷ RT with P = 100 kPa and T = 273.15 K. Air’s average molar mass is about 28.97 g/mol; a gas with a larger M sinks, a smaller one rises.

12.4 Amino acid molar masses (for protein calculations)

Amino acidCodeFormulaFree amino acid (g/mol)Residue in a chain (g/mol)
AlanineAla / AC3H7NO289.09471.079
ArginineArg / RC6H14N4O2174.204156.189
AsparagineAsn / NC4H8N2O3132.119114.104
Aspartic acidAsp / DC4H7NO4133.103115.088
CysteineCys / CC3H7NO2S121.154103.139
Glutamic acidGlu / EC5H9NO4147.130129.115
GlutamineGln / QC5H10N2O3146.146128.131
GlycineGly / GC2H5NO275.06757.052
HistidineHis / HC6H9N3O2155.157137.142
IsoleucineIle / IC6H13NO2131.175113.160
LeucineLeu / LC6H13NO2131.175113.160
LysineLys / KC6H14N2O2146.190128.175
MethionineMet / MC5H11NO2S149.208131.193
PhenylalaninePhe / FC9H11NO2165.192147.177
ProlinePro / PC5H9NO2115.13297.117
SerineSer / SC3H7NO3105.09387.078
ThreonineThr / TC4H9NO3119.120101.105
TryptophanTrp / WC11H12N2O2204.229186.214
TyrosineTyr / YC9H11NO3181.191163.176
ValineVal / VC5H11NO2117.14899.133

A residue is the amino acid minus one water (18.015 g/mol). Protein M = sum of residues + 18.015 for the water at the two ends. The quick rule of 110 Da per residue is an average estimate only.

12.5 Molar mass worksheet: calculate the molar mass for each of the following

Twenty molar mass calculations followed by ten mass and mole calculations, with answers checked by the calculator engine. Cover the last two columns and try them first.

📄 Download the Molar Mass Worksheet (PDF)

Free printable molar mass worksheet with answers.

#QuestionWorkingAnswer
1Calculate the molar mass of water, H2O.2 × 1.008 + 15.99918.015 g/mol
2Calculate the molar mass of carbon dioxide, CO2.12.011 + 2 × 15.99944.009 g/mol
3Calculate the molar mass of sodium chloride, NaCl.22.99 + 35.4558.440 g/mol
4Calculate the molar mass of calcium chloride, CaCl2.40.078 + 2 × 35.45110.978 g/mol
5Calculate the molar mass of calcium hydroxide, Ca(OH)2.40.078 + 2 × 15.999 + 2 × 1.00874.092 g/mol
6Calculate the molar mass of magnesium hydroxide, Mg(OH)2.24.305 + 2 × 15.999 + 2 × 1.00858.319 g/mol
7Calculate the molar mass of calcium nitrate, Ca(NO3)2.40.078 + 2 × 14.007 + 6 × 15.999164.086 g/mol
8Calculate the molar mass of carbonic acid, H2CO3.2 × 1.008 + 12.011 + 3 × 15.99962.024 g/mol
9Calculate the molar mass of calcium carbonate, CaCO3.40.078 + 12.011 + 3 × 15.999100.086 g/mol
10Calculate the molar mass of magnesium chloride, MgCl2.24.305 + 2 × 35.4595.205 g/mol
11Calculate the molar mass of ammonium nitrite, NH4NO2.2 × 14.007 + 4 × 1.008 + 2 × 15.99964.044 g/mol
12Calculate the molar mass of ethanol, C2H5OH.2 × 12.011 + 6 × 1.008 + 15.99946.069 g/mol
13Calculate the molar mass of methanol, CH3OH.12.011 + 4 × 1.008 + 15.99932.042 g/mol
14Calculate the molar mass of acetone, CH3COCH3.3 × 12.011 + 6 × 1.008 + 15.99958.080 g/mol
15Calculate the molar mass of citric acid, C6H8O7.6 × 12.011 + 8 × 1.008 + 7 × 15.999192.123 g/mol
16Calculate the molar mass of adrenaline, C9H13NO3.9 × 12.011 + 13 × 1.008 + 14.007 + 3 × 15.999183.207 g/mol
17Calculate the molar mass of calcium metaborate hexahydrate, Ca(BO2)2·6H2O.40.078 + 2 × 10.81 + 10 × 15.999 + 12 × 1.008233.784 g/mol
18Calculate the molar mass of carbon monoxide, CO.12.011 + 15.99928.010 g/mol
19Calculate the molar mass of sulfuric acid, H2SO4.2 × 1.008 + 32.06 + 4 × 15.99998.072 g/mol
20Calculate the molar mass of ammonium sulfate, (NH4)2SO4.2 × 14.007 + 8 × 1.008 + 32.06 + 4 × 15.999132.134 g/mol
21Calculate the mass in grams of 0.35 moles of CH4.0.35 mol × 16.043 g/mol5.6 g
22Calculate the mass in grams of 0.800 mole of H2CO3.0.800 mol × 62.024 g/mol49.6 g
23Calculate the mass of 0.500 mole of oxygen atoms.0.500 mol × 15.999 g/mol8.00 g
24Calculate the mass of one mole of water (1.00 mol).1.00 mol × 18.015 g/mol18.0 g
25Calculate the mass of 1.58 moles of CH4.1.58 mol × 16.043 g/mol25.3 g
26Calculate the mass of 2.19 moles of CH4.2.19 mol × 16.043 g/mol35.1 g
27Calculate the mass of 6.70 moles of carbon.6.70 mol × 12.011 g/mol80.5 g
28Calculate the mass of 7.23 moles of CH4.7.23 mol × 16.043 g/mol116 g
29How many moles are in 25.0 g of H2O?25.0 g ÷ 18.015 g/mol1.39 mol
30How many moles are in 10.0 g of NaCl?10.0 g ÷ 58.440 g/mol0.171 mol

📈 13. Molar Mass Calculation Examples

Eight molar mass examples run through the calculator, from water to an adrenaline molecule and a hydrated borate. Each figure is drawn from the computed numbers: bar length is each element’s contribution to the molar mass.

1
TEXTBOOK CASE

Molar mass of water, H2O

The first molar mass everyone learns.

Calculate the molar mass of water.

18.015 g/mol18.02 g/mol (2 d.p.)3 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
H (Hydrogen)21.0082.01611.19%
O (Oxygen)115.99915.99988.81%
Molar mass318.015100.00%
Contribution of each element to the molar mass of H₂OM(H₂O) = 18.015 g/molH2 × 1.008 = 2.016 (11.2%)O1 × 15.999 = 15.999 (88.8%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: M = 2 × 1.008 + 15.999 = 18.015 g/mol. Oxygen carries 88.81% of the mass although it is only one atom in three. One mole of water, 18.015 g, is about the volume of a tablespoon.

How to write it: M(H2O) = 2(1.008) + 15.999 = 18.015 g/mol

2
BRACKETS

Calcium hydroxide, Ca(OH)2

Everything inside the bracket counts twice.

Calculate the molar mass of calcium hydroxide, Ca(OH)2.

74.092 g/mol74.09 g/mol (2 d.p.)5 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
Ca (Calcium)140.07840.07854.09%
O (Oxygen)215.99931.99843.19%
H (Hydrogen)21.0082.0162.72%
Molar mass574.092100.00%
Contribution of each element to the molar mass of Ca(OH)₂M(Ca(OH)₂) = 74.092 g/molCa1 × 40.078 = 40.078 (54.1%)O2 × 15.999 = 31.998 (43.2%)H2 × 1.008 = 2.016 (2.7%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: The bracket doubles both O and H: 40.078 + 2 × 15.999 + 2 × 1.008 = 74.092 g/mol. Missing the bracket gives 57.085 g/mol, a 23% error.

How to write it: M(Ca(OH)2) = 40.078 + 2(15.999 + 1.008) = 74.092 g/mol

3
HYDRATE

Copper(II) sulfate pentahydrate

The water of crystallisation is part of the molar mass.

Calculate the molar mass of CuSO4·5H2O, the blue crystals.

249.677 g/mol249.68 g/mol (2 d.p.)21 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
Cu (Copper)163.54663.54625.45%
S (Sulfur)132.0632.06012.84%
O (Oxygen)915.999143.99157.67%
H (Hydrogen)101.00810.0804.04%
Molar mass21249.677100.00%
Contribution of each element to the molar mass of CuSO₄·5H₂OM(CuSO₄·5H₂O) = 249.677 g/molCu1 × 63.546 = 63.546 (25.5%)S1 × 32.06 = 32.060 (12.8%)O9 × 15.999 = 143.991 (57.7%)H10 × 1.008 = 10.080 (4.0%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: 159.602 + 5 × 18.015 = 249.677 g/mol. Water is 36.1% of the crystal by mass, which is why the crystals lose so much mass when heated to white anhydrous CuSO4.

How to write it: M(CuSO4·5H2O) = 159.602 + 5(18.015) = 249.677 g/mol

4
TWO BRACKET GROUPS

Calcium nitrate, Ca(NO3)2

Two nitrate ions: 2 N and 6 O.

Calculate the molar mass of calcium nitrate, Ca(NO3)2.

164.086 g/mol164.09 g/mol (2 d.p.)9 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
Ca (Calcium)140.07840.07824.42%
N (Nitrogen)214.00728.01417.07%
O (Oxygen)615.99995.99458.50%
Molar mass9164.086100.00%
Contribution of each element to the molar mass of Ca(NO₃)₂M(Ca(NO₃)₂) = 164.086 g/molCa1 × 40.078 = 40.078 (24.4%)N2 × 14.007 = 28.014 (17.1%)O6 × 15.999 = 95.994 (58.5%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: 40.078 + 2 × 14.007 + 6 × 15.999 = 164.086 g/mol. Oxygen is 58.50% of the mass. Calcium nitrate is a common fertiliser, so this number turns a bag weight into moles of nitrogen.

How to write it: M(Ca(NO3)2) = 40.078 + 2(14.007) + 6(15.999) = 164.086 g/mol

5
CONDENSED FORMULA

Acetone, CH3COCH3

Add every C, H and O, wherever they appear.

Calculate the molar mass of acetone, CH3COCH3.

58.080 g/mol58.08 g/mol (2 d.p.)10 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
C (Carbon)312.01136.03362.04%
H (Hydrogen)61.0086.04810.41%
O (Oxygen)115.99915.99927.55%
Molar mass1058.080100.00%
Contribution of each element to the molar mass of CH₃COCH₃M(CH₃COCH₃) = 58.080 g/molC3 × 12.011 = 36.033 (62.0%)H6 × 1.008 = 6.048 (10.4%)O1 × 15.999 = 15.999 (27.5%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: CH3COCH3 is C3H6O: 3 × 12.011 + 6 × 1.008 + 15.999 = 58.080 g/mol. The calculator also accepts the name acetone or propanone.

How to write it: M(C3H6O) = 3(12.011) + 6(1.008) + 15.999 = 58.080 g/mol

6
BIOMOLECULE

Adrenaline, C9H13NO3

A hormone with four elements.

Calculate the molar mass of adrenaline (epinephrine), C9H13NO3.

183.207 g/mol183.21 g/mol (2 d.p.)26 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
C (Carbon)912.011108.09959.00%
H (Hydrogen)131.00813.1047.15%
N (Nitrogen)114.00714.0077.65%
O (Oxygen)315.99947.99726.20%
Molar mass26183.207100.00%
Contribution of each element to the molar mass of C₉H₁₃NO₃M(C₉H₁₃NO₃) = 183.207 g/molC9 × 12.011 = 108.099 (59.0%)H13 × 1.008 = 13.104 (7.2%)N1 × 14.007 = 14.007 (7.6%)O3 × 15.999 = 47.997 (26.2%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: 9 × 12.011 + 13 × 1.008 + 14.007 + 3 × 15.999 = 183.207 g/mol. A typical 1 mg emergency dose is therefore 5.46 µmol.

How to write it: M(C9H13NO3) = 183.207 g/mol

7
FOOD CHEMISTRY

Citric acid, C6H8O7

The acid in lemons, and a triprotic acid.

Calculate the molar mass of citric acid, C6H8O7.

192.123 g/mol192.12 g/mol (2 d.p.)21 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
C (Carbon)612.01172.06637.51%
H (Hydrogen)81.0088.0644.20%
O (Oxygen)715.999111.99358.29%
Molar mass21192.123100.00%
Contribution of each element to the molar mass of C₆H₈O₇M(C₆H₈O₇) = 192.123 g/molC6 × 12.011 = 72.066 (37.5%)H8 × 1.008 = 8.064 (4.2%)O7 × 15.999 = 111.993 (58.3%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: 6 × 12.011 + 8 × 1.008 + 7 × 15.999 = 192.123 g/mol. Because it has three acidic hydrogens, choose 3 in the titration mode when you find its molar mass experimentally.

How to write it: M(C6H8O7) = 192.123 g/mol

8
HARD CASE

Calcium metaborate hexahydrate

Brackets and a hydrate together.

Calculate the molar mass of Ca(BO2)2·6H2O.

233.784 g/mol233.78 g/mol (2 d.p.)25 atomsVerified
ElementAtomsAtomic weightSubtotal (g/mol)% by mass
Ca (Calcium)140.07840.07817.14%
B (Boron)210.8121.6209.25%
O (Oxygen)1015.999159.99068.43%
H (Hydrogen)121.00812.0965.17%
Molar mass25233.784100.00%
Contribution of each element to the molar mass of Ca(BO₂)₂·6H₂OM(Ca(BO₂)₂·6H₂O) = 233.784 g/molCa1 × 40.078 = 40.078 (17.1%)B2 × 10.81 = 21.620 (9.2%)O10 × 15.999 = 159.990 (68.4%)H12 × 1.008 = 12.096 (5.2%)
Bar length is each element’s subtotal as a share of the molar mass.

What it means: Ca(BO2)2 = 40.078 + 2 × (10.81 + 2 × 15.999) = 125.694 g/mol; adding 6 × 18.015 gives 233.784 g/mol. There are 25 atoms in each formula unit.

How to write it: M = 125.694 + 6(18.015) = 233.784 g/mol

✏️ 14. How to Calculate Molar Mass by Hand, Step by Step

This is the written method examiners expect, on the same example as Sections 7, 9, 10 and 11: what is the molar mass of water, H2O?

14.1 How to calculate molar mass step by step

  1. Write the formula correctly. H2O, with a capital H and a capital O.
  2. Count the atoms of each element. H: 2, O: 1. A symbol with no number has 1 atom.
  3. Look up each atomic weight. H = 1.008, O = 15.999 (or H = 1, O = 16 with exam values).
  4. Multiply each count by its atomic weight. 2 × 1.008 = 2.016; 1 × 15.999 = 15.999.
  5. Add the products. M = 2.016 + 15.999 = 18.015 g/mol.
  6. Give the unit. g/mol for molar mass; no unit for Mr.
  7. Check. The answer should be a little more than the heaviest atom times its count: 18.015 is just above 16. Mass percents 11.19% + 88.81% = 100%.

14.2 How to calculate the molar mass of an element

For a single element, the molar mass is its atomic weight in g/mol: carbon is 12.011 g/mol and iron 55.845 g/mol. For elements that exist as molecules, multiply by the atoms in the molecule: oxygen gas O2 is 2 × 15.999 = 31.998 g/mol, chlorine gas Cl2 is 70.90 g/mol. Read the question carefully: “0.5 mol of oxygen atoms” weighs 0.5 × 15.999 = 8.0 g, but 0.5 mol of O2 weighs 16.0 g.

14.3 How to calculate molar mass with brackets and hydrates

Multiply every atom inside a bracket by the number after it. Ca(OH)2 = 40.078 + 2 × (15.999 + 1.008) = 74.092 g/mol. Ca(NO3)2 = 40.078 + 2 × 14.007 + 6 × 15.999 = 164.086 g/mol. For a hydrate, add the water after the dot: CuSO4·5H2O = 159.602 + 5 × 18.015 = 249.677 g/mol.

14.4 Mass and mole calculations: how to calculate mass from moles and moles from mass

Once you have M, mass = moles × molar mass and moles = mass ÷ molar mass. The mass in grams of 0.800 mol of H2CO3 is 0.800 × 62.024 = 49.6 g; the mass of 0.35 mol of CH4 is 0.35 × 16.043 = 5.6 g; 25.0 g of water is 25.0 ÷ 18.015 = 1.39 mol.

14.5 How to calculate the molecular formula from molar mass

Find the empirical formula mass, divide the molar mass by it, and multiply every subscript by the whole number you get. CH2O has an empirical mass of 30.026 g/mol; a substance with M = 180.16 g/mol gives 180.16 ÷ 30.026 = 6.00, so its molecular formula is C6H12O6.

14.6 How to calculate the molar mass of a gas

Measure the gas density, or a mass and volume, at a known temperature and pressure, then use the ideal gas law: M = ρRT ÷ P, or M = mRT ÷ PV. A gas with density 1.25 g/L at 0 °C and 1 atm has M = 1.25 × 8.314 × 273.15 ÷ 101.325 = 28.0 g/mol, which fits nitrogen or carbon monoxide. Use kelvin and the same pressure unit as R.

14.7 How to calculate molar mass from a titration

Moles of base = c × V; moles of acid = moles of base ÷ the number of acidic hydrogens; M = mass of acid ÷ moles of acid. For 0.250 g of an unknown diprotic acid needing 27.8 mL of 0.100 M NaOH: 0.00278 mol OH− ÷ 2 = 0.00139 mol acid, so M = 0.250 ÷ 0.00139 = 1.80 × 102 g/mol.

14.8 How to calculate average molar mass

Multiply each component’s molar mass by its mole fraction and add. For dry air, 0.7808 × 28.014 + 0.2095 × 31.998 + 0.0093 × 39.95 + 0.0004 × 44.009 = 28.97 g/mol. For isotopes the same sum gives the atomic weight: 0.7576 × 34.969 + 0.2424 × 36.966 = 35.453 for chlorine.

14.9 On a scientific calculator

On a Casio fx-991EX or fx-82MS: 2 × 1.008 + 15.999 = gives 18.015. For Ca(OH)2, use brackets on the calculator too: 40.078 + 2 × ( 15.999 + 1.008 ) = gives 74.092.

The calculator does multiplication before addition, so 2 × 1.008 + 15.999 works without brackets; a bracket group from the formula needs brackets on the calculator. Key names differ between models; check your manual.

14.10 Do it in the lab: the molar mass of butane from a lighter

Finding M of a gas by collecting it over water

  1. Weigh a disposable butane lighter to 0.001 g.
  2. Fill a 100 mL measuring cylinder with water and turn it upside down in a trough of water.
  3. Hold the lighter under water below the cylinder and release gas (without lighting it) until about 60 mL is collected.
  4. Level the water inside and outside the cylinder so the gas is at room pressure; read the volume. Record the temperature and the atmospheric pressure.
  5. Dry the lighter thoroughly with paper towel and reweigh it. The mass lost is the mass of butane collected.
  6. Subtract the vapour pressure of water at the room temperature from the atmospheric pressure, then use M = mRT ÷ PV (the gas mode of the calculator).

Hazards: butane is extremely flammable. No flames, sparks or hot plates in the room; work in a well-ventilated lab and release the collected gas outdoors or in a fume cupboard. Wear eye protection, wipe up spilt water, and follow your school’s risk assessment.

Main errors: water left on the lighter (mass loss too small, M too low), not levelling the water (pressure wrong), and not subtracting water vapour pressure (M too low).

MeasurementValueWorking
Lighter before25.317 g
Lighter after (dried)25.167 g
Mass of butane0.150 gbefore − after
Volume collected62.0 mL= 0.0620 L
Temperature22.0 °C= 295.15 K
Pressure of dry gas98.36 kPa101.0 − 2.64 kPa (water vapour at 22 °C)
Moles of gas0.00249 moln = PV ÷ RT
Molar mass60.4 g/mol0.150 ÷ 0.002485
Expected for C4H1058.12 g/molPercent error 3.8%

Example data. A result 3.8% high is typical: a little water left on the lighter adds to the mass lost. The mass (0.150 g) has three significant figures, so the answer is good to about ±1 g/mol.

14.11 Molar mass practice problems with answers

Ten practice problems, easy to hard. Open each one to see the answer.

1. What is the molar mass of carbon dioxide, CO2?

C 1, O 2 (3 atoms per molecule); C = 12.011, O = 15.999; 1 × 12.011 = 12.011; 2 × 15.999 = 31.998; M(CO2) = 12.011 + 31.998 = 44.009 g/mol. Answer: M(CO2) = 44.009 g/mol

2. Calculate the molar mass of magnesium hydroxide, Mg(OH)2.

Mg 1, O 2, H 2 (5 atoms per formula unit); Mg = 24.305, O = 15.999, H = 1.008; 1 × 24.305 = 24.305; 2 × 15.999 = 31.998; 2 × 1.008 = 2.016; M(Mg(OH)2) = 24.305 + 31.998 + 2.016 = 58.319 g/mol. Answer: M(Mg(OH)2) = 58.319 g/mol

3. Calculate the molar mass of ammonium nitrite, NH4NO2.

N 2, H 4, O 2 (8 atoms per molecule); N = 14.007, H = 1.008, O = 15.999; 2 × 14.007 = 28.014; 4 × 1.008 = 4.032; 2 × 15.999 = 31.998; M(NH4NO2) = 28.014 + 4.032 + 31.998 = 64.044 g/mol. Answer: M(NH4NO2) = 64.044 g/mol

4. Calculate the molar mass of methanol, CH3OH, and the mass of 2.50 mol of it.

C 1, H 4, O 1 (6 atoms per molecule); C = 12.011, H = 1.008, O = 15.999; 1 × 12.011 = 12.011; 4 × 1.008 = 4.032; 1 × 15.999 = 15.999; M(CH3OH) = 12.011 + 4.032 + 15.999 = 32.042 g/mol; m = n × M = 2.5000 mol × 32.042 g/mol = 80.1 g. Answer: M(CH3OH) = 32.042 g/mol; 2.50 mol = 80.1 g

5. How many moles are in 50.0 g of calcium carbonate?

Ca 1, C 1, O 3 (5 atoms per formula unit); Ca = 40.078, C = 12.011, O = 15.999; 1 × 40.078 = 40.078; 1 × 12.011 = 12.011; 3 × 15.999 = 47.997; M(CaCO3) = 40.078 + 12.011 + 47.997 = 100.086 g/mol; n = m ÷ M = 50.000 g ÷ 100.086 g/mol = 0.500 mol. Answer: M(CaCO3) = 100.086 g/mol; 50.0 g = 0.500 mol

6. 3.20 g of an unknown gas is 0.100 mol. Find its molar mass and suggest what it is.

M = m ÷ n; M = 3.200 g ÷ 0.1000 mol = 32.000 g/mol; M = 32.0 g/mol. Closest: O2 (31.998 g/mol). Answer: M = 32.0 g/mol

7. A gas has a density of 1.96 g/L at 0 °C and 1 atm. Find its molar mass.

T = 273.150 K; P = 101.325 kPa; M = 1.96 g/L × 8.314462618 × 273.150 K ÷ 101.325 kPa = 43.9 g/mol. Closest: CO2 (44.009 g/mol). Answer: M = 43.9 g/mol

8. A compound is 85.6% C and 14.4% H with M = 56.1 g/mol. Find its molecular formula.

C 85.6 g, H 14.4 g; C: 85.6 ÷ 12.011 = 7.1268; H: 14.4 ÷ 1.008 = 14.2857; C: 1.000; H: 2.005; CH2; M = 14.027 g/mol; 56.1 ÷ 14.027 = 3.999 ≈ 4, so CH2 × 4 = C4H8. Answer: C4H8, M = 56.108 g/mol

9. What mass of glucose is needed for 500 mL of 0.200 M solution?

M(C6H12O6) = 180.156 g/mol; n = c × V = 0.200 mol/L × 0.500 L = 0.10000 mol; m = n × M = 0.10000 × 180.156 = 18.0 g. Answer: Weigh 18.0 g of C6H12O6

10. Natural boron is 19.9% boron-10 (10.0129) and 80.1% boron-11 (11.0093). Find its average atomic mass.

M̄ = Σ xᵢMᵢ = 0.1990 × 10.013 + 0.8010 × 11.009 = 10.8110 g/mol. Answer: M̄ = 10.81 g/mol

📄 Download the Molar Mass Worksheet (PDF)

Want more practice on paper? Print the worksheet and check your answers.

14.12 Mistakes that lose marks

Research on the mole concept finds that students often confuse molar mass with mass, and subscripts with coefficients (Krishnan & Howe, 1994; Furió et al., 2002).

  • Counting only the first atom in a bracket: Ca(OH)2 is 74.092 g/mol, not 57.085.
  • Forgetting the water of a hydrate: CuSO4·5H2O is 249.677 g/mol, not 159.602.
  • Using 16 g/mol for oxygen gas instead of 32 g/mol for O2.
  • Including a coefficient: the molar mass of 2H2O is still 18.015 g/mol.
  • Typing Co (cobalt, 58.933) for CO (carbon monoxide, 28.010).
  • Rounding the atomic weights too early, then quoting four significant figures.
  • Writing “g” instead of “g/mol” for a molar mass.

✅ 15. When Should You Use a Molar Mass Calculator?

Use molar mass from a formula when:
  • You know the formula and need grams per mole.
  • You are converting between grams, moles and particles.
  • You are weighing out a reagent or making a solution of known molarity.
  • You need mass percent composition.
Use a data mode instead when:
  • You do not know the formula: use mass and moles, gas density or a titration.
  • You have combustion analysis percentages: use percent composition.
  • You have a mixture or isotopes: use the average molar mass.
  • You have a protein: use the sequence mode, or mass spectrometry for an exact mass.

Four real examples

SituationMethodResult
Making 250 mL of 0.100 M saline for a practicalm = c × V × M1.46 g of NaCl
An unknown gas with density 1.25 g/L at 0 °C and 1 atmM = ρRT ÷ P28.0 g/mol: N2 or CO
Concentrated hydrochloric acid, 37.0% w/w, 1.19 g/mLc = 10ρw ÷ M12.1 mol/L
A sugar is 40.0% C, 6.71% H, 53.3% O with M ≈ 180Empirical formula, then × 6C6H12O6

Decision tree

  1. Do you know the formula or the name? Yes: molar mass from a formula. No: go on.
  2. Do you know a mass and the moles? Yes: M = m ÷ n. No: go on.
  3. Is it a gas with a measured density, or mass and volume? Yes: the gas mode.
  4. Is it an acid you titrated? Yes: the titration mode. Have percentages? The percent composition mode.

🔧 16. Molar Mass Calculator Troubleshooting and Common Mistakes

"Element symbols start with a capital letter"

Cause: a lowercase formula such as cacl2. Fix: press the suggested formula under the box (CaCl2), or type the capitals yourself. When a lowercase input could mean two things, such as co2 (CO2 or Co2), both are offered.

My answer is too small

Cause: a bracket or hydrate was not counted. Fix: type the formula with its brackets, Ca(NO3)2, and the dot for water, CuSO4.5H2O. The preview under the box shows the atom count before you calculate.

"Remove the number in front of the formula"

Cause: a coefficient such as 2H2O. Fix: type H2O. The molar mass does not depend on how many moles you have; multiply afterwards if you need the mass of 2 mol.

My molar mass differs from the textbook in the last digit

Cause: a different set of atomic weights. Fix: switch to rounded exam values. With H = 1 and O = 16, water is 18 g/mol instead of 18.015.

The name I typed is not recognised

Cause: the calculator knows about 185 common names. Fix: type the formula instead. For organic compounds, a molecular formula (C2H6O) or a condensed formula (CH3CH2OH) both work.

The gas molar mass is far from any real gas

Cause: temperature in °C read as K, or pressure in the wrong unit. Fix: check the unit menus next to each box. For gas collected over water, subtract the water vapour pressure.

The titration answer is two or three times what I expected

Cause: the number of acidic hydrogens. Fix: choose 1, 2 or 3 to match the acid. Chart 3 shows M for all three choices.

"No whole-number ratio" in percent composition

Cause: rounded or incomplete percentages. Fix: make sure they add to about 100 (add oxygen as the remainder if it is missing) and use at least three significant figures.

The average molar mass looks wrong

Cause: mass fractions entered as mole fractions, or the other way round. Fix: choose the right option in “Fractions are”. Mass fractions use a harmonic average.

My protein mass differs from a database

Cause: disulfide bonds, a removed initiator methionine, modifications, or monoisotopic versus average mass. Fix: subtract 2.016 g/mol per disulfide bond and compare average masses with average masses.

⚖️ 17. Assumptions and Limitations of the Molar Mass Calculator

AssumptionWhat it requiresHow to checkIf it fails
Natural isotope abundancesStandard atomic weights applyOrdinary lab chemicalsEnriched samples (D2O, 13C labels) need isotope masses: use the average molar mass mode
The formula is rightCorrect formula, hydrate water includedCompare with a data bookThe arithmetic is right but the substance is wrong
Ideal gas (gas mode)Low pressure, well above the boiling pointIs the gas near condensing?M is off by a few percent for real gases near condensation
Complete reaction (titration mode)A pure acid, a sharp end point, the right number of acidic HIndicator choice, repeat titresM is wrong by the size of the titre error, or by a factor of 2 or 3
Average mass (protein mode)Standard residues, no modificationsCheck the sequence sourceMass spectrometry values (monoisotopic) are lower

Limitations. A molar mass calculator gives the mass of one mole of the formula you type; it cannot tell you whether that formula is the real substance. Molar masses of ions ignore the electron mass (under 0.003% for most ions). For elements with no standard atomic weight, such as Tc, the mass number of the longest-lived isotope is used and a note appears.

🎯 18. Conclusion

Your result: ___ . Calculate a molar mass above to add your own summary here.

What the answer is

Molar mass is the sum of the atomic weights in a formula, in g/mol. Water is 2 × 1.008 + 15.999 = 18.015 g/mol.

What it means chemically

It is the mass of one mole, 6.022 × 1023 formula units, so it converts grams into moles and moles into grams. Every reacting mass, concentration and gas volume calculation passes through it.

Watch out for

Read the formula carefully: brackets, hydrate water, diatomic gases and capital letters cause most wrong answers. Keep the full value for later steps and round only the final answer.

Next steps

Use the molar mass to convert grams to moles, then the mole ratio from a balanced equation for stoichiometry. Practise with the worksheet in Section 12.5 and the ten problems in Section 14.11, or calculate a whole list on the Batch tab.

❓ 19. Frequently Asked Questions

What is a molar mass calculator?

A molar mass calculator adds up the atomic weights of every atom in a chemical formula to give the mass of one mole in g/mol. This one also shows each element's mass percent, converts grams to moles and back, and finds molar mass from gas, titration, percent composition, mixture and protein data.

How do you calculate molar mass?

Count the atoms of each element in the formula, multiply each count by the element's atomic weight, and add the results. The answer is in grams per mole. For water: 2 x 1.008 + 1 x 15.999 = 18.015 g/mol.

What is molar mass and how is it calculated?

Molar mass is the mass of one mole of a substance, 6.022 x 10^23 particles, in g/mol. It is calculated as M = sum of (number of atoms x atomic weight) over every element in the formula, which gives the same number as the relative formula mass.

How do you calculate the molar mass of a compound with brackets?

Multiply every atom inside the bracket by the number after it, then add as usual. Calcium hydroxide, Ca(OH)2, has 1 Ca, 2 O and 2 H: 40.078 + 2 x 15.999 + 2 x 1.008 = 74.092 g/mol. Calcium nitrate, Ca(NO3)2, is 164.086 g/mol.

What is the molar mass of H2O (water)?

The molar mass of water is 18.015 g/mol: 2 x 1.008 for hydrogen plus 15.999 for oxygen. To two decimal places it is 18.02 g/mol, and with exam values (H = 1, O = 16) it is 18 g/mol. So one mole of water weighs 18.015 g.

What is the molar mass of NaCl?

The molar mass of sodium chloride is 22.990 + 35.45 = 58.440 g/mol, usually written 58.44 g/mol. With rounded exam values (Na = 23, Cl = 35.5) it is 58.5 g/mol.

What is the molar mass of CaCO3 and CaCl2?

Calcium carbonate, CaCO3, is 40.078 + 12.011 + 3 x 15.999 = 100.086 g/mol. Calcium chloride, CaCl2, is 40.078 + 2 x 35.45 = 110.978 g/mol. Magnesium chloride, MgCl2, is 95.205 g/mol.

How do you calculate the molar mass of an element?

For a single element, the molar mass in g/mol equals its standard atomic weight: carbon 12.011 g/mol, iron 55.845 g/mol. For elements that form molecules, multiply by the number of atoms: O2 is 31.998 g/mol and Cl2 is 70.90 g/mol.

How do you calculate mass from moles and molar mass?

Multiply the moles by the molar mass: m = n x M. The mass of 0.35 mol of CH4 is 0.35 x 16.043 = 5.6 g, and the mass of 0.800 mol of H2CO3 is 0.800 x 62.024 = 49.6 g.

How do you calculate moles from grams and molar mass?

Divide the mass in grams by the molar mass: n = m / M. For 25.0 g of water, n = 25.0 / 18.015 = 1.39 mol. Type the mass in the optional box of the calculator to get this in the same step.

How do you calculate molar mass from mass and moles?

Rearrange n = m / M to make M the subject: M = m / n. If 4.40 g of a gas is 0.100 mol, its molar mass is 44.0 g/mol, which matches carbon dioxide (44.009 g/mol).

How do you calculate the molar mass of a gas?

Use the ideal gas law. From a density, M = density x R x T / P; from a mass and volume, M = m x R x T / (P x V), with R = 8.314 L kPa/(mol K), T in kelvin and P in kPa. A gas with density 1.25 g/L at 0 °C and 1 atm has M = 28.0 g/mol.

How do you calculate molar mass from a titration?

Find the moles of base used (concentration x volume in litres), divide by the number of acidic hydrogens to get moles of acid, then divide the mass of acid by those moles. 0.250 g of a diprotic acid needing 27.8 mL of 0.100 M NaOH has M = 0.250 / (0.00278 / 2) = 180 g/mol.

How do you calculate the molecular formula from molar mass?

Divide the molar mass by the empirical formula mass and multiply every subscript by the whole number you get. CH2O is 30.026 g/mol; for M = 180.16 g/mol the ratio is 6.00, so the molecular formula is C6H12O6.

How do you calculate average molar mass?

Multiply each component's molar mass by its mole fraction and add: M = sum of x x M. Dry air gives 28.97 g/mol. With mass fractions, use M = 1 / sum of (w / M). The same mole-fraction sum gives an element's atomic weight from its isotopes.

How do you calculate the mass needed for a molar solution?

Multiply the molarity by the volume in litres and by the molar mass: m = c x V x M. For 250 mL of 0.100 M NaCl, m = 0.100 x 0.250 x 58.440 = 1.46 g. Dissolve it and make up to the mark in a volumetric flask.

How do you calculate concentration from density and molar mass?

For a solution sold by mass percent, molarity = 10 x density (g/mL) x mass percent / molar mass. Concentrated hydrochloric acid, 37.0% w/w at 1.19 g/mL, is 10 x 1.19 x 37.0 / 36.458 = 12.1 mol/L.

How do you calculate the molar mass of a protein?

Add the residue masses of every amino acid in the sequence and one water (18.015 g/mol) for the chain ends. Human ubiquitin, 76 residues, is 8564.87 g/mol or 8.56 kDa. The rule of 110 Da per residue gives a rough estimate only.

Is molar mass the same as molecular weight?

They are the same number in different units. Molar mass is in g/mol (water 18.015 g/mol), molecular weight or relative molecular mass has no unit (18.015), and the mass of one molecule is 18.015 u. A molar mass is not a mass: 25 g and 100 g of water both have M = 18.015 g/mol.

How do you calculate molar mass in Excel?

Put each element's atom count in one column and its atomic weight in the next, then use =SUMPRODUCT(B2:B3,C2:C3). Add =D2/$D$4*100 for the mass percent. Section 9 shows the sheet step by step for water.

📑 20. Cite This Tool

APA 7th edition
StatsUnlock Team. (2026). Molar mass calculator [Interactive chemistry tool]. StatsUnlock. https://statsunlock.com/molar-mass-calculator/
BibTeX
@misc{statsunlock_molarmass_2026, title={Molar Mass Calculator}, author={{StatsUnlock Team}}, year={2026}, note={Interactive chemistry tool}, url={https://statsunlock.com/molar-mass-calculator/}}
Methods wording
Molar masses were calculated with the StatsUnlock Molar Mass Calculator (2026) as the sum of the atomic weights in each formula, using CIAAW 2024 standard atomic weights.

🔗 21. Related Tools

📖 22. Glossary of Molar Mass Terms

TermPlain-English meaning
Atomic weight (Ar)The average mass of an element’s atoms relative to 1/12 of a carbon-12 atom. No unit.
Avogadro constant (NA)Exactly 6.022 140 76 × 1023 mol−1.
Average molar massThe mole-fraction-weighted molar mass of a mixture.
Dalton (Da, u)The unified atomic mass unit; 1 Da = 1 g/mol per particle.
Empirical formulaThe simplest whole-number ratio of atoms, such as CH2O.
Formula unitThe simplest repeating group in an ionic compound, such as NaCl.
Hill formulaA formula written with C first, H second, then the rest alphabetically.
HydrateA salt with water in its crystals, written with a dot: CuSO4·5H2O.
IsotopeAtoms of one element with different numbers of neutrons and masses.
Mass percentAn element’s share of the molar mass, as a percentage.
Molar mass (M)The mass of one mole of a substance, in g/mol.
Molarity (c)Moles of solute per litre of solution.
Mole (mol)Exactly 6.022 140 76 × 1023 particles.
Molecular formulaThe actual numbers of atoms in a molecule, such as C6H12O6.
Monoisotopic massThe mass using only the most common isotope of each element; used in mass spectrometry.
Relative formula mass (Mr)The sum of the atomic weights in a formula; the molar mass without its unit.
ResidueAn amino acid unit in a protein chain, one water lighter than the free amino acid.
Standard atomic weightThe atomic weight recommended by CIAAW for normal terrestrial samples.
STPStandard temperature and pressure: IUPAC uses 0 °C and 1 bar.
SubscriptThe small number after a symbol that counts atoms; not the same as a coefficient.

📚 23. References

Peer-reviewed sources for the methods and data used in this molar mass calculator: standard atomic weights, the definition of the mole and the Avogadro constant, and research on how students learn molar mass and the mole concept.

  1. Andreas, B., Azuma, Y., Bartl, G., Becker, P., Bettin, H., Borys, M., ... Zakel, S. (2011). Determination of the Avogadro constant by counting the atoms in a 28Si crystal. Physical Review Letters, 106(3), 030801. https://doi.org/10.1103/PhysRevLett.106.030801
  2. Azuma, Y., Barat, P., Bartl, G., Bettin, H., Borys, M., Busch, I., ... Zakel, S. (2015). Improved measurement results for the Avogadro constant using a 28Si-enriched crystal. Metrologia, 52(2), 360–375. https://doi.org/10.1088/0026-1394/52/2/360
  3. Dori, Y. J., & Hameiri, M. (2003). Multidimensional analysis system for quantitative chemistry problems: Symbol, macro, micro, and process aspects. Journal of Research in Science Teaching, 40(3), 278–302. https://doi.org/10.1002/tea.10077
  4. Furió, C., Azcona, R., & Guisasola, J. (2002). The learning and teaching of the concepts ‘amount of substance’ and ‘mole’: A review of the literature. Chemistry Education Research and Practice, 3(3), 277–292. https://doi.org/10.1039/B2RP90023H
  5. Gabel, D. L., & Sherwood, R. D. (1984). Analyzing difficulties with mole-concept tasks by using familiar analog tasks. Journal of Research in Science Teaching, 21(8), 843–851. https://doi.org/10.1002/tea.3660210806
  6. Güttler, B., Bettin, H., Brown, R. J. C., Davis, R. S., Mester, Z., Milton, M. J. T., ... Stock, M. (2019). Amount of substance – the Avogadro constant and the SI unit “mole”. Metrologia, 56(4), 044002. https://doi.org/10.1088/1681-7575/ab1fae
  7. Krishnan, S. R., & Howe, A. C. (1994). The mole concept: Developing an instrument to assess conceptual understanding. Journal of Chemical Education, 71(8), 653–655. https://doi.org/10.1021/ed071p653
  8. Marquardt, R., Meija, J., Mester, Z., Towns, M., Weir, R., Davis, R., & Stohner, J. (2018). Definition of the mole (IUPAC Recommendation 2017). Pure and Applied Chemistry, 90(1), 175–180. https://doi.org/10.1515/pac-2017-0106
  9. Meija, J., Coplen, T. B., Berglund, M., Brand, W. A., De Bièvre, P., Gröning, M., ... Prohaska, T. (2016). Atomic weights of the elements 2013 (IUPAC Technical Report). Pure and Applied Chemistry, 88(3), 265–291. https://doi.org/10.1515/pac-2015-0305
  10. Mills, I. M., Mohr, P. J., Quinn, T. J., Taylor, B. N., & Williams, E. R. (2006). Redefinition of the kilogram, ampere, kelvin and mole: A proposed approach to implementing CIPM recommendation 1 (CI-2005). Metrologia, 43(3), 227–246. https://doi.org/10.1088/0026-1394/43/3/006
  11. Nakhleh, M. B. (1992). Why some students don’t learn chemistry: Chemical misconceptions. Journal of Chemical Education, 69(3), 191–196. https://doi.org/10.1021/ed069p191
  12. Newell, D. B., Cabiati, F., Fischer, J., Fujii, K., Karshenboim, S. G., Margolis, H. S., ... Ullrich, J. N. (2018). The CODATA 2017 values of h, e, k, and NA for the revision of the SI. Metrologia, 55(1), L13–L16. https://doi.org/10.1088/1681-7575/aa950a
  13. Nurrenbern, S. C., & Pickering, M. (1987). Concept learning versus problem solving: Is there a difference? Journal of Chemical Education, 64(6), 508–510. https://doi.org/10.1021/ed064p508
  14. Pekdağ, B., & Azizoğlu, N. (2013). Semantic mistakes and didactic difficulties in teaching the “amount of substance” concept: A useful model. Chemistry Education Research and Practice, 14(1), 117–129. https://doi.org/10.1039/C2RP20132A
  15. Prohaska, T., Irrgeher, J., Benefield, J., Böhlke, J. K., Chesson, L. A., Coplen, T. B., ... Zhu, X. (2022). Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure and Applied Chemistry, 94(5), 573–600. https://doi.org/10.1515/pac-2019-0603
  16. Sanger, M. J. (2005). Evaluating students’ conceptual understanding of balanced equations and stoichiometric ratios using a particulate drawing. Journal of Chemical Education, 82(1), 131–134. https://doi.org/10.1021/ed082p131
  17. Schmidt, H.-J., & Jignéus, C. (2003). Students’ strategies in solving algorithmic stoichiometry problems. Chemistry Education Research and Practice, 4(3), 305–317. https://doi.org/10.1039/B3RP90018E
  18. Staver, J. R., & Lumpe, A. T. (1995). Two investigations of students’ understanding of the mole concept and its use in problem solving. Journal of Research in Science Teaching, 32(2), 177–193. https://doi.org/10.1002/tea.3660320206
  19. Tiesinga, E., Mohr, P. J., Newell, D. B., & Taylor, B. N. (2021). CODATA recommended values of the fundamental physical constants: 2018. Reviews of Modern Physics, 93(2), 025010. https://doi.org/10.1103/RevModPhys.93.025010
  20. Yarroch, W. L. (1985). Student understanding of chemical equation balancing. Journal of Research in Science Teaching, 22(5), 449–459. https://doi.org/10.1002/tea.3660220507
STATS UNLOCK · statsunlock.com · Molar Mass Calculator
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Statistical Models

Important Plots & Charts

Calculators and Converters