Molecular Weight Calculator
Enter a chemical formula to calculate average molar mass, element counts, mass contributions and percent composition.
Molecular-weight formula
Average molar mass = Σ(element count × atomic weight).
Mass percent for an element equals its mass contribution divided by the total molar mass, multiplied by 100. Moles equal sample mass in grams divided by molar mass in g/mol; mass equals moles multiplied by molar mass.
Scope: values use conventional average atomic weights, so natural isotopic composition is assumed. Elements without a standard atomic weight use a representative isotope mass number. The parser supports integer subscripts, nested (), [] or {}, and hydrate separators “·” or “.”. It does not interpret charges, electron notation, isotopic labels, fractional stoichiometry, structural formulas or ambiguous abbreviations.
Eight checked examples
| Formula | Compound | Calculated average molar mass |
|---|---|---|
| H2O | Water | 18.015 g/mol |
| NaCl | Sodium chloride | 58.440 g/mol |
| C6H12O6 | Glucose | 180.156 g/mol |
| Ca(OH)2 | Calcium hydroxide | 74.092 g/mol |
| Al2(SO4)3 | Aluminum sulfate | 342.131 g/mol |
| (NH4)2CO3 | Ammonium carbonate | 96.086 g/mol |
| K4[Fe(CN)6] | Potassium ferrocyanide formula unit | 368.346 g/mol |
| CuSO4·5H2O | Copper(II) sulfate pentahydrate | 249.677 g/mol |
How to use the calculator
- Enter element symbols with correct capitalization: Co is cobalt, while CO contains carbon and oxygen.
- Place integer subscripts after an element or closing group. Use parentheses or brackets for repeated groups.
- For hydrates, separate components with a middle dot or period and place the coefficient before the hydrate component.
- Select mass-to-moles or moles-to-mass only when a sample conversion is needed; otherwise leave formula mass selected.
- For analytical work, confirm whether an isotope-specific mass, reagent assay, hydration state or purity correction is required.
Atomic-weight references and limits
The calculator uses commonly published conventional atomic weights consistent with reference tables from the Commission on Isotopic Abundances and Atomic Weights and NIST. Atomic weights can be intervals in natural materials, and isotope-specific work requires isotope masses rather than these averaged values.
- Maximum formula length: 200 characters after spaces are removed.
- Maximum nesting depth: 12 groups.
- Each integer multiplier must be from 1 to 1,000,000.
- Total atom count must not exceed 100,000,000 per formula unit.
Related calculators
- Molarity and Concentration Calculator for solution preparation from mass and volume.
- Ideal Gas Law Calculator for PV=nRT pressure, volume, amount and temperature.
- Dilution Calculator for C₁V₁=C₂V₂ and serial dilutions.
- Scientific Notation Calculator for very large or small results.
- Percentage Calculator for general percentage calculations.
- Percent Yield Calculator