Guide · Science
How to Calculate Molarity of a Solution
Updated 2026-08-08 · 4 min read
Molarity is moles of solute per liter of solution:
M = n / V
n is in moles. V is in liters of the final solution. The unit is mol/L, written M.
The molarity calculator rearranges M = n/V in the browser - solve for molarity, moles, or volume. No account. It will not convert grams to moles unless you already did that (or you use a workflow that starts from n).
Solution volume, not “how much water I used”
A volumetric flask is the picture: add solute, add some solvent, dissolve, then fill to the etched line. That line is V.
If you dissolve 0.250 mol of stuff in a little water and pour it into a flask that you then fill to 500.0 mL, V = 0.5000 L and M = 0.500 M. The water you used before the mark is not V.
Concentrated sulfuric acid and ethanol are the rude examples: mixing 50 mL of each does not give 100 mL of solution. Molarity still uses whatever the true final volume is, which you measure, not assume.
For dilute aqueous homework, “dissolve in 500 mL of water” is often treated as V ≈ 0.500 L. That is an approximation. On a pre-lab that specifies a 500 mL volumetric flask, use the flask.
From grams you need molar mass first
n = m / M_molar
NaCl is 58.44 g/mol. 14.61 g of NaCl is 0.2500 mol. In 0.500 L,
M = 0.2500 / 0.500 = 0.500 M
If you divide 14.61 by 0.500 you get 29.2, which is g/L, a perfectly good mass concentration and not molarity. The concentration calculator is for those other labels (percent, ppm, g/L). This page is M.
Hydrates: use the molar mass of the solid you actually weighed (CuSO₄·5H₂O is not the same g/mol as anhydrous CuSO₄). The moles of CuSO₄ equal the moles of hydrate formula units if you weighed the hydrate.
Dissolve 0.250 mol in 500 mL
You need 500 mL of 0.500 M NaCl for a conductivity lab.
n = M × V = (0.500 mol/L)(0.500 L) = 0.250 mol
mass = (0.250 mol)(58.44 g/mol) = 14.6 g
Weigh 14.6 g, transfer quantitatively, fill to 500 mL. If you fill to 500 mL in a beaker instead of a flask, V is sloppy and M is sloppy; the formula is not at fault.
Reverse check: 14.6 g / 58.44 = 0.250 mol, 0.250 / 0.500 = 0.500 M.
If the stock on the shelf is 6.0 M and you need 0.500 M, do not start from grams. Use C1V1 = C2V2. That is dilution.
What M = n/V does not know
Ions. 0.500 M NaCl is 0.500 M in formula units. It is 0.500 M Na⁺ and 0.500 M Cl⁻. CaCl₂ at 0.500 M is 0.500 M Ca²⁺ and 1.00 M Cl⁻. Colligative van ’t Hoff factors use that; the molarity calculator does not multiply by i unless you put the ion moles in.
pH. 0.025 M HCl is not “pH = 0.025.” For a strong acid, [H+] ≈ 0.025 M and pH = −log(0.025) = 1.60. Weak acids are not that. See pH from concentration.
Molality. m = n / kg of solvent. Same n, different denominator. They are close for dilute water solutions because 1 L of water is about 1 kg, but “close” is not “equal” at 2 M.
Percent by mass. Different definition. A 10% w/w solution is not 10 M.
Unit traps
mL left as 500 in the denominator: M = 0.250/500 = 5.0 × 10⁻⁴, which looks like a trace solution. You wanted 0.500.
Using kg of solution as if it were liters. Density of water is about 1 kg/L, so this almost works for dilute water and fails for concentrated H₂SO₄ (density ~1.8 g/mL).
Significant figures: a 500 mL volumetric flask is often 500.0 mL class A. A “500 mL beaker” is not.
Solve for M, n, or V locally
The molarity calculator is the M = n/V rearrangement. Get n from grams and molar mass first when that is what the bottle gives you. For molality or a side-by-side of the two, read molarity vs molality. For stock-to-working volumes, use the dilution calculator.
Frequently asked questions
What is the molarity formula?
M = n / V. Moles of solute divided by liters of solution. A 0.500 M solution has 0.500 mol of solute in every 1.00 L of solution, not necessarily in 1.00 L of water.
Is the volume the solvent or the solution?
The solution. You dissolve, then dilute to the mark in a volumetric flask. Using only the milliliters of water you poured in first undercounts V if the solute occupies space, and it is not how M is defined.
How do I get moles if I was given grams?
n = mass / molar mass. Find the molar mass from the formula (or the molecular weight calculator), then divide. 5.85 g of NaCl is 0.100 mol; in 0.500 L that is 0.200 M.
mL versus L?
500 mL is 0.500 L. Dividing moles by 500 instead of 0.500 makes M too small by 1000. The molarity calculator has a milliliter option; if you use it, do not also divide by 1000 yourself.
When is molarity a poor concentration unit?
When temperature changes the volume of the solution (M drifts) or when a colligative-property equation wants moles per kilogram of solvent. That is molality. See molarity vs molality.
Does the molarity calculator require an account?
No. It runs in the browser. You can solve for M, n, or V from the other two.
Related guides
More reading that links back to the same tools and workflows.
Molarity vs Molality: How to Calculate Both
When chemists use molality vs molarity, plus local calculators for both.
4 min read
How to Do Dilution Calculations (C1V1 = C2V2)
Stock-to-working concentration math for labs. Dilute locally with a calculator.
4 min read
Best Scientific Calculators for Chemistry and Physics
Molarity, pH, gas law, force, and energy calculators for lab and class. Run the math in your browser with worked examples.
5 min read
How to Calculate Acceleration (With Examples)
Use a = Δv / t with worked problems. Run the numbers locally in a browser calculator.
4 min read