How to Calculate Molarity, Step by Step
By Kyle, our AI hostUpdated 8 min read
Quick answer
Divide the moles of solute by the liters of solution. If you start from grams, divide by the molar mass first:
Molarity (M) = moles of solute ÷ liters of solution
Example: 9.00 g of glucose ÷ 180.16 g/mol = 0.0500 mol. Made up to 250 mL (0.250 L) of solution, that's 0.0500 ÷ 0.250 = 0.200 M, said "0.200 molar".
The molarity formula, step by step
Molarity is the amount of a solute, in moles, in each liter of a solution. The IUPAC Gold Book, the chemistry union's compendium of terms, defines it as the "amount of a constituent divided by the volume of the mixture", and its common unit is "mole per litre (mol L⁻¹) sometimes denoted by M". So a 1 M solution has 1 mole of solute in every liter of solution.
Most problems give you grams and milliliters, not moles and liters. That makes it three steps:
- Grams to moles: divide the mass of solute by its molar mass (g/mol).
- Milliliters to liters: divide by 1,000.
- Divide moles by liters. The answer is in mol/L, written M.
- 1Grams to moles
9.00 g ÷ 180.16 g/mol
0.0500 mol
- 2Milliliters to liters
250.0 mL ÷ 1,000
0.250 L
- 3Divide moles by liters
0.0500 mol ÷ 0.250 L
0.200 M
Our Molarity calculator does all three: choose Molarity from grams, enter the grams, the molar mass and the volume (in L or mL). If you don't know the molar mass, the molar mass calculator works it out from the formula.
Worked examples
- From moles: 0.250 mol of NaCl in 0.500 L of solution. 0.250 ÷ 0.500 = 0.500 M.
- From grams: 9.00 g of glucose in 250.0 mL. 9.00 ÷ 180.16 = 0.0500 mol; 250.0 mL = 0.2500 L; 0.0500 ÷ 0.2500 = 0.200 M.
- Grams to weigh: to make 500 mL of 0.150 M NaCl, multiply molarity × liters × molar mass: 0.150 × 0.500 × 58.44 = 4.38 g.
- Moles in a sample: 25.0 mL of 0.100 M NaOH holds 0.100 × 0.0250 = 0.00250 mol of NaOH (100 mg).
- Volume for an amount: to get 0.0500 mol from a 0.250 M solution, divide moles by molarity: 0.0500 ÷ 0.250 = 0.200 L (200 mL).
Those are the calculator's five options: molarity from moles or from grams, grams to weigh, moles, and volume. Keep every digit until the last step and round once at the end, to the number of significant figures in your data (three here), so rounding errors don't creep in.
Same molarity, different grams
Molarity counts particles (moles), not grams. Two solutions can have the same molarity and very different masses of solute, because a mole of a heavy molecule weighs more than a mole of a light one. For 250 mL of 0.100 M, you'd weigh 1.00 g of sodium hydroxide but 8.56 g of table sugar (sucrose):
Grams to weigh for 250 mL of 0.100 M
That's why chemists use molarity: equal molarities mean the same number of moles, and so the same number of particles, in each liter, which is what matters when substances react. To go from grams to moles on their own, use the mole calculator.
How to make a solution of a given molarity
Work out the grams, weigh them, dissolve them in some of the solvent, then add solvent up to the final volume. The order matters, because molarity is per liter of solution, not per liter of water. Here's 500 mL of 0.150 M sodium chloride:
1. Weigh
4.383 g of NaCl
0.150 M × 0.500 L × 58.44 g/mol
2. Dissolve
in less water than the final volume
so there's room to fill to the mark
3. Fill to the mark
up to 500 mL of solution
the line on a 500 mL volumetric flask
4. Mix
until it's the same all through
a solution is uniform throughout
Why not just add the solid to 500 mL of water? Because the volumes don't simply add up. As LibreTexts' chemistry text explains, dissolved particles "occupy less space than they had prior to their solvation, which causes the volume of the solution, as a whole, to decrease, relative to the combined volumes of the individual solute and solvent." How much it changes depends on the solute and solvent, so the only reliable volume is the one you measure at the end.
What changes the answer
- Milliliters left unconverted. Divide 0.250 mol by 500 instead of 0.500 and you get 0.0005 M, 1,000 times too small. If your answer looks tiny, check the volume is in liters. The calculator lets you enter mL and converts for you.
- The wrong molar mass, often a hydrate. Many lab chemicals come as hydrates, with water built into the crystals, and that water counts in the molar mass. Copper(II) sulfate pentahydrate (CuSO₄·5H₂O) is 249.69 g/mol; anhydrous CuSO₄ is 159.61 g/mol. Weigh 3.99 g of the pentahydrate for 250 mL of "0.100 M" and you actually get 0.0639 M, 36% weaker:
Label says CuSO₄
159.61 g/mol
3.99 g
for 250 mL of 0.100 M
Label says CuSO₄·5H₂O
249.69 g/mol (water included)
6.24 g
for 250 mL of 0.100 M
3.99 g of the CuSO₄·5H₂O
the wrong molar mass
0.0639 M
36% weaker than planned
The water in a hydrate's crystals counts in its molar mass. Use the molar mass of the exact compound on the bottle: CuSO₄·5H₂O is 249.69 g/mol, not 159.61. Molar masses from PubChem; computed with the calculator's code. - Volume of solvent instead of solution. Dissolve first, then fill to the final volume (above).
- Temperature. Liquids expand and contract, so the same solution has a slightly different molarity at different temperatures. In LibreTexts' words, "The volume of a solution, on the other hand, is slightly dependent upon temperature." For precise work, make and measure the solution at the temperature you'll use it at.
- Purity. The calculation assumes the solid is 100% the compound on the label. If it isn't, the real molarity is lower in proportion.
Molarity, M and mol/L: what the standards say
Here's something most molarity pages skip: IUPAC's terminology and NIST's guide to the SI (the international system of units) describe "molarity" differently, and it's worth knowing if you write a lab report.
| Source | Name for the quantity | On "molarity" and M |
|---|---|---|
| IUPAC Gold Book | Amount concentration (also amount-of-substance concentration) | "in older literature molarity"; the unit mol L⁻¹ is "sometimes denoted by M" |
| NIST SP 811 (SI guide) | Amount-of-substance concentration of B, cB = nB / V | "The term molarity and the symbol M should no longer be used because they, too, are obsolete." |
| Chemistry classes and textbooks | Molarity | M, read "molar" (as in the LibreTexts text cited here) |
All three mean the same number: 1 M = 1 mol/L = 1 mol/dm³. The difference is the label. NIST's guide asks for "such units as mol/dm³, kmol/m³, or mol/L", so when a report or journal follows SI style, write 0.200 mol/L; in class, 0.200 M is what your teacher expects.
Molarity vs molality
They differ by one letter and one denominator. Molarity divides moles of solute by the volume of the solution (mol/L). Molality, in NIST's definition, is the "amount of substance of solute B in a solution divided by the mass of the solvent" (mol/kg). Mass doesn't change with temperature, so, as LibreTexts puts it, "Molality is used because its value does not change with changes in temperature." Use molarity for making and using solutions at a set temperature, and molality when temperature changes, as in freezing-point and boiling-point problems.
Molarity after a dilution
Adding solvent doesn't change the moles of solute, only the volume, so c₁ × V₁ = c₂ × V₂. Dilute 10.0 mL of 1.00 M solution to 100.0 mL and the new molarity is 1.00 × 10.0 ÷ 100.0 = 0.100 M. Our dilution calculator solves for any one of the four values.
Solution-prep table: grams to weigh
Grams of solute for common molarities and volumes, computed with the calculator's code (grams = molarity × liters × molar mass) from PubChem's molar masses. Check the formula on your bottle, hydrate or not, before you pick a row.
| Solute | g/mol | 0.100 M, 100 mL | 0.100 M, 250 mL | 0.100 M, 1 L | 0.500 M, 1 L | 1.00 M, 1 L |
|---|---|---|---|---|---|---|
| NaCl sodium chloride | 58.44 | 0.584 g | 1.461 g | 5.84 g | 29.22 g | 58.44 g |
| KCl potassium chloride | 74.55 | 0.746 g | 1.864 g | 7.46 g | 37.28 g | 74.55 g |
| NaOH sodium hydroxide | 39.997 | 0.400 g | 1.000 g | 4.00 g | 20.00 g | 40.00 g |
| CaCl₂ calcium chloride | 110.98 | 1.110 g | 2.775 g | 11.10 g | 55.49 g | 110.98 g |
| CaCl₂·2H₂O calcium chloride dihydrate | 147.01 | 1.470 g | 3.675 g | 14.70 g | 73.51 g | 147.01 g |
| MgSO₄·7H₂O magnesium sulfate heptahydrate | 246.48 | 2.465 g | 6.162 g | 24.65 g | 123.24 g | 246.48 g |
| CuSO₄ copper(II) sulfate | 159.61 | 1.596 g | 3.990 g | 15.96 g | 79.81 g | 159.61 g |
| CuSO₄·5H₂O copper(II) sulfate pentahydrate | 249.69 | 2.497 g | 6.242 g | 24.97 g | 124.85 g | 249.69 g |
| C₆H₁₂O₆ glucose | 180.16 | 1.802 g | 4.504 g | 18.02 g | 90.08 g | 180.16 g |
| C₁₂H₂₂O₁₁ sucrose | 342.3 | 3.423 g | 8.558 g | 34.23 g | 171.15 g | 342.30 g |
Molar masses from PubChem: NaCl, KCl, NaOH, C₆H₁₂O₆, C₁₂H₂₂O₁₁, CaCl₂, CaCl₂·2H₂O, CuSO₄, CuSO₄·5H₂O, MgSO₄·7H₂O. The table doesn't check whether a solute dissolves that far at your temperature, or how to handle it safely; check the safety data sheet and your lab's procedure.
Free printable: the formulas, the three steps, the traps and this table on one page. Download the sheet (PDF) or the image (PNG). Free to print and share with a link back to this page.
What the calculator assumes
- You know the final volume of the solution (not the water you started with).
- The molar mass you enter is for the exact compound you weighed, including any water of crystallization.
- The solute is pure, and all of it dissolves.
- The volume is measured at the temperature you'll use the solution at.
Try your own numbers
The Molarity calculator takes moles or grams and liters or milliliters, and shows the grams to weigh for a solution you want to make. For the rest of the set, see all our chemistry calculators. For homework, show each step as above; for lab work, your instructor's procedure comes first.
Transcript
How do you calculate molarity? Divide the moles of solute by the liters of solution. Start from grams: 9.00 grams of glucose, divided by its molar mass of 180.16 grams per mole, is 0.0500 moles. Then milliliters to liters: 250 milliliters is 0.250 liters. 0.0500 moles divided by 0.250 liters is 0.200 molar. Two traps. Forget to convert milliliters and your answer is 1,000 times too small. And a hydrate's water counts: copper sulfate pentahydrate is 249.69 grams per mole, not 159.61. Try it at freecalculators.ai.
How we checked this
Every number here is computed with the calculator's own math (lib/molarity.ts, with tests for each worked example). Molar masses are PubChem's, read on November 29, 2026. The definition and unit notes are quoted from the IUPAC Gold Book entry "amount concentration" (version 5.0.0) and NIST Special Publication 811, Chapter 8 (Secs. 8.6.5 and 8.6.8); the notes on volume and temperature from two LibreTexts chemistry texts (Heartland Community College's CHEM 120, Sec. 7.16, and CK-12's Introductory Chemistry, Sec. 16.11), all read on November 29, 2026. While writing this guide we found the Molarity calculator couldn't start from grams or take milliliters, though its FAQ said it could, so we added both. Kyle, our host, is an AI.
Frequently asked questions
How do you calculate molarity?
Divide the moles of solute by the liters of solution: M = mol ÷ L. From grams, first divide the mass by the molar mass. 9.00 g of glucose (180.16 g/mol) is 0.0500 mol; in 0.250 L of solution that's 0.200 M.
What is the formula for molarity?
Molarity (M) = moles of solute ÷ liters of solution. Rearranged: moles = M × liters, liters = moles ÷ M, and grams to weigh = M × liters × molar mass.
How do you calculate molarity from grams?
Divide the grams by the molar mass to get moles, convert the volume to liters, then divide moles by liters. For 9.00 g of glucose in 250.0 mL: 9.00 ÷ 180.16 = 0.0500 mol, ÷ 0.2500 L = 0.200 M.
How do you calculate molarity with milliliters?
Convert milliliters to liters first by dividing by 1,000 (250 mL = 0.250 L). Leaving the volume in milliliters makes the answer 1,000 times too small.
How many grams do I need to make a solution?
Multiply molarity × liters × molar mass. For 500 mL of 0.150 M NaCl: 0.150 × 0.500 × 58.44 = 4.38 g. Dissolve it, then add water up to 500 mL of solution.
Is molarity per liter of water or per liter of solution?
Per liter of solution. Dissolve the solute in less solvent than you need, then fill to the final volume, because the volumes of solute and solvent don't simply add.
What is the difference between molarity and molality?
Molarity is moles of solute per liter of solution (mol/L). Molality is moles of solute per kilogram of solvent (mol/kg). Molality doesn't change with temperature; molarity changes slightly because volume does.
Is M the same as mol/L?
Yes, 1 M = 1 mol/L = 1 mol/dm³. IUPAC says mol/L is sometimes denoted by M; NIST's SI guide calls the term molarity and the symbol M obsolete and asks for units such as mol/L instead.
Sources
- amount concentration (IUPAC Compendium of Chemical Terminology, 5th ed., online version 5.0.0) (International Union of Pure and Applied Chemistry (IUPAC))
- NIST Guide to the SI, Chapter 8 (Special Publication 811), Secs. 8.6.4, 8.6.5 and 8.6.8 (National Institute of Standards and Technology (NIST))
- 7.16: Solution Concentration - Molarity (CHEM 120: Fundamentals of Chemistry) (LibreTexts Chemistry)
- 16.11: Molality (Introductory Chemistry, CK-12) (LibreTexts Chemistry)
- Sodium chloride (CID 5234) (PubChem, U.S. National Library of Medicine)
- Glucose (CID 5793) (PubChem, U.S. National Library of Medicine)
- Copper(II) sulfate pentahydrate (CID 24463) (PubChem, U.S. National Library of Medicine)
For study and planning. Follow your instructor's or lab's procedure and the chemical's safety data sheet when you make a solution.