Molecular Weight Calculator

—
—
—
—

Molecular Weight Calculator Features

A real formula parser

Not a lookup table: element symbols, numeric subscripts and bracket levels are parsed recursively, so nested formulas such as Ca(OH)2 and K4[Fe(CN)6] expand correctly

Hydrates and leading coefficients

The hydrate dot can be written as ., *, or the interpunct, and leading coefficients like 5H2O are multiplied into every atom so crystal water is never missed

Three totals in one view

Molar mass (g/mol), total atoms per formula unit and the number of distinct elements appear together, ready for solution preparation or formula checks

Per-element mass fractions

Each element is listed with atom count, atomic weight, contributed mass and mass fraction, directly usable for elemental analysis or batch calculations

All 118 elements covered

Standard atomic weights from H through Og are built in; radioactive elements use the mass number of their most stable isotope, so obscure elements need no manual lookup

Fully local calculation

Results update as you type with no network requests, so formulas and recipes never leave your device; Enter and one-click example chips are supported

How to Use the Molecular Weight Calculator

1

Type a formula

Enter it the way you would write it, for example H2O, NaCl or Ca(OH)2. Element symbols are case-sensitive; a number after an element or bracket is its count. Results refresh as you type.

2

Handle advanced notation

Brackets (), [] and {} can nest; hydrates use a dot (·, ., or *); an overall coefficient goes first, as in 5H2O or 2Al2(SO4)3. The example chips below fill the input for you.

3

Read the molar mass

The first card shows molar mass in g/mol, numerically equal to relative molecular mass. Paste it into the M field of our molarity calculator when preparing a solution.

4

Review the element breakdown

The expanded form shows atom counts after multiplication; the table lists atomic weight, contributed mass and mass fraction for checking the share of any element

Where the Molecular Weight Calculator Helps

Preparing lab solutions

Get 249.677 g/mol for CuSO4·5H2O, then use the molarity calculator to weigh out a 0.1 mol/L solution

Homework and exam checks

After hand-computing Ca(OH)2 or K4[Fe(CN)6], verify that every bracket and subscript was multiplied correctly

Element mass fraction checks

Find the percentage of a given element in fertilizers, minerals or complexes straight from the breakdown table

Reagent labels and recipes

Bottles come in anhydrous and hydrate grades; compare CuSO4 with CuSO4·5H2O to see how much the molar mass differs

Validating scripts and spreadsheets

Produce a set of reference values before writing an Excel template or batch script, confirming your own atomic weight table

Teaching material

Demonstrate in class how hydrate parts add and bracketed groups multiply; the expanded form and table are ready to screenshot for slides

Molar Mass and Chemical Formula Basics

Molar mass vs relative molecular mass

Molar mass M is the mass per unit amount of substance, usually in g/mol; relative molecular mass Mr is a dimensionless ratio to 1/12 of the mass of a ¹²C atom. They share the same numerical value but differ in dimension. For ionic compounds such as NaCl the strict term is formula mass; this tool computes per formula unit, so both cases work.

Why atomic weights have decimals

Standard atomic weights are abundance-weighted averages of natural isotopes: Cl is 35.45 (about 75.8% ³⁵Cl and 24.2% ³⁷Cl) and C is 12.011. That is why NaCl comes out as 58.440 rather than 58. Radioactive elements have no stable isotopic composition and are usually quoted at the mass number of their most stable isotope, which this tool follows.

Brackets and subscript multiplication

A subscript outside a bracket multiplies every atom inside: Ca(OH)2 has 1 Ca, 2 O and 2 H. Brackets may nest; in K4[Fe(CN)6] the square brackets contain Fe(CN)6 and the outer coefficient applies to the whole group, giving 4 K, 1 Fe, 6 C and 6 N. Parsing expands from the inside out.

How crystal water is counted

CuSO4·5H2O means five water molecules accompany each copper sulfate unit. The dot means addition, not multiplication, so molar mass = 159.602 + 5 × 18.015 = 249.677 g/mol. Weighing a hydrate reagent while using the anhydrous value 159.602 makes the actual concentration far too low, one of the most common solution-prep errors.

What mass fraction means

An element's mass fraction is its total mass in the formula divided by molar mass × 100%; in H2O, hydrogen is 2.016/18.015 ≈ 11.19%. It describes mass share, not atom share: hydrogen is 2 of 3 atoms but only about 11% of the mass. Fertilizer grades, ore assays and elemental analysis all use mass fraction.

Common Molar Masses (matching this tool's output)

FormulaNameM (g/mol)Note
H2OWater18.015Most common solvent
NaClSodium chloride58.440Saline baseline
NaOHSodium hydroxide39.997Strong base, hygroscopic
HClHydrogen chloride36.458Solute of hydrochloric acid
H2SO4Sulfuric acid98.072Diprotic strong acid
C6H12O6Glucose180.156Monosaccharide
CuSO4·5H2OCopper(II) sulfate pentahydrate249.677Hydrate, not 159.602
CaCO3Calcium carbonate100.086Formula mass near 100
Values are computed from the same standard atomic weight table used by this tool and shown to three decimals. Always use the hydrated formula for hydrated reagents, or prepared concentrations will be systematically low.

Molecular Weight Calculator FAQ

Q: Why does my textbook answer differ slightly?
A: Most likely a different atomic weight table. This tool uses IUPAC conventional values (Cl 35.45, C 12.011, Cu 63.546), while many textbooks round to Cl 35.5, C 12 or Cu 64 for hand calculation. The difference is usually a few parts per thousand; follow your textbook in class, and use the tool or the reagent label in the lab.
Q: How do I enter hydrates, dots and leading coefficients?
A: Use ·, ∙, •, . or * for the hydrate dot: CuSO4·5H2O and CuSO4.5H2O are equivalent. Put an overall coefficient at the very front, as in 5H2O or 2Al2(SO4)3. The dot means addition, so five water molecules are added as a group and the 5 multiplies every atom inside the water.
Q: Which brackets are supported, and can they nest?
A: Round (), square [] and curly {} brackets are supported and may nest, for example K4[Fe(CN)6] or Ca(OH)2. A number after a bracket multiplies all atoms inside. Unmatched brackets, extra closing brackets or unrecognized characters produce a clear message under the input.
Q: Can it handle ionic compounds and mixtures?
A: Ionic compounds such as NaCl and CaCO3 have no discrete molecules, but formula mass per formula unit works exactly the same and the g/mol value is valid for solution prep. Mixtures such as air or alloys have no single formula; compute each component separately and weight them by proportion.
Q: Why is mass fraction different from atom fraction?
A: Because atoms have different masses. In H2O, hydrogen is 2 of 3 atoms but contributes only 2.016 g/mol out of 18.015, about 11.19%, while the single oxygen accounts for roughly 88.81%. Fertilizer grades, ore assays and elemental analysis all report mass fraction, which is what the breakdown table shows.
Q: How do I use the result to prepare a solution?
A: Paste it into the molar mass M (g/mol) field of our molarity calculator, then enter target concentration c and volume V to get the mass to weigh: m = c·V·M. Watch the units: with V in litres the result is directly in grams; with mL divide by 1000, or simply use the L/mL switch.
Q: Is my formula uploaded anywhere?
A: No. Parsing and calculation run entirely in your browser with JavaScript; there is no backend endpoint, no network request and no stored history. Refreshing clears the input, so unpublished recipes and exam questions are safe to enter.