🏆 US-Registered Digital Marketing Agency
Advertisement
Advertisement
CHEMISTRY

Molar Mass Calculator — formula to g/mol, with the element breakdown

Type any chemical formula, including brackets and hydrates, and get its molar mass and percent composition.

Case matters: Co is cobalt, CO is carbon monoxide. Brackets and a dot for hydrates both work.
Optional — the two boxes are independent, so you can read moles from a mass and mass from an amount at the same time.
Molar mass
0 g/mol
 
0
Atoms per formula unit
0
Distinct elements
0
Moles in your sample
0 g
Mass of your amount
Tip: if a symbol is rejected, check the capitalisation first. Mg is magnesium; MG is not an element at all, and neither is mg.
Advertisement

The molar mass calculator above takes a written chemical formula and returns the mass of one mole of that substance in grams per mole. It reads nested brackets, hydrate dots, subscript characters pasted from a document, and multi-letter element symbols, then adds up the standard atomic weight of every atom it finds. The number it gives you is the bridge between the two things a chemist can actually measure and count: mass on a balance, and amount in moles.

Arb Digital builds free calculators for people who need a specific answer without a login, an advert wall, or a download. This one exists because the arithmetic is trivial and the transcription is not — almost every molar mass error is a miscounted subscript inside a bracket, not a slipped decimal point. The parser here does the counting for you and shows its working, element by element, so you can check it rather than trust it.

What This Molar Mass Calculator Does

Enter a formula and the tool parses it into a count of each element, multiplies each count by that element's standard atomic weight, and sums the result. It reports the total in grams per mole, the number of atoms in one formula unit, how many distinct elements are present, and a percent-composition bar for every element so you can see at a glance which one dominates the mass.

Two optional boxes turn the molar mass into something you can weigh. Enter a sample mass in grams and the tool divides it by the molar mass to give the amount in moles. Enter an amount in moles and it multiplies to give the mass you would need to weigh out. Both run at once, so you never have to clear one to use the other.

Unknown symbols are rejected rather than ignored. If you type Xy, the tool tells you it does not recognise that symbol instead of quietly treating it as zero and handing back a confidently wrong number. That single behaviour is the difference between a calculator you can check homework with and one that will let a typo through.

One boundary worth stating plainly: our molar mass converter converts a molar mass you already know between units such as g/mol and kg/kmol. It cannot read a formula. This page does the opposite job — it derives the number in the first place.

How to Use It

  1. Type the formula exactly as written. Capital letter first, lowercase second: NaCl, Fe2O3, C6H12O6. Subscripts can be plain digits.
  2. Use brackets for repeating groups. Calcium phosphate is Ca3(PO4)2. Square and curly brackets work too, and they can be nested.
  3. Use a dot for hydrates. Copper(II) sulfate pentahydrate is CuSO4·5H2O. A full stop or an asterisk in place of the dot is accepted.
  4. Read the breakdown bars. Each bar shows one element's share of the total mass, which is the percent composition by mass.
  5. Add a mass or an amount to convert between grams and moles for that same substance without opening a second tool.

The Formula and How It Is Calculated

Molar mass is a straight weighted sum: M = Σ (nₓ × Aₓ), where n is the number of atoms of an element in one formula unit and A is that element's standard atomic weight in grams per mole. For water, that is 2 × 1.008 + 15.999 = 18.015 g/mol. For copper(II) sulfate pentahydrate it is 63.546 + 32.06 + (4 × 15.999) + 5 × 18.015 = 249.68 g/mol, which is the value printed on the bottle.

The atomic weights built into this tool are the standard atomic weights of the first 92 elements, the same conventional values published by IUPAC through the Commission on Isotopic Abundances and Atomic Weights and mirrored in the NIST atomic weights and isotopic compositions reference data. They are averages weighted by the natural isotopic abundance of each element, which is why chlorine is 35.45 rather than a whole number.

Advertisement

Why Chlorine Is 35.45 and Not 35

A single chlorine-35 atom has a mass number of 35, so students reasonably expect 35 g/mol. Natural chlorine is a mixture: roughly three quarters chlorine-35 and one quarter chlorine-37. The standard atomic weight is the abundance-weighted average of the isotopes as they occur in ordinary terrestrial material, so it lands between the two at 35.45.

This matters more than it looks. If you are doing ordinary bench chemistry with a reagent bottle, the average is exactly what you want, because the powder in the bottle contains that same isotopic mixture. If you are doing mass spectrometry and looking at a molecular ion peak, the average is the wrong number — a peak corresponds to one specific isotopic combination, so an analyst uses the monoisotopic mass instead. A chloride-containing molecule shows a characteristic pair of peaks two units apart in roughly a three to one ratio, which no averaged molar mass would ever predict. Use averaged molar mass for weighing, and monoisotopic mass for interpreting a spectrum.

Several elements have no stable isotopes and therefore no meaningful natural average. For technetium, promethium, polonium, astatine, radon, francium, radium and actinium the table here uses the mass number of the longest-lived or most commonly cited isotope, which is the convention IUPAC follows in square brackets. Treat those values as indicative rather than as a measured average.

How the Parser Reads a Formula

The parser walks the string one character at a time. A capital letter starts a new element symbol; any lowercase letters that immediately follow are absorbed into it, which is how Na stays sodium instead of becoming nitrogen followed by something unreadable. Digits after a symbol become its subscript. An opening bracket pushes a fresh tally onto a stack, and the closing bracket pops that tally, multiplies every count in it by the number that follows, and merges it into the level below. Because it is a stack, nesting works to any depth: K4[Fe(CN)6] resolves correctly without a special case.

Hydrate dots are handled by splitting the string first. Everything after a dot is parsed as its own formula and multiplied by the leading coefficient, so the 5 in a pentahydrate applies to the whole water unit rather than only to the hydrogen. That is the single most common hand-calculation mistake with hydrates, and it understates the answer by tens of grams per mole.

Subscript characters are normalised before parsing. If you paste a formula with true Unicode subscript digits from a document, they are converted to ordinary digits rather than rejected. Whitespace is ignored, so a formula copied with stray spaces still works.

Formula Unit, Molecule, and Why Salts Are Different

For a molecular substance like glucose, the formula describes a real, discrete molecule, and the molar mass is the mass of a mole of those molecules. For an ionic solid like sodium chloride, there is no NaCl molecule anywhere in the crystal — there is a lattice of alternating ions, and the formula simply gives the smallest whole-number ratio. The correct term is a formula unit, and the molar mass is the mass of a mole of those units.

The arithmetic is identical, which is why the distinction is often skipped. It stops being cosmetic when you calculate the number of dissolved particles. One mole of glucose dissolved in water gives one mole of particles. One mole of sodium chloride gives close to two moles of ions, and one mole of calcium chloride gives close to three. Anything that depends on particle count rather than mass — osmotic pressure, freezing-point depression, ionic strength — follows the ion count, not the formula-unit count.

Where Molar Mass Feeds Into Everything Else

Molar mass is the first step in most quantitative chemistry, not the destination. It converts a weighed mass to moles, which is the only currency stoichiometry accepts. From there it feeds the molarity calculator when you need a solution of known concentration, the moles to grams calculator when you are working in the other direction, and the percent yield calculator when you compare what you made to what the equation predicted.

It also underpins percent composition, which is how an empirical formula calculator works in reverse: measured mass percentages become mole ratios, and the smallest whole-number ratio becomes a formula. Comparing the empirical formula mass to a measured molar mass is what tells you whether a compound is CH2O or C6H12O6 — two substances with identical percent composition and very different chemistry.

Significant Figures and When the Third Decimal Matters

This tool prints molar mass to two decimal places, and the per-element contributions to more precision than most work needs. The honest limit is set by your atomic weights and by your balance, not by the calculator. A four-figure atomic weight table supports about four significant figures in the answer, and a balance reading to 0.01 g on a 2 g sample supports three. Carrying ten digits through a stoichiometry problem and then rounding at the end is fine; reporting ten digits is not.

Some elements genuinely have variable atomic weights depending on the source of the material. IUPAC now publishes intervals rather than single values for a group of light elements including hydrogen, lithium, boron, carbon, nitrogen, oxygen, silicon, sulfur and chlorine. The conventional single values used here are the ones recommended for exactly this purpose: routine calculation where the material's origin is unknown. If you need better than four figures on a light element, the provenance of your sample starts to matter. Our significant figures calculator is useful for keeping a reported result honest.

Need a different calculation?

Arb Digital publishes hundreds of free calculators across chemistry, maths, finance and marketing — no sign-up, no limits. If something you need is missing, tell us and we will look at building it.

Browse All Free Tools Suggest a Tool

Common Mistakes to Avoid

  • Applying a hydrate coefficient to only the first element — in a pentahydrate the 5 multiplies the whole water unit, adding about 90 g/mol, not 5 g/mol.
  • Ignoring capitalisation — CO is carbon monoxide at 28.01 g/mol and Co is cobalt at 58.93 g/mol. The parser cannot guess which you meant.
  • Missing a bracket subscript — Ca3(PO4)2 contains eight oxygens, not four. This is the single most frequent error in hand calculations.
  • Using mass numbers instead of atomic weights — rounding chlorine to 35 or copper to 64 shifts the answer by more than a percent, which will fail a titration check.
  • Confusing molar mass with relative molecular mass — the numeric value is the same, but molar mass carries g/mol while relative molecular mass is dimensionless.

Related Free Tools From Arb Digital

Turn a molar mass into a solution with the molarity calculator, convert between mass and amount with the moles to grams calculator, change the units of a known value with the molar mass converter, and check reaction efficiency with the percent yield calculator. For laboratory dilutions, the solution dilution calculator solves the dilution equation directly. The full free online tools hub lists everything else.

Frequently Asked Questions

What is molar mass?

Molar mass is the mass of one mole of a substance, expressed in grams per mole. It is calculated by adding the standard atomic weight of every atom in the formula, so water at 2 hydrogen plus 1 oxygen comes to 18.015 g/mol.

Is molar mass the same as molecular weight?

They share the same numeric value but not the same meaning. Molecular weight, more properly relative molecular mass, is a dimensionless ratio against the carbon-12 standard. Molar mass carries units of grams per mole and applies to ionic solids as well as molecules.

How do I enter a hydrate?

Write the anhydrous formula, a dot, the coefficient, then the water. A full stop or an asterisk works in place of the dot. The coefficient multiplies the entire water unit, which is what makes a pentahydrate about 90 g/mol heavier than the anhydrous salt.

Why does the calculator reject my formula?

Either a symbol is not a real element, or the capitalisation is wrong, or a bracket is unclosed. Element symbols always start with a capital letter and any following letters are lowercase, so sodium is Na and never NA or na.

Where do the atomic weights come from?

They are the conventional standard atomic weights published by IUPAC through the Commission on Isotopic Abundances and Atomic Weights, the same values mirrored in the NIST atomic weights reference data, covering the first 92 elements.

How do I get moles from a mass?

Divide the mass in grams by the molar mass in grams per mole. Enter the mass in the optional sample box and the calculator does it for you, showing the amount in moles alongside the molar mass.

What is percent composition by mass?

It is each element's share of the total molar mass, shown here as bars. In water, oxygen contributes 15.999 of 18.015 g/mol, so oxygen is about 88.8 percent of water by mass even though hydrogen supplies two thirds of the atoms.

This calculator is provided for education and general reference. It describes how molar mass is computed and is not laboratory or safety guidance; follow the procedures and risk assessments issued by your own institution.

Advertisement
Advertisement

Take it further