Hydrate Formula Calculator

Find the number of water molecules in a hydrate from mass before and after heating.

Chemistry and LabUpdated 2026-11-192 min read
Hydrate Formula Calculator
Use standard element capitalization, for example MgCO3 or CuCl2.
Mass of the hydrated sample.
Mass of the anhydrous salt after water is driven off.
Hydrate formula
...
Water molecules x...
Mass of water lost...
Percent water...
Moles of anhydrous salt...
Moles of water...
Salt molar mass...

What it does

A hydrate is a salt that has water molecules bound into its crystal structure. Heating drives that water off and leaves the anhydrous salt. The mass difference tells you how much water was present, and the mole ratio tells you how many water molecules belong to each formula unit.

This tool takes the anhydrous salt formula and the two measured masses. It computes the salt molar mass from a built in atomic weight table, converts both masses to moles, divides the moles of water by the moles of salt, and rounds to a whole number.

The page opens with a magnesium carbonate hydrate that weighs 15.67 grams before heating and 7.58 grams afterward. The water mass is 8.09 grams. That corresponds to roughly 0.449 moles of water and 0.0899 moles of magnesium carbonate, giving a ratio very close to five.

The result is written as MgCO3 with a dot followed by 5H2O. The tool also reports the percent water, which is a useful check against published hydrate compositions.

A ratio that is not close to a whole number means the measurement was inaccurate or the sample decomposed rather than simply losing water. The tool reports an error in that case instead of rounding a poor result.

How to use

  1. Enter the formula of the anhydrous salt with correct capitalization.
  2. Enter the mass of the hydrate before heating.
  3. Enter the mass after heating to constant mass.
  4. Read the hydrate formula as the main result.
  5. Check the moles of salt and water to follow the ratio.
  6. Compare the percent water with a literature value if available.

Formula

x = (mass lost / 18.015) divided by (anhydrous mass / molar mass of salt), rounded to a whole number
mass lost
Hydrate mass minus anhydrous mass, in grams.
18.015
Molar mass of water in grams per mole.
molar mass of salt
Formula mass of the anhydrous salt in grams per mole.
x
Number of water molecules per formula unit, a whole number.

The experiment assumes heating removes only water and leaves the salt unchanged. A ratio within 0.15 of an integer is accepted to allow ordinary weighing error. The built in atomic weight table covers common elements and is reported through the salt molar mass output.

Worked example

Example: a magnesium carbonate hydrate

The page opens with MgCO3, 15.67 g before heating and 7.58 g after.

  1. Water lost is 15.67 minus 7.58, which is 8.09 g.
  2. Molar mass of MgCO3 is about 84.313 g/mol.
  3. Moles of salt are 7.58 divided by 84.313, about 0.08990 mol.
  4. Moles of water are 8.09 divided by 18.015, about 0.44907 mol.
  5. Divide 0.44907 by 0.08990 to get about 4.995, which rounds to 5.
  6. The hydrate formula is MgCO3·5H2O, with 51.63 percent water.
  7. The tool reports formula MgCO3·5H2O and waters 5.

Reference table

Hydrate formulas from sample mass data
SaltBefore heating (g)After heating (g)xHydrate formula
MgCO315.677.585MgCO3·5H2O
CuCl22.51.9722CuCl2·2H2O
BaCl21.251.062BaCl2·2H2O

Limits

  • Assumes only water is lost during heating.
  • Supports elements in the built in atomic weight table only.
  • The anhydrous mass must be positive and no greater than the hydrate mass.
  • Ratios more than 0.15 from a whole number are rejected.

Common mistakes

  • Using the hydrate mass instead of the anhydrous mass to compute salt moles.
  • Forgetting to subtract to find the water mass.
  • Using 18.0 or 20.0 instead of 18.015 for water molar mass.
  • Entering a formula with lowercase element symbols.
  • Accepting a ratio of 4.5 as five without question.

Try it yourself

Quick checks. Answers sit tucked under each question.

CuCl2 hydrate: 2.5 g before and 1.972 g after. Formula?

CuCl2·2H2O. The mole ratio is about 2.

BaCl2 hydrate: 1.25 g before and 1.06 g after. Formula?

BaCl2·2H2O, with 15.20 percent water.

Why must the ratio be a whole number?

Water molecules occur as whole units in the crystal formula, so fractional values reflect measurement error.

Questions

What is a hydrate?

A salt with water molecules bound in its crystal structure in a fixed ratio.

Why heat to constant mass?

It ensures all the water has been driven off before the final weighing.

How is x found?

Divide moles of water lost by moles of anhydrous salt and round to a whole number.

What molar mass of water is used?

18.015 grams per mole.

What if the ratio is not near a whole number?

The tool reports an error because the data do not support a simple hydrate formula.

Can heating decompose the salt?

Yes, and that breaks the assumption. The tool cannot detect decomposition from two masses alone.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.