CalculateItNow home

Molecular Weight Calculator

Type a chemical formula, brackets and hydrates included, and get the molar mass, each element's contribution and the percentage composition, from IUPAC weights.

Molecular Weight Calculator: with the default inputs, molar mass (g/mol) is 180.156.

Try an example
Molar mass (g/mol)
180.156
Formula as read
C6H12O6
Atoms per formula unit
24
Different elements
3
Percentage composition
O 53.28%, C 40%, H 6.71%
Moles in the sample
0.005551
Particles in the sample
3,342,736,717.07T
Assumptions
  • IUPAC/CIAAW abridged standard atomic weights (2021), which are natural-abundance averages, not the mass of any single isotope.
  • Elements with no stable isotope use the mass number of the most stable known isotope, and are flagged.
  • Hydrate water is counted in the molar mass.
  • Avogadro's number is exactly 6.02214076 × 10²³ per mole (SI, 2019).
Where the mass sits
  • O — Oxygen95.9953%
  • C — Carbon72.0740%
  • H — Hydrogen12.17%
Contribution of each element
SymbolElementAtomsAtomic weightg/mol% of mass
OOxygen615.99995.99453.284%
CCarbon612.01172.06640.002%
HHydrogen121.00812.0966.714%

Percentages are by mass, not by atom count. Hydrogen is usually the biggest gap between the two: 12 of the 24 atoms in glucose are hydrogen, but they carry under 7% of the mass.

Math verified by automated testsUpdated 2026-09-093 sources cited

How this is worked out

The formula

Molar mass  M = Σ (number of atoms of each element × that element's standard atomic weight)

  Percentage composition of element E = 100 × (atoms of E × A_r(E)) ÷ M
  Moles in a sample = sample mass (g) ÷ M (g/mol)
  Particles = moles × 6.02214076 × 10²³ (Avogadro's number, exact by definition)

Glucose:  C₆H₁₂O₆ = 6(12.011) + 12(1.008) + 6(15.999) = 180.156 g/mol

Open How it’s calculated above to see this worked through with your own numbers.

What you enter

Chemical formula
Capital letter to start each symbol. Use brackets for groups and · (or a full stop) for a hydrate.up to 120 characters · defaults to "C6H12O6"
Sample mass(under More options)
Optional: converts the sample into moles using the molar mass.from 0 to 1000000000 · defaults to 1

What you get back

Molar mass (g/mol)main answer
Formula as read
Atoms per formula unit
Different elements
Percentage composition
Moles in the sample
Particles in the sample
Moles × Avogadro's number, 6.02214076 × 10²³ per mole.

What this assumes

  • IUPAC/CIAAW abridged standard atomic weights (2021), which are natural-abundance averages, not the mass of any single isotope.
  • Elements with no stable isotope use the mass number of the most stable known isotope, and are flagged.
  • Hydrate water is counted in the molar mass.
  • Avogadro's number is exactly 6.02214076 × 10²³ per mole (SI, 2019).

About this calculator

Type a chemical formula and get its molar mass in grams per mole, along with what each element contributes and the percentage composition by mass. The parser handles nested brackets and hydrates, so Ca(OH)2, Al2(SO4)3 and CuSO4·5H2O all work.

How to write the formula

Element symbols start with a capital and may have one lower-case letter after it — this is not decoration, it is what separates Co (cobalt) from CO (carbon monoxide). Subscripts are plain digits after the atom or group they multiply: H2O, Ca(OH)2, Fe2(SO4)3. Brackets can be round, square or curly and can nest.

For a hydrate, separate the parts with a middle dot, an asterisk or a full stop, and put the coefficient in front: CuSO4·5H2O, CuSO4*5H2O and CuSO4.5H2O all mean copper(II) sulfate pentahydrate at 249.68 g/mol. The water is included in the total — forgetting that is one of the most common sources of a weighing error in a teaching lab, because the anhydrous salt is 159.60 g/mol, a difference of over 50%.

Where the numbers come from

Atomic weights are the IUPAC/CIAAW standard atomic weights, 2021 abridged values. These are averages over the isotopic composition of normal terrestrial material, weighted by natural abundance — which is why chlorine is 35.45 rather than 35 or 37, and why carbon is 12.011 rather than 12. Carbon-12 is exactly 12 by definition, but about 1.1% of natural carbon is carbon-13, and that drags the average up.

For elements with no stable isotope — technetium, promethium, and everything past bismuth — there is no meaningful natural average, so the figure used is the mass number of the most stable or best-characterised isotope. The calculator says so when your formula contains one.

Molar mass, molecular weight, formula weight

These are used interchangeably in practice, with a distinction worth knowing. Molecular weight strictly applies to substances made of discrete molecules. Sodium chloride is an ionic lattice with no NaCl molecule in it, so 58.44 is properly its formula weight — the mass of one mole of formula units. Molar mass is the general term and always carries units of g/mol. Relative molecular mass, Mr, is the same number without units, because it is a ratio against the unified atomic mass unit.

Percentage composition

Each element's share of the total mass. It is the bridge between a formula and an elemental analysis: a lab reports 40.00% C, 6.71% H, 53.29% O, and those percentages are what identify the compound as glucose rather than, say, formaldehyde — which has exactly the same percentages, because CH₂O is glucose's empirical formula. Percentage composition fixes the ratio of atoms, never the absolute count, so it can never distinguish a molecule from a multiple of itself.

Limits

Formulas are capped at 120 characters with brackets no more than ten deep, subscripts under 1,000 and 100,000 atoms per unit, so a malformed or hostile string is rejected immediately rather than after any work is done. Structural notation — bonds, charges, isotope labels, SMILES strings — is not parsed; enter the molecular formula instead.

Frequently asked questions

What is the molar mass of glucose?

180.156 g/mol for C₆H₁₂O₆, from 6 × 12.011 + 12 × 1.008 + 6 × 15.999. By mass it is 40.00% carbon, 6.71% hydrogen and 53.29% oxygen.

How do I enter a hydrate?

Separate the parts with ·, * or a full stop and put the number in front of the water: CuSO4·5H2O. The waters are included in the molar mass, which is why the hydrate weighs far more than the anhydrous salt.

Why is carbon 12.011 and not 12?

Because standard atomic weights average over natural isotopic abundance. Carbon-12 is exactly 12 by definition, but about 1.1% of natural carbon is carbon-13, which pulls the average up.

What is the difference between molecular weight and molar mass?

Numerically nothing; the units differ. Molar mass is in g/mol. Molecular weight strictly applies only to molecular substances — for an ionic solid like NaCl the correct term is formula weight.

Can I enter charges or structural formulas?

No. Enter the molecular formula only. Charges, bonds, isotope labels and SMILES strings are rejected rather than silently ignored, so you never get a plausible number from a formula the calculator misread.

Put this calculator on your own site

A working molar mass, free for any site, with no ads and no sign-up. It resizes to fit wherever you paste it and updates itself as this page improves.

Paste this anywhere. It works on any site, carries no ads, never expires, and always shows the current version.

Molecular Weight Calculator by CalculateItNow

The page's own title. The clearest description of what the link leads to.

The credit line sits outside the widget on purpose, so it is a real link on your page rather than one buried in a frame. Please keep it — it is what pays for CalculateItNow staying free and ad-free. The script only resizes the widget to fit its contents; drop it and the widget still works.

Browse every calculator widget·How to add it to WordPress, Squarespace or Wix

The questions people ask next to a molar mass.

All science calculators·Browse everything