Free chemistry tool · No sign-up

Molar Mass Calculator

Type any chemical formula, or simply a name like glucose, and this molar mass calculator gives you the answer in g/mol instantly. You also get percent composition, the empirical formula, step-by-step working and a grams to moles converter in one place.

  • IUPAC atomic weights
  • Hydrates & brackets
  • Grams ⇄ moles
  • Runs in your browser

Calculate molar mass from a chemical formula

Enter a formula

Decimals

Case matters: Co is cobalt, CO is carbon monoxide.

Try an example

Molar mass

180.156g/mol

C6H12O6

Total atoms
24
Elements
3
Empirical formula
CH2O
Mass of one molecule
2.992 × 10−22 g

Percent composition by mass

    Element breakdown and mass percent
    ElementAtomsAtomic massMass (g/mol)Mass %
    Total24180.156100%
    Step-by-step working

      Grams to moles converter

      Uses the molar mass calculated above.

      n = m ÷ Mm = n × MN = n × NA

      Why it is better

      A molar mass calculator built for real chemistry

      Most molar mass tools stop at a single number. This one explains the answer, handles tricky formulas and turns the result into something you can use at the bench.

      Live results as you type

      The molar mass updates on every keystroke. If a symbol is wrong, the exact character is highlighted so you can fix it quickly.

      Understands real formulas

      Round, square and curly brackets, nested groups, hydrates such as CuSO4·5H2O, decimal subscripts, isotopes D and T, and ion charges.

      Search by compound name

      Not sure of the formula? Type water, baking soda or caffeine. The calculator recognises over 80 common names and fills in the formula.

      Percent composition built in

      See the mass contribution and mass percent of every element with a visual bar, so you never need a separate percent composition calculator.

      Grams, moles and particles

      Convert between mass, moles and number of molecules with the molar mass you just found. Edit any field and the other two update.

      Working you can copy

      Every multiplication and the final sum are written out, so you can check the method or copy it into homework and lab reports.

      How to use

      How to use the molar mass calculator

      You only need a formula. Everything else is calculated for you in four quick steps.

      1. Enter a formula or name

        Type a formula such as H2SO4 or Ca(OH)2, or a name like glucose. Capital letters matter, so Co is cobalt while CO is carbon monoxide.

      2. Read the molar mass

        The result appears instantly in g/mol. Then choose 2, 3 or 4 decimal places to match your textbook or lab sheet.

      3. Check the breakdown

        Review the atoms, atomic masses, mass contributions and percent composition of each element, plus the full working.

      4. Convert grams and moles

        Finally, enter grams, moles or particles in the converter. The other two values are calculated from the same molar mass.

      The method

      How to calculate molar mass by hand

      Molar mass is the mass of one mole of a substance, measured in grams per mole (g/mol). One mole contains exactly 6.02214076 × 1023 particles, which is Avogadro’s number. To find the molar mass of a compound, you add up the atomic masses of every atom in its formula.

      M = Σ (number of atoms × atomic mass)Atomic masses come from the periodic table, in g/mol.

      Formulas with brackets and hydrates

      A number after a bracket multiplies everything inside it. For example, Ca(OH)2 contains two oxygen atoms and two hydrogen atoms. For a hydrate such as CuSO4·5H2O, add five water molecules (5 × 18.015 = 90.075) to CuSO4 (159.602). The total is 249.677 g/mol.

      Need to round the answer for a test? Use our significant figures calculator to match the precision of your data.

      Worked example

      Molar mass of sulfuric acid (H2SO4)

      1. Count the atoms: 2 hydrogen, 1 sulfur and 4 oxygen.
      2. Look up the atomic masses: H = 1.008, S = 32.06 and O = 15.999.
      3. Multiply: 2 × 1.008 = 2.016, 1 × 32.06 = 32.06 and 4 × 15.999 = 63.996.
      4. Add the results: 2.016 + 32.06 + 63.996 = 98.072.
      Molar mass of H2SO498.072 g/mol

      Conversions

      Grams to moles and moles to grams

      Once you know the molar mass, converting between mass and amount is a single step. The grams to moles calculator built into the tool above does this automatically, but the formulas are simple.

      Grams to molesn = m ÷ M
      Moles to gramsm = n × M
      Moles to particlesN = n × 6.022 × 1023

      For example, 25 g of sodium chloride is 25 ÷ 58.440 = 0.428 mol. Likewise, 0.5 mol of carbon dioxide weighs 0.5 × 44.009 = 22.00 g. If you are scaling a reaction, our molarity calculator turns grams into solution concentrations, our ratio calculator helps with mole ratios, and the unit converter handles mg, kg and other units.

      Reference table

      Molar mass of common compounds

      These values use the same atomic weights as the calculator. Select Calculate on any row to see its full breakdown.

      Molar masses of common chemical compounds in g/mol
      CompoundMolar mass (g/mol)Action
      WaterH2O18.015
      Carbon dioxideCO244.009
      Sodium chlorideNaCl58.440
      GlucoseC6H12O6180.156
      SucroseC12H22O11342.297
      Sulfuric acidH2SO498.072
      Hydrochloric acidHCl36.458
      Nitric acidHNO363.012
      Sodium hydroxideNaOH39.997
      AmmoniaNH317.031
      MethaneCH416.043
      EthanolC2H5OH46.069
      Calcium carbonateCaCO3100.086
      Sodium bicarbonateNaHCO384.006
      Potassium permanganateKMnO4158.032
      CaffeineC8H10N4O2194.194
      Copper sulfate pentahydrateCuSO4·5H2O249.677
      Oxygen gasO231.998

      Key terms

      Molar mass vs molecular weight vs formula mass

      These three terms give the same number for a compound. However, they differ in meaning and units, which matters in exams and lab reports. It is also why a molar mass calculator doubles as a molecular weight calculator.

      Molar mass

      The mass of one mole of a substance, in g/mol. You use it to convert grams to moles when preparing solutions or balancing reactions.

      Molecular weight

      The mass of one molecule relative to one twelfth of a carbon-12 atom. It is unitless or given in daltons (Da), so glucose is 180.156 Da.

      Formula mass

      Used for ionic compounds like NaCl, which form crystal lattices instead of separate molecules. It is calculated from one formula unit in the same way.

      Benefits

      Who uses this molar mass calculator

      The tool runs entirely in your browser. Nothing you type is uploaded, it works offline once loaded, and it is free with no sign-up.

      Students

      Check homework and exam practice in seconds. The working shows each step, so you learn the method instead of copying a number.

      Teachers

      Project it in class and share a link that opens with your formula loaded. It is a quick way to demonstrate percent composition.

      Lab technicians

      Weigh out reagents with 4 decimal precision and convert target moles to grams before you prepare a solution.

      Pharmacy and industry

      Verify formula weights for hydrates, salts and active ingredients during formulation, quality checks and stoichiometry work.

      FAQ

      Molar mass calculator FAQs

      What does a molar mass calculator do?

      It reads a chemical formula, counts the atoms of each element and multiplies each count by that element’s standard atomic weight. Then it adds the results to give the molar mass in grams per mole (g/mol). This one also shows percent composition and converts grams to moles.

      How do you calculate the molar mass of a compound?

      Multiply the atomic mass of each element by the number of its atoms in the formula, then add everything together. For example, the molar mass of CO2 is 12.011 + 2 × 15.999 = 44.009 g/mol.

      What is the molar mass of water (H2O)?

      The molar mass of water is 18.015 g/mol. It comes from two hydrogen atoms (2 × 1.008 = 2.016) plus one oxygen atom (15.999).

      How do I convert grams to moles?

      Divide the mass in grams by the molar mass. For 36 g of water, 36 ÷ 18.015 = 1.998 mol. The converter on this page does it for you as soon as you enter a formula.

      Is molar mass the same as molecular weight?

      They share the same number but not the same units. Molar mass is given in g/mol, while molecular weight is unitless or expressed in daltons. So glucose has a molar mass of 180.156 g/mol and a molecular weight of 180.156 Da.

      How do I enter hydrates and brackets?

      Put a dot, an asterisk or a middle dot between the parts, for example CuSO4.5H2O, CuSO4*5H2O or CuSO4·5H2O. Round, square and curly brackets all work, including nested groups like K4[Fe(CN)6].

      Why are some atomic masses shown in brackets?

      Radioactive elements such as technetium and plutonium have no stable isotopes, so they have no standard atomic weight. Instead, the calculator uses the mass number of the longest-lived isotope and marks the result as approximate.

      Which atomic weights does this calculator use?

      It uses IUPAC standard atomic weights, with the conventional values for elements whose isotopes vary in nature (for example H = 1.008, C = 12.011 and O = 15.999). These match most textbooks and periodic tables, so your answers will agree with class notes.

      Ready when you are

      Get exact molar masses in seconds

      Whether you are balancing equations, preparing a solution or revising for an exam, this molar mass calculator gives a precise answer with the working to back it up. Bookmark it and try your next formula now.

      Calculate a molar mass
      Scroll to Top