Home › Calculators › Molar Mass Calculator

Molar Mass Calculator

Type a chemical formula to get its molar mass in g/mol, with a table showing each element's atoms, mass and percentage of the total. Parentheses, square brackets and hydrates like CuSO4·5H2O are all supported.

Last updated:

Case matters: Co is cobalt, CO is carbon monoxide. Use ( ), [ ] or { } for groups and · or * for hydrates, e.g. CuSO4·5H2O.

Molar mass of ?–
Atoms per formula unit–
Different elements–
Mass of one molecule–

Element breakdown

ElementAtomsAtomic massTotal mass (g/mol)Mass %

Grams ⇄ moles

Amount
–
–
Mass
–

Examples

Periodic table (tap an element to insert it)

Advertisement

How to use the Molar Mass Calculator

  1. Type the formula with correct capitalisation, for example C6H12O6, Mg(OH)2 or K4[Fe(CN)6].
  2. For hydrates, separate the water with a dot or asterisk: CuSO4·5H2O or CuSO4*5H2O. The · button inserts the dot.
  3. Press Calculate (the result also updates as you type) to see the molar mass in g/mol.
  4. Read the breakdown: each element's number of atoms, atomic mass, total mass and mass percentage.
  5. Convert amounts: enter grams to get moles and particles, or moles to get grams.

How to calculate molar mass: worked example

Find the molar mass of copper(II) sulfate pentahydrate, CuSO₄·5H₂O:

  1. Count the atoms. The 5 in front of H₂O multiplies it: Cu 1, S 1, O 4 + 5 = 9, H 10.
  2. Multiply by the atomic masses: Cu 63.546, S 32.06, O 9 × 15.999 = 143.991, H 10 × 1.008 = 10.080.
  3. Add them: 63.546 + 32.06 + 143.991 + 10.080 = 249.677 g/mol.
  4. Water makes up 5 × 18.015 = 90.075 g/mol, so the crystals are 36.08% water by mass.

Brackets work the same way: in Ca₃(PO₄)₂ the 2 multiplies everything inside, giving Ca 3, P 2 and O 8, so M = 3 × 40.078 + 2 × 30.974 + 8 × 15.999 = 310.17 g/mol.

Molar masses of common compounds

CompoundFormulaMolar mass (g/mol)
WaterH₂O18.015
Carbon dioxideCO₂44.009
Sodium chlorideNaCl58.44
AmmoniaNH₃17.031
Sulfuric acidH₂SO₄98.072
GlucoseC₆H₁₂O₆180.156
EthanolC₂H₅OH46.069
Calcium carbonateCaCO₃100.086
Sodium hydroxideNaOH39.997
CaffeineC₈H₁₀N₄O₂194.194

Useful formulas

  • Moles: n = m / M (grams divided by molar mass).
  • Mass: m = n × M.
  • Number of particles: N = n × NA, where Avogadro's number NA = 6.02214076 × 10²³ mol⁻¹.
  • Mass percent of an element: (atoms × atomic mass / M) × 100%.
  • Molarity: mol/L = grams per litre ÷ M. A 1 M NaCl solution has 58.44 g of salt per litre.

Frequently asked questions

How do you calculate molar mass?

Multiply the atomic mass of each element by the number of its atoms in the formula and add the results. For water, H2O = 2 × 1.008 + 15.999 = 18.015 g/mol.

What is the difference between molar mass and molecular weight?

They have the same number. Molar mass is the mass of one mole of a substance in g/mol, while molecular weight (relative molecular mass) is a dimensionless ratio to 1/12 of the mass of a carbon-12 atom. 18.015 g/mol for water means its molecular weight is 18.015.

How do I enter a hydrate?

Put a dot (·), a full stop or an asterisk between the salt and the water, with the number of water molecules in front: CuSO4·5H2O or CuSO4*5H2O. The calculator multiplies the 5 into the H2O, giving 249.677 g/mol.

Why does capitalisation matter?

Element symbols are a capital letter, optionally followed by one lowercase letter. Co is cobalt (58.933 g/mol) but CO is carbon monoxide (28.010 g/mol), and NO is nitric oxide while No is nobelium.

How do I convert grams to moles?

Divide the mass in grams by the molar mass: moles = grams ÷ g/mol. 10 g of water is 10 ÷ 18.015 = 0.5551 mol. To go back, multiply moles by the molar mass.

What is mass percent composition?

It is the share of the total mass contributed by each element: (atoms × atomic mass ÷ molar mass) × 100. In water, oxygen is 15.999 ÷ 18.015 = 88.81% of the mass.

Which atomic weights does the calculator use?

It uses the IUPAC standard atomic weights (conventional values such as 1.008 for H and 32.06 for S). For radioactive elements with no stable isotopes, such as technetium or plutonium, it uses the mass number of the longest-lived isotope, shown in brackets.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Scientific CalculatorTrig, logs, powers and more in your browser.Ratio CalculatorSimplify, solve and scale ratios with step-by-step working.Proportion CalculatorSolve A/B = C/D for x with cross multiplication steps.Weighted Average CalculatorCalculate a weighted mean from values and weights, step by step.Buffer pH CalculatorBuffer pH from pKa and acid/base concentrations, or the recipe for a target pH.Concentration ConverterConvert %, w/v, ppm, ppb, mg/L, g/L, mol/L, mM and µM using molecular weight and density.DNA Reverse ComplementGet the reverse, complement or reverse complement of DNA/RNA, FASTA and IUPAC codes supported.DNA to Protein TranslatorTranslate DNA or RNA into protein in all six reading frames with stop codons highlighted.Interactive Periodic TableAll 118 elements with colour modes, filters, search and full element details.Chemical Equation BalancerBalance chemical, ionic and redox equations with the matrix method and steps.Dilution CalculatorSolve C1V1 = C2V2 for any variable: stock volume, final volume or concentration, with units.Percent Yield CalculatorPercent yield from actual and theoretical yield, or theoretical yield from moles and formulas.PPM CalculatorConvert ppm to mg/L, %, ppb and mg/kg, find ppm of a solution, or ppm to mg/m³ for gases.Grams to Moles CalculatorConvert grams to moles and back from a chemical formula, with molar mass and atom counts.Blood Type CalculatorPossible child blood types and their odds from both parents' ABO and Rh types, with Punnett squares.Combined Gas Law CalculatorSolve P1V1/T1 = P2V2/T2 for any variable, with Boyle's, Charles's and Gay-Lussac's modes.Electron Configuration CalculatorFull and noble-gas shorthand electron configuration, orbital diagram and valence electrons.Empirical Formula CalculatorElement percentages or grams to mole ratios, empirical formula and molecular formula.Gibbs Free Energy CalculatorΔG from ΔH, ΔS and temperature, with spontaneity, crossover temperature and K.Mass Percent CalculatorMass percent of a solution, percent composition of a formula, or mass for a target %.Molality CalculatorMolality from grams or moles of solute and solvent mass, or solve for either one.Moles to Atoms CalculatorConvert moles, grams and atoms or molecules with Avogadro's number, atoms per element.Protons Neutrons Electrons CalculatorCount protons, neutrons and electrons for any element, isotope or ion, with isotope notation.Serial Dilution CalculatorConcentration, transfer and diluent volume for every tube of a dilution series.Soap Lye CalculatorNaOH or KOH and water for a soap recipe from oil SAP values, superfat and water ratio.Theoretical Yield CalculatorTheoretical yield in grams and moles from limiting reagent mass and mole ratio.Punnett Square CalculatorBuild monohybrid, dihybrid or trihybrid Punnett squares with genotype and phenotype ratios.Stoichiometry CalculatorFrom one known mass or mole amount, get moles and grams of every reactant and product.Six Sigma CalculatorDPMO, yield and sigma level from defects, with the 1.5 sigma shift and a conversion table.Beer-Lambert Law CalculatorSolve A = εlc for absorbance, concentration, molar absorptivity or path length; %T conversion.Boyle's Law CalculatorSolve P1V1 = P2V2 for any missing pressure or volume, with units, gauge option and steps.Centrifuge RPM to RCF CalculatorConvert centrifuge RPM to RCF (× g) or RCF to RPM from rotor radius, with an RPM chart.Charles's Law CalculatorSolve V1/T1 = V2/T2 for volume or temperature, with °C, °F or K converted to kelvin.Hardy-Weinberg CalculatorAllele frequencies, expected genotypes and a chi-square equilibrium test from counts or p, q.Percent Solution CalculatorHow much solute and solvent for a w/v, w/w or v/v % solution, plus % from amounts and dilutions.Valence Electrons CalculatorValence electrons for any element, ion or molecule formula, with group-by-group working.
See all 35 Chemistry & Biology Calculators →