Molar Mass Calculator

Enter any chemical formula to instantly calculate its molar mass (molecular weight) in g/mol, view an element-by-element breakdown, and see the percentage composition.

Quick compounds:
g/mol

Element Breakdown

Element Count Atomic Mass (u) Subtotal (g/mol) % Composition

What Is Molar Mass?

Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). One mole contains exactly 6.022 140 76 × 1023 particles (Avogadro's number), whether those particles are atoms, molecules, ions, or formula units.

For an element, the molar mass numerically equals its standard atomic weight listed on the periodic table. For a compound, you add up the molar masses of every atom in its chemical formula. For instance, water (H₂O) has a molar mass of approximately 18.015 g/mol because it contains two hydrogen atoms (2 × 1.008) and one oxygen atom (15.999).

The Mole Concept 1 Mole of Water 18.015 g Mass on a scale Number of Molecules O H H O H H O H H ... 6.022 x 10 23 molecules of H₂O (Avogadro's Number) 1 mole of any substance = 6.022 x 10²³ particles (Avogadro's number) Its mass in grams numerically equals its molar mass in g/mol.

Molar Mass vs. Molecular Weight vs. Formula Weight

These three terms are closely related but differ in subtle ways:

In practice, chemists often use "molecular weight" and "molar mass" interchangeably, because numerically they are the same. The key difference is that molar mass carries the unit g/mol, while molecular weight is dimensionless (relative to 1/12 the mass of a carbon-12 atom).

How to Calculate Molar Mass Step by Step

  1. Write the chemical formula. Identify every element and its subscript (count). If no subscript is written, the count is 1.
  2. Look up atomic masses. Find each element's standard atomic weight from the periodic table.
  3. Multiply. For each element, multiply its atomic mass by the number of atoms of that element in the formula.
  4. Handle parentheses. If the formula contains parentheses, multiply the count of each element inside by the subscript outside the parentheses.
  5. Add. Sum all the contributions to get the total molar mass in g/mol.

Worked Examples

Example 1: Water (H₂O)

H: 2 atoms × 1.008 g/mol = 2.016 g/mol
O: 1 atom × 15.999 g/mol = 15.999 g/mol
Total = 2.016 + 15.999 = 18.015 g/mol

Example 2: Sodium Chloride (NaCl)

Na: 1 atom × 22.990 g/mol = 22.990 g/mol
Cl: 1 atom × 35.453 g/mol = 35.453 g/mol
Total = 22.990 + 35.453 = 58.443 g/mol

Example 3: Carbon Dioxide (CO₂)

C: 1 atom × 12.011 g/mol = 12.011 g/mol
O: 2 atoms × 15.999 g/mol = 31.998 g/mol
Total = 12.011 + 31.998 = 44.009 g/mol

Example 4: Glucose (C₆H₁₂O₆)

C: 6 atoms × 12.011 g/mol = 72.066 g/mol
H: 12 atoms × 1.008 g/mol = 12.096 g/mol
O: 6 atoms × 15.999 g/mol = 95.994 g/mol
Total = 72.066 + 12.096 + 95.994 = 180.156 g/mol

Example 5: Sulfuric Acid (H₂SO₄)

H: 2 atoms × 1.008 g/mol = 2.016 g/mol
S: 1 atom × 32.065 g/mol = 32.065 g/mol
O: 4 atoms × 15.999 g/mol = 63.996 g/mol
Total = 2.016 + 32.065 + 63.996 = 98.077 g/mol

Example 6: Calcium Hydroxide (Ca(OH)₂)

The subscript 2 outside the parentheses applies to both O and H inside:
Ca: 1 atom × 40.078 g/mol = 40.078 g/mol
O: 2 atoms × 15.999 g/mol = 31.998 g/mol
H: 2 atoms × 1.008 g/mol = 2.016 g/mol
Total = 40.078 + 31.998 + 2.016 = 74.092 g/mol

Using the Periodic Table for Atomic Masses

Every element on the periodic table has a listed standard atomic weight, which is the weighted average mass of all naturally occurring isotopes of that element. For example, chlorine's atomic weight is 35.453 u because it is a mixture of about 75.8% chlorine-35 and 24.2% chlorine-37.

When calculating molar mass, always use the standard atomic weight (not the mass number of a single isotope) to get the most accurate result. The values used in this calculator follow the IUPAC-recommended standard atomic weights.

Percentage Composition from Molar Mass

Percentage composition tells you what fraction of a compound's total mass is contributed by each element. The formula is:

% Element = (atoms of element × atomic mass ÷ molar mass of compound) × 100%

For example, in water (H₂O, M = 18.015 g/mol):

Percentage composition is essential for converting between empirical and molecular formulas and for verifying the purity of a synthesized compound.

Applications of Molar Mass

Molar mass is one of the most fundamental quantities in chemistry. Here are its primary applications:

Table of Molar Masses of Common Compounds

Compound Formula Molar Mass (g/mol)
WaterH₂O18.015
Sodium chloride (table salt)NaCl58.443
Carbon dioxideCO₂44.009
GlucoseC₆H₁₂O₆180.156
Sulfuric acidH₂SO₄98.077
Sodium hydroxideNaOH39.997
Calcium carbonateCaCO₃100.087
AmmoniaNH₃17.031
Hydrochloric acidHCl36.461
Nitric acidHNO₃63.013
Acetic acidCH₃COOH60.052
EthanolC₂H₅OH46.069
MethaneCH₄16.043
Oxygen gasO₂31.998
Nitrogen gasN₂28.014
Calcium hydroxideCa(OH)₂74.092
Potassium permanganateKMnO₄158.034
Iron(III) oxide (rust)Fe₂O₃159.688
Magnesium sulfate (Epsom salt)MgSO₄120.366
Sucrose (table sugar)C₁₂H₂₂O₁₁342.297
Aspirin (acetylsalicylic acid)C₉H₈O₄180.159
Aluminum sulfateAl₂(SO₄)₃342.151
Sodium bicarbonate (baking soda)NaHCO₃84.007
Phosphoric acidH₃PO₄97.994

Frequently Asked Questions

What is the difference between molar mass and atomic mass?

Atomic mass (or atomic weight) refers to the mass of a single atom or the weighted average mass of an element's isotopes, expressed in atomic mass units (u or Da). Molar mass is the mass of one mole (6.022 × 1023 particles) of a substance expressed in g/mol. Numerically they are equal -- for example, oxygen has an atomic mass of 15.999 u and a molar mass of 15.999 g/mol -- but the units and scale differ.

How do I handle hydrates when calculating molar mass?

Hydrated compounds (e.g., CuSO₄·5H₂O) include water molecules of crystallization. To find the total molar mass, calculate the molar mass of the anhydrous salt, then add the molar mass of water multiplied by the number of water molecules. For CuSO₄·5H₂O: 159.609 + (5 × 18.015) = 249.684 g/mol.

Why do atomic masses on the periodic table have decimal values?

Most elements exist as a mixture of stable isotopes in nature. The atomic mass listed is a weighted average that reflects the natural abundance of each isotope. For example, chlorine is approximately 75.8% Cl-35 and 24.2% Cl-37, giving an average atomic mass of 35.453 u.

Can I use this calculator for polyatomic ions?

Yes. Enter the formula of the ion just as you would a molecule. For example, enter "SO4" for the sulfate ion to get its formula weight. Note that the mass of lost or gained electrons is negligible compared to the nuclear masses, so the formula weight is essentially the same as the ionic mass.

How accurate are the molar masses calculated here?

This calculator uses IUPAC-recommended standard atomic weights rounded to three decimal places for most elements. The results are accurate to approximately ±0.001 g/mol for simple formulas. For isotopically enriched or radioactive samples, you would need to use the specific isotopic mass instead.

What is Avogadro's number and why does it matter?

Avogadro's number (NA = 6.022 140 76 × 1023 mol-1) is the number of particles in exactly one mole. It serves as the bridge between the atomic scale (atomic mass units) and the laboratory scale (grams). Because of this definition, the molar mass of a substance in g/mol is numerically equal to its formula mass in atomic mass units.

How do I convert grams to moles using molar mass?

Use the formula: moles = mass (g) ÷ molar mass (g/mol). For example, 36.03 g of water ÷ 18.015 g/mol = 2.000 moles of water. Conversely, to convert moles to grams: mass = moles × molar mass.