Molecular Weight Calculator
Enter any chemical formula - from simple compounds like H2O to complex hydrates like CuSO4*5H2O - and get the molar mass in g/mol along with the full elemental composition and percent-by-mass breakdown. Use parentheses for polyatomic groups, a dot or asterisk for hydrates, and choose from 20 common compound presets to get started quickly.
What is molecular weight and molar mass?
Molecular weight (or molecular mass) is the mass of a single molecule expressed in unified atomic mass units (u), where 1 u equals exactly 1/12 the mass of a carbon-12 atom. Molar mass is the mass of one mole (6.022 x 10^23 molecules) of a substance expressed in grams per mole (g/mol). The two values are numerically identical: water has a molecular weight of 18.015 u and a molar mass of 18.015 g/mol. Chemists use molar mass more often in practice because it connects the microscopic world of atoms to measurable laboratory quantities - if you need 1 mole of water you weigh out 18.015 grams.
How to write a chemical formula for this calculator
Use the standard IUPAC element symbols (one uppercase letter, optionally followed by one lowercase letter). Write subscript numbers directly after the symbol - H2O not H subscript 2. For polyatomic groups that repeat, use parentheses: Al2(SO4)3 means two aluminium atoms and three SO4 groups. For hydrates (compounds with water of crystallisation), use a dot, asterisk, or middle dot as the separator: CuSO4*5H2O or CuSO4.5H2O both work. Formulas are case-sensitive - Na is sodium, but NA is not recognised. If the calculator returns no result, check that each element symbol begins with an uppercase letter.
Step-by-step: how molar mass is calculated
The calculation follows three steps. First, parse the formula to find how many atoms of each element are present - for H2SO4 that is 2 hydrogen, 1 sulfur, and 4 oxygen. Second, multiply each element's count by its standard atomic weight from the IUPAC periodic table: 2 x 1.008 + 1 x 32.07 + 4 x 16.00 = 2.016 + 32.07 + 64.00 = 98.086 g/mol. Third, sum all contributions. This calculator uses the IUPAC 2021 standard atomic weights, which are the internationally agreed values used in research and industry.
Elemental composition and percent by mass
The percent composition of each element is its contribution to the molar mass divided by the total molar mass, multiplied by 100. For water (H2O, molar mass 18.015 g/mol): hydrogen is 2 x 1.008 / 18.015 x 100 = 11.19%, oxygen is 16.00 / 18.015 x 100 = 88.81%. This information is important in analytical chemistry for verifying a substance's identity (by comparing the calculated composition with values from elemental analysis instruments) and in stoichiometry for working out how much of each element a reaction produces or consumes. The composition panel in this calculator shows every element's atom count, mass contribution in g/mol, and percent by mass.
Common compounds and their molar masses
| Compound | Formula | Molar mass (g/mol) | Common use |
|---|---|---|---|
| Water | H2O | 18.015 | Solvent, reagent |
| Carbon dioxide | CO2 | 44.010 | Gas, dry ice |
| Sodium chloride | NaCl | 58.443 | Table salt |
| Ammonia | NH3 | 17.031 | Fertiliser, refrigerant |
| Sulfuric acid | H2SO4 | 98.079 | Industrial acid |
| Hydrochloric acid | HCl | 36.461 | Laboratory acid |
| Sodium hydroxide | NaOH | 39.997 | Base, soap making |
| Glucose | C6H12O6 | 180.156 | Energy metabolism |
| Sucrose | C12H22O11 | 342.297 | Table sugar |
| Ethanol | C2H5OH | 46.069 | Solvent, beverages |
| Methane | CH4 | 16.043 | Natural gas |
| Calcium carbonate | CaCO3 | 100.087 | Limestone, antacids |
| Aspirin | C9H8O4 | 180.159 | Analgesic |
| Copper sulfate | CuSO4*5H2O | 249.685 | Agriculture, lab reagent |
| Aluminum sulfate | Al2(SO4)3 | 342.151 | Water treatment |
Reference molar masses calculated from IUPAC 2021 standard atomic weights.
Frequently asked questions
What is the difference between molecular weight and molar mass?
Molecular weight is the mass of one molecule in unified atomic mass units (u or Da). Molar mass is the mass of one mole of molecules in grams per mole (g/mol). The numbers are equal: water is 18.015 u per molecule and 18.015 g/mol per mole. In everyday chemistry, "molar mass" is the more practical term because it connects directly to the grams you weigh on a balance.
How do I enter a formula with parentheses or brackets?
Use standard chemical notation. For groups that repeat, wrap them in parentheses followed by the count: Al2(SO4)3 for aluminium sulfate. Square brackets work the same way. For hydrates, separate the base formula from the water of crystallisation with a dot or asterisk: CuSO4*5H2O or CuSO4.5H2O.
What atomic weights does this calculator use?
The calculator uses IUPAC 2021 standard atomic weights, the internationally agreed values published by the International Union of Pure and Applied Chemistry. These are weighted averages over the naturally occurring isotopic abundances of each element.
How do I convert molar mass to molecules?
Multiply the number of moles by Avogadro's number (6.022 x 10^23 mol^-1). If you have 0.5 mol of water (molar mass 18.015 g/mol), the mass is 0.5 x 18.015 = 9.008 g, and the number of molecules is 0.5 x 6.022 x 10^23 = 3.011 x 10^23 molecules.
Can I calculate the molar mass of a polymer or large molecule?
Yes, as long as you know the molecular formula. For a polymer repeat unit such as polyethylene (CH2)n, enter the formula for the repeat unit (CH2) then multiply the result by the degree of polymerisation. This calculator handles any formula that can be expressed with standard element symbols and integer atom counts.
What is elemental percent composition and why does it matter?
Percent composition is each element's share of the molar mass expressed as a percentage. Chemists use it to verify a compound's identity by comparing the calculated values with results from combustion analysis or other elemental analysis techniques. A discrepancy between theoretical and measured composition suggests an impure sample or an incorrect formula.