🔬Molecular Weight Calculator

Calculate the molecular weight (molar mass) of any chemical compound from its molecular formula. Supports parentheses, nested groups, and includes 30+ common chemical presets.

Prefer to skip the form? Scroll down and Ask AI Instead. Just describe your situation and let AI handle the math for you in seconds.

Molar Mass (g/mol)

18.015

Molar Mass (g/mol)18.015
Molar Mass (kg/mol)0.018015
FormulaH2O
Chemical NameWater
Total Atoms per Molecule3
Distinct Elements2
Element BreakdownH: 2 × 1.0080 g/mol = 2.0160 g/mol O: 1 × 15.9990 g/mol = 15.9990 g/mol
Mass PercentagesH: 11.19%, O: 88.81%

✦ Ask AI Instead

Molecular Weight Calculator (Molar Mass)

The molecular weight of a compound — also called its molar mass — is the mass of one mole of that substance, expressed in grams per mole (g/mol). It equals the sum of the atomic weights of all atoms in the molecular formula. Enter a molecular formula (e.g. Ca(OH)2 or C6H12O6) and the calculator will parse it, resolve each element's atomic weight, and return the molar mass with a full element breakdown.

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

Molar mass is one of the most-used quantities in quantitative chemistry. It bridges the gap between the atomic world (individual atoms and molecules) and the macroscopic world (grams that can be weighed on a balance). Any time you need to prepare a solution of known concentration, scale a reaction stoichiometrically, or convert between mass and moles, you need the molar mass of each compound involved.

How to Enter a Molecular Formula

Molecular formulas follow a strict notation that this calculator parses exactly:

  • Case-sensitive element symbols: Always start with an uppercase letter, optionally followed by lowercase letters (e.g. Ca not ca or CA).
  • Subscript numbers: Written as plain integers immediately after the element symbol or closing parenthesis. H2O means 2 hydrogen atoms; H2 without a second symbol means just hydrogen.
  • Parentheses with multipliers: Ca(OH)2 means one calcium plus two OH groups (two oxygen, two hydrogen). Nested parentheses are also supported.
  • No spaces or special characters: Enter only element symbols, numbers, and parentheses.

Formula Examples

FormulaCompoundMolar Mass (g/mol)
H2OWater18.015
NaClSodium chloride (table salt)58.44
C6H12O6Glucose180.16
Ca(OH)2Calcium hydroxide74.09
Al2(SO4)3Aluminium sulfate342.15
C12H22O11Sucrose (table sugar)342.30

Molar Mass vs Molecular Weight: What Is the Difference?

The terms "molar mass" and "molecular weight" are used interchangeably in most laboratory and educational contexts. Strictly speaking:

  • Molecular weight is a dimensionless ratio — the mass of one molecule of a substance relative to 1/12 the mass of a carbon-12 atom. It is expressed in unified atomic mass units (u or Da).
  • Molar mass is the mass of one mole (6.022 × 10²³ molecules) of a substance, expressed in g/mol.

Numerically, the values are identical — water has a molecular weight of 18.015 and a molar mass of 18.015 g/mol. The distinction matters primarily in precise analytical chemistry and mass spectrometry.

The Hill System for Formula Display

Results are displayed in Hill order: carbon atoms first, hydrogen atoms second, then all remaining elements in alphabetical order. This is the standard convention used in chemistry databases (including Chemical Abstracts, PubChem, and ChemSpider) and scientific publications. For compounds that contain no carbon, all elements are listed alphabetically.

Applications of Molar Mass Calculations

  • Solution preparation: To make 1 L of 0.1 M NaCl (molar mass 58.44 g/mol), dissolve 0.1 × 58.44 = 5.844 g in water and dilute to 1 L.
  • Stoichiometry: Balancing chemical equations requires knowing the molar mass of each reactant and product to calculate theoretical yields.
  • Mass percent composition: The molar mass allows calculation of what percentage of the compound's mass comes from each element.
  • Limiting reagent: To find which reactant runs out first, compare the number of moles (mass ÷ MW) of each reactant relative to the stoichiometric ratios.

Frequently Asked Questions

What is molar mass and why does it matter in chemistry?

Molar mass is the mass of one mole (6.022 × 10²³ particles) of a substance, expressed in grams per mole. It is the conversion factor between the atomic world (individual atoms and molecules) and the macroscopic world (grams you can weigh). Any time you need to count molecules — for a chemical reaction, a solution, or a laboratory procedure — you convert between grams and moles using the molar mass.

How do I calculate the molecular weight of a compound manually?

Add up the atomic masses of every atom in the molecular formula. For H₂SO₄: hydrogen is 1.008, so 2 × 1.008 = 2.016; sulfur is 32.06; oxygen is 15.999, so 4 × 15.999 = 63.996. Total: 2.016 + 32.06 + 63.996 = 98.07 g/mol. This calculator does this automatically for any formula including those with parentheses and nested groups.

What is the difference between empirical formula and molecular formula?

An empirical formula shows the simplest integer ratio of elements in a compound. A molecular formula shows the actual number of each atom. Glucose has the molecular formula C₆H₁₂O₆ but the empirical formula CH₂O — the simplest 1:2:1 carbon-hydrogen-oxygen ratio. The molecular weight of the empirical formula (CH₂O = 30.03 g/mol) multiplied by 6 gives the molecular weight of glucose (180.16 g/mol).

Why are the atomic weights in the periodic table not whole numbers?

Atomic weights are averages weighted by the natural abundance of each element's isotopes. Carbon-12 has a mass of exactly 12 u, but natural carbon contains about 1.1% carbon-13 (mass 13 u), giving an average atomic weight of 12.011. Chlorine exists as roughly 75% Cl-35 and 25% Cl-37, resulting in an average atomic weight of 35.45. This is why the periodic table shows decimal values rather than whole numbers.

How do I use molar mass to prepare a molar solution?

To prepare a 1 M (molar) solution: calculate moles needed = molarity × volume in litres, then mass needed = moles × molar mass. Example: 0.5 L of 2 M NaOH (molar mass 40.00 g/mol). Moles = 2 × 0.5 = 1 mol. Mass = 1 × 40.00 = 40.0 g. Dissolve 40.0 g of NaOH in distilled water and dilute to exactly 0.5 L in a volumetric flask.

What does "molar mass" mean for ionic compounds like NaCl?

Ionic compounds do not exist as discrete molecules — NaCl is a repeating crystal lattice of sodium and chloride ions. The "molar mass" of an ionic compound is technically the formula mass: the sum of atomic masses for one formula unit. For NaCl: 22.99 (Na) + 35.45 (Cl) = 58.44 g/mol. This is the mass of one mole of NaCl formula units, which contains one mole of Na⁺ ions and one mole of Cl⁻ ions.

Can this calculator handle hydrates like CuSO₄·5H₂O?

Hydrates with the dot notation (CuSO₄·5H₂O) may not parse correctly depending on the implementation. To enter a hydrate, you can typically expand it to a single formula: CuSO₄ plus 5 water molecules becomes CuSO9H10 — no, the correct expansion is Cu1S1O4 plus 5×H2O = CuSO4(H2O)5 or written as CuS1O9H10. For copper(II) sulfate pentahydrate: Cu + S + 4O + 5×(2H + O) = CuSH10O9. Verify the result against the known value of 249.69 g/mol.