Skip to main content
Best Answer Hub logo Best Answer Hub.
Back to Playbooks
Best Answer Hub Playbooks · Chemistry
Add up the atoms

How to Calculate the Molar Mass of Any Formula

Molar mass is just the sum of the atomic weights of every atom in a formula, in grams per mole. The arithmetic is easy; the part that trips people up is reading the formula correctly, counting inside parentheses and remembering the water in a hydrate. Here is how the calculation works, where the atomic weights come from, and the traps to avoid.

Parsesubscripts, parentheses
Sumatomic weights
ExactIUPAC data
18.015
g/mol, the molar mass of water
IUPAC / CIAAW
6.022×1023
entities in one mole (Avogadro number)
NIST
2024
the current IUPAC standard atomic weights
CIAAW
100%
computed in your browser, nothing uploaded
no upload

The molar mass of a compound is the sum of the standard atomic weights of every atom in its formula, each multiplied by how many times it appears, expressed in grams per mole. For water, that is two hydrogens at 1.008 plus one oxygen at 15.999, which is 18.015 g/mol. The Best Answer Hub Molecular Weight Calculator parses the formula, adds up the atoms using current IUPAC atomic weights, and shows the breakdown, all in your browser.

This guide covers how molar mass is calculated, how a formula with parentheses and waters of hydration is read, where the atomic weights come from, how molar mass converts grams to moles, and how it differs from the monoisotopic mass used in mass spectrometry. The tool sits in the Best Answer Hub Calculators hub STEM suite, is built and maintained by Shahbaz Ali Malik, and stays free because Best Answer Hub is funded by optional paid assessments rather than advertising.

Start here

What is the Best Answer Hub Molecular Weight Calculator?

The Best Answer Hub Molecular Weight Calculator is a free, browser-based chemistry tool that computes the molar mass of any chemical formula instantly. Enter a formula like H2O, Ca(NO3)2, or CuSO4·5H2O and it shows a step-by-step element breakdown with percent composition, plus a built-in grams-to-moles converter. Every calculation runs in your browser using standard IUPAC atomic weights, with no signup and nothing uploaded.

  • 1
    Parses real formulas. Subscripts, parentheses like Ca(NO3)2, and hydrates like CuSO4·5H2O are all read correctly.
  • 2
    Shows the work. A per-element breakdown and percent composition, not just a single number.
  • 3
    Grams to moles built in. Convert a measured mass into an amount of substance in one step.
The method

How is molar mass calculated?

You add up the atomic weight of every atom in the formula. IUPAC defines molar mass as mass divided by amount of substance, and in practice you compute it as the sum of each element's standard atomic weight times the number of atoms of that element (IUPAC Gold Book). Water is the simplest case, and a compound with parentheses like calcium hydroxide shows why counting carefully matters.

Water, worked out
H2O = 2 x H(1.008) + 1 x O(15.999) = 2.016 + 15.999 = 18.015 g/mol

Atomic weights from IUPAC / CIAAW abridged standard values. Source: IUPAC Gold Book; CIAAW.

Ca(OH)2Atomic weightCountSubtotal
Calcium (Ca)40.078140.078
Oxygen (O)15.999231.998
Hydrogen (H)1.00822.016
Total74.09 g/mol
The tricky bit

Reading the formula: subscripts, parentheses, and hydrates

The arithmetic is easy; parsing the formula is where mistakes happen. A subscript counts the atoms of the element before it, a multiplier after a parenthesis applies to everything inside, and a center dot joins a hydrate with its own multiplier. IUPAC notes that enclosing marks like parentheses are used "to avoid ambiguity," and that addition compounds such as hydrates are written as separate constituents "separated by centre dots" (IUPAC, Principles of Chemical Nomenclature).

NotationExampleHow to read it
SubscriptH2O2 hydrogen, 1 oxygen
ParenthesesCa(OH)2The 2 applies to O and H: 1 Ca, 2 O, 2 H
Hydrate (center dot)CuSO4·5H2OAdd five whole water molecules
How a formula with parentheses is parsed
Ca(OH)2 the formula 1 Ca · 2 O · 2 H the 2 applies inside the parentheses 74.09 g/mol

A parser must apply the multiplier after a parenthesis to every atom inside it. Miscounting here is the most common molar-mass error.

Forgetting that the 2 in Ca(OH)2 doubles both the oxygen and the hydrogen, or dropping the five waters in a hydrate, is the classic slip. The Best Answer Hub Molecular Weight Calculator parses these correctly, so you get 74.09 g/mol for calcium hydroxide without hand-counting.

The data

Where do the atomic weights come from?

From IUPAC, which publishes the standard atomic weights that every molar-mass calculation depends on. The Commission on Isotopic Abundances and Atomic Weights (CIAAW) sets these values from the natural isotopic composition of the elements and revises them periodically, with the current table dated 2024 (CIAAW). Because a molar mass is only a lookup of these weights plus arithmetic, a browser tool is exactly as accurate as a server one, as long as it uses current values.

ElementStandard atomic weight
Hydrogen (H)1.008
Carbon (C)12.011
Nitrogen (N)14.007
Oxygen (O)15.999

These are the abridged conventional values; IUPAC lists some elements as an interval because their isotopic mix varies in nature, but the abridged figures are what most calculations use. The Best Answer Hub Molecular Weight Calculator uses current IUPAC atomic weights so the totals match a textbook.

The point of it

Molar mass in practice: grams, moles, and molarity

Molar mass is the bridge between a mass you can weigh and an amount of substance you can react. It is the conversion factor between grams and moles, so you divide a mass in grams by the molar mass to get moles, and multiply to go back (Chemistry LibreTexts). One mole is a fixed count of particles, exactly 6.02214076 times ten to the 23rd since the 2019 SI redefinition (NIST).

That single conversion sits under most of quantitative chemistry: measuring out a reactant for a reaction, preparing a solution to a target molarity, and working through stoichiometry. The Best Answer Hub Molecular Weight Calculator includes a grams-to-moles converter alongside the molar mass, so the number is ready to use, not just to read.

A common mix-up

Average vs monoisotopic mass: which one is this?

Molar mass and molecular weight are the average mass, computed from standard atomic weights that reflect the natural mix of isotopes. That is different from the monoisotopic mass used in mass spectrometry, which uses only the single most abundant isotope of each atom, because a mass spectrometer measures individual molecules rather than a statistical average. The two can differ enough to matter: the monoisotopic masses of nitrogen gas and ethylene are 28.006 and 28.032 daltons, which the average mass alone cannot separate.

Which number you want

For weighing out reagents, preparing solutions, and coursework, you want the average molar mass in g/mol, which is what the Best Answer Hub Molecular Weight Calculator returns. Monoisotopic mass is a mass-spectrometry quantity, useful only when identifying individual molecules by their exact isotope masses.

Why this one

How is Best Answer Hub different from other calculators?

The difference is that it actually parses the formula and shows the work. Some tools only look up known compounds; the Best Answer Hub Molecular Weight Calculator reads an arbitrary formula, including parentheses and hydrates, breaks down each element with its percent composition, and converts grams to moles. It uses current IUPAC atomic weights and runs entirely in your browser.

What you getBest Answer HubTypical tool
Parses parentheses and hydratesYesVaries
Per-element and percent breakdownYesSometimes
Grams-to-moles converterBuilt inOften separate
Signup or lookup-onlyNone, parses any formulaSome are lookup-only
Add up the atoms instantly

Try the free Molecular Weight Calculator

Enter any formula, including parentheses and hydrates, and get the molar mass, percent composition, and grams-to-moles. No signup, in your browser.

Open the Molecular Weight Calculator
Good questions

Frequently asked questions about molar mass

What is the Best Answer Hub Molecular Weight Calculator?
The Best Answer Hub Molecular Weight Calculator is a free, browser-based chemistry tool that computes the molar mass of any chemical formula. Enter a formula like H2O or CuSO4·5H2O and it shows a per-element breakdown, percent composition, and a grams-to-moles converter, using current IUPAC atomic weights, with nothing uploaded.
How do you calculate molar mass?
Add up the standard atomic weight of every atom in the formula, each multiplied by how many times it appears. Water is 2 times 1.008 plus 15.999, which is 18.015 g/mol. The Best Answer Hub Molecular Weight Calculator parses the formula and does this sum instantly, showing the contribution of each element.
What is the molar mass of water?
18.015 grams per mole. It is two hydrogen atoms at 1.008 each plus one oxygen at 15.999, which sums to 18.015. The Best Answer Hub Molecular Weight Calculator returns this with the per-element breakdown, so you can see exactly where the number comes from rather than just trusting it.
What is the difference between molar mass and molecular weight?
In practice they are the same number and used interchangeably. Molecular weight is technically a dimensionless ratio, while molar mass carries units of grams per mole, but the value is identical. The Best Answer Hub Molecular Weight Calculator returns g/mol, the unit used in stoichiometry and solution preparation.
How do I calculate molar mass with parentheses?
Apply the number after the parenthesis to every atom inside it. In Ca(OH)2, the 2 doubles both the oxygen and the hydrogen, giving 1 Ca, 2 O, and 2 H, which sums to 74.09 g/mol. The Best Answer Hub Molecular Weight Calculator handles this parsing automatically so nothing is miscounted.
How do I handle waters of hydration?
A hydrate is written with a center dot, and you add the full water molecules to the total. In CuSO4·5H2O, that is five extra water molecules on top of the copper sulfate. The Best Answer Hub Molecular Weight Calculator reads the center dot and includes the hydration water, which is a common source of error by hand.
Where do the atomic weights come from?
From IUPAC, specifically its Commission on Isotopic Abundances and Atomic Weights, which sets the standard atomic weights from the natural isotopic composition of the elements and revises them periodically. The Best Answer Hub Molecular Weight Calculator uses current IUPAC values, so its totals match a modern textbook.
Why is carbon 12.011 and not exactly 12?
Because the standard atomic weight is an average over the natural mix of carbon isotopes, mostly carbon-12 with some carbon-13, which pulls the value slightly above 12. Only pure carbon-12 is exactly 12. The Best Answer Hub Molecular Weight Calculator uses the IUPAC average, 12.011, which is what chemistry calculations expect.
What is a mole?
A mole is a fixed count of particles, exactly 6.02214076 times ten to the 23rd since the 2019 SI redefinition. Molar mass links that count to a mass in grams, so one mole of a substance weighs its molar mass in grams. The Best Answer Hub Molecular Weight Calculator uses this to convert grams to moles.
How do I convert grams to moles?
Divide the mass in grams by the molar mass in grams per mole. For example, 36.03 grams of water divided by 18.015 g/mol is 2 moles. The Best Answer Hub Molecular Weight Calculator has a built-in grams-to-moles converter, so once it computes the molar mass you can convert a measured mass in one step.
What is the difference between average and monoisotopic mass?
Average mass, which is the molar mass, uses the natural mix of isotopes. Monoisotopic mass uses only the single most abundant isotope of each atom and is used in mass spectrometry. The Best Answer Hub Molecular Weight Calculator returns the average molar mass, which is what stoichiometry and lab work need.
Can it show percent composition?
Yes. The Best Answer Hub Molecular Weight Calculator shows the percent by mass of each element in the formula alongside the molar mass. This is useful for checking purity, understanding a compound, and coursework questions that ask for the mass percent of a given element.
Can I enter a compound by name?
You can enter a chemical formula directly, and the Best Answer Hub Molecular Weight Calculator also accepts common names for many compounds. Entering the formula is the most reliable way, since it removes any ambiguity about which substance you mean, and the tool then parses and sums it exactly.
Is my data uploaded to a server?
No. The Best Answer Hub Molecular Weight Calculator runs entirely in your browser, so the formulas you enter never leave your device. The calculation is a lookup of atomic weights plus arithmetic, which needs no server, and there is no signup, consistent with how every Best Answer Hub tool is built.
Is the Molecular Weight Calculator free?
Yes. The Best Answer Hub Molecular Weight Calculator is completely free with no usage limits, no watermarks, and no signup. It stays free because Best Answer Hub is funded by optional paid assessments rather than advertising, so it carries no ads and never gates a result behind an upgrade.
People also read

Keep going

Sources

More free calculators: Calculators hub, Number Base Converter, Unit and Currency Converter, and all free tools.

Built & maintained by Shahbaz Ali Malik Last updated: