Skip to main content
ilovecalcs logoilovecalcs.

Science · Live

Molecular Weight Calculator — Molar mass from any chemical formula.

Enter any chemical formula — H₂O, C₆H₁₂O₆, Ca(OH)₂, Al₂(SO₄)₃ and instantly get the molar mass in g/mol with a full element-by-element breakdown, mass contributions, and percentage composition. Supports parentheses, brackets, and hydrate notation (·).

How it worksReal-time

Input

Chemical Formula

O×1H×2
Unique elements
2
Total atoms
3

Examples

Molar Mass

18.0150

g/mol

H₂O

Composition by Mass

O88.81%
H11.19%

Breakdown

Element-by-element contribution

SymbolCountMass (g/mol)% Mass
O115.999088.81%
H22.0160011.19%
Total18.0150100.00%

Molar mass guide

What is molar mass and how is it calculated?

The molar mass (also called molecular weight) of a chemical compound is the mass of exactly one mole of that substance, expressed in grams per mole (g/mol). One mole is Avogadro's number of particles — approximately 6.022 × 10²³ atoms or molecules. Knowing the molar mass is the bridge between the microscopic world of atoms and the macroscopic world of grams and litres that chemists measure in the laboratory.

How to calculate molar mass

The molar mass of a compound is the sum of the molar masses of each element, multiplied by its subscript in the formula:

M = Σ (subscript × atomic weight)

Every element has a characteristic standard atomic weight — a weighted average of the masses of all naturally occurring isotopes — published by IUPAC (the International Union of Pure and Applied Chemistry). This calculator uses IUPAC 2021 values.

Worked example: water (H₂O)

Water contains 2 hydrogen atoms and 1 oxygen atom:

M(H₂O) = 2 × M(H) + 1 × M(O)
M(H₂O) = 2 × 1.008 + 1 × 15.999
M(H₂O) = 2.016 + 15.999 = 18.015 g/mol

This means that 18.015 grams of water contains exactly one mole (6.022 × 10²³ molecules) of H₂O.

Worked example: glucose (C₆H₁₂O₆)

Glucose, the primary energy fuel for living cells, has the formula C₆H₁₂O₆:

M(C₆H₁₂O₆) = 6×12.011 + 12×1.008 + 6×15.999
= 72.066 + 12.096 + 95.994
= 180.156 g/mol

A standard intravenous glucose bag contains 50 g of glucose, which is 50 ÷ 180.156 ≈ 0.278 mol, or about 1.67 × 10²³ molecules.

Worked example: alum — Al₂(SO₄)₃

Parentheses in a formula mean the group inside is repeated by the following number. For aluminium sulfate Al₂(SO₄)₃:

Al₂(SO₄)₃ → Al=2, S=3, O=12
M = 2×26.982 + 3×32.06 + 12×15.999
= 53.964 + 96.18 + 191.988 = 342.15 g/mol

The mole and Avogadro's number

The mole (symbol: mol) is the SI unit for amount of substance. One mole of any substance contains exactly 6.02214076 × 10²³ elementary entities (atoms, molecules, ions, etc.) — Avogadro's number, N_A. This fixed value was adopted by CGPM in 2019 when the SI units were redefined.

The molar mass provides the conversion factor between moles and grams:

n = m / M (moles = mass in grams ÷ molar mass)
m = n × M (grams = moles × molar mass)

For example: you have 50 g of NaCl (M = 58.44 g/mol). How many moles? n = 50 / 58.44 = 0.856 mol and therefore 0.856 × 6.022 × 10²³ = 5.15 × 10²³ ion pairs.

Percent composition by mass

The percent by mass of an element in a compound is:

% = (n_element × M_element / M_compound) × 100

For water: oxygen is 15.999 / 18.015 × 100 = 88.81% by mass; hydrogen is 2 × 1.008 / 18.015 × 100 = 11.19% by mass. This breakdown is shown in the composition bar above the element table.

Difference between molar mass and molecular mass

Molecular mass is the mass of a single molecule in atomic mass units (u or Da). Molar mass is the mass of one mole of molecules in g/mol. Numerically they are the same number — 18.015 u per molecule vs 18.015 g per mole — because 1 g/mol = 1 u by definition (both are based on the carbon-12 standard). The terms are often used interchangeably in practice.

Applications of molar mass

  • Stoichiometry: Balanced equations work in mole ratios. Converting between grams and moles using molar mass is the central step in every stoichiometry calculation.
  • Preparing solutions: To make 1 litre of 1 mol/L NaOH, you dissolve 1 × 40.00 g = 40.00 g of NaOH in water.
  • Gas laws: The ideal gas law relates moles of gas to pressure, volume, and temperature (PV = nRT). Molar mass converts grams of gas to moles.
  • Pharmaceuticals: Drug doses are often specified in mg/kg of body weight; pharmacokinetic models use molar mass to convert between mass and molar concentrations in blood plasma.
  • Polymer chemistry: Polymers are characterised by their number-average and weight-average molar masses (Mn, Mw), which determine mechanical properties like tensile strength and viscosity.

Common atomic weights: quick reference

SymbolElementAt. Weight (g/mol)
HHydrogen1.008
CCarbon12.011
NNitrogen14.007
OOxygen15.999
FFluorine18.998
NaSodium22.990
MgMagnesium24.305
AlAluminum26.982
SiSilicon28.085
PPhosphorus30.974
SSulfur32.06
ClChlorine35.45
KPotassium39.098
CaCalcium40.078
FeIron55.845
CuCopper63.546
ZnZinc65.38
BrBromine79.904
IIodine126.904
PbLead207.2

Disclaimer

Atomic weights are IUPAC 2021 standard values. Elements with no stable isotopes (e.g., Tc, Pm, and all transuranic elements) use the mass number of the most stable or most commonly referenced isotope. Results are for standard conditions and are not adjusted for isotopic enrichment.