Molecular Weight Calculator
Enter a chemical formula and get its molecular weight in grams per mole, with a breakdown of each element's contribution.
Example
For glucose C6H12O6: 6 carbon (6 × 12.011) + 12 hydrogen (12 × 1.008) + 6 oxygen (6 × 15.999) = 72.066 + 12.096 + 95.994 = 180.16 g/mol.
How it works
Each element symbol is multiplied by its standard atomic weight and its subscript count; nested parentheses are expanded by multiplying the inner counts by the group's subscript. The sum of all element masses is the molar mass in g/mol.
Good to know
This Molecular Weight Calculator turns a typed chemical formula into its molar mass in grams per mole, then shows how each element contributes to the total. It is built for chemistry and biology students, lab technicians, and anyone who needs to convert between mass and moles without reaching for a periodic table and a calculator. You enter something like H2O, NaCl, or K3[Fe(CN)6] and the result updates as you type, entirely inside your browser.
Reach for it whenever you need to weigh out a reagent, prepare a solution of a known molarity, or check stoichiometry on a problem set. The molar mass it returns is the gram-per-mole figure you multiply by your desired number of moles to find the mass to weigh, or divide a measured mass by to find how many moles you have. The per-element breakdown is handy for spotting a mistyped subscript: if the carbon contribution looks too large for the formula you intended, the error is usually in your input.
To read the output, focus on three fields: the large molar mass value, the total atom count, and the number of distinct elements. The breakdown line lists each element with its rounded mass contribution. A few practical pointers:
- Capitalization matters because element symbols are case-sensitive: Co is cobalt, but CO is carbon plus oxygen.
- Subscripts after a closing bracket multiply everything inside, so Ca(OH)2 correctly counts two oxygens and two hydrogens.
- An unrecognized symbol or stray character produces an error message instead of a number, which tells you exactly where the formula is invalid.
One caveat worth knowing: the tool computes average molar mass from standard atomic weights, not the monoisotopic mass used in mass spectrometry, so a peak from an MS run will not match this figure exactly. It also does not interpret hydrates written with a dot (such as CuSO4·5H2O) or charge notation on ions, so enter the fully expanded atom counts if you need those included.
Frequently asked questions
Does it support parentheses and brackets?
Yes. Groups like Ca(OH)2 or K3[Fe(CN)6] are expanded correctly — the subscript after a closing bracket multiplies every atom inside the group, including nested groups.
Which atomic weights are used?
It uses standard IUPAC standard atomic weights (e.g. C = 12.011, O = 15.999, H = 1.008) for elements up to plutonium, so results match typical chemistry reference tables.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser. Your inputs never leave your device, and it works offline once loaded.
Is this calculator free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the difference between molecular weight and molar mass?
They are numerically identical for a given formula. Molecular weight (or molecular mass) is a relative figure with no units, while molar mass expresses that same number in grams per mole; this tool reports the value in g/mol.
How do I calculate the molecular weight of a compound by hand?
Multiply the count of each element by its standard atomic weight, then add all the products together. For example, water (H2O) is (2 × 1.008) + (1 × 15.999) = 18.015 g/mol.
How do I use molar mass to convert grams to moles?
Divide the mass in grams by the molar mass in grams per mole. For instance, 36 grams of water divided by 18.015 g/mol gives about 2 moles.
Why does capitalization matter in a chemical formula?
Element symbols are case-sensitive, so each starts with a capital letter optionally followed by a lowercase letter. CO means one carbon and one oxygen, while Co means a single cobalt atom, which is why mistyped case can produce a wildly different mass.
What is the molar mass of common compounds like water, glucose, and table salt?
Water (H2O) is about 18.02 g/mol, glucose (C6H12O6) is about 180.16 g/mol, and table salt (NaCl) is about 58.44 g/mol, based on standard atomic weights.
Can a molecular weight calculator handle hydrates or ions with charges?
This calculator parses neutral formulas with elements, subscripts, and brackets, but it does not read the dot notation in hydrates or charge symbols on ions. To include water of crystallization, enter the atoms in fully expanded form.
Why doesn't the calculated molecular weight match my mass spectrometry result?
Mass spectrometers measure monoisotopic mass from the most abundant isotope of each element, whereas this tool uses average atomic weights that blend all natural isotopes. The two values differ slightly, with the gap growing for larger molecules.
How accurate are the atomic weights used in the calculation?
The tool uses standard IUPAC atomic weights for elements up to plutonium, matching the values found in most chemistry reference tables. Results are rounded for display, so minor rounding differences from other sources are normal.
Related calculators