Molarity Calculator

Convert between mass, molar mass, volume, and molar concentration: solve for molarity, grams of solute, solution volume, or molar mass, with common compound values built in.

Molarity

1 mol/L (M)

Moles of solute

1 mol

Formula: molarity = mass ÷ (molar mass × volume), from the definition c = n/V. Molar masses in the dropdown are PubChem values. Calculations run in your browser; nothing you type is sent anywhere.

In short

Molarity (M) is moles of solute per liter of solution: M = mass ÷ (molar mass × volume). Dissolving 58.44 g of NaCl (one mole) in water to a final volume of 1 L gives a 1.000 M solution. The same relation rearranges to find the mass to weigh out, the volume to dilute to, or an unknown molar mass.

One formula, four unknowns

Molar concentration is defined as the amount of substance per volume of solution, c = n/V (IUPAC), and the amount in moles is mass divided by molar mass, n = m/M. Put together: molarity = mass ÷ (molar mass × volume). Every question this calculator answers is that one relation solved for a different variable.

Units matter more than the algebra. Mass goes in grams, molar mass in g/mol, and volume in liters of final solution. The most common slip in a lab notebook is using 250 instead of 0.250 for a 250 mL flask, a factor-of-1000 error that survives dimensional analysis only because nobody wrote the units down.

Worked example: 500 mL of 0.5 M NaCl

How much salt do you weigh out? Mass = molarity × molar mass × volume = 0.5 mol/L × 58.44 g/mol × 0.5 L = 14.61 g. Dissolve it in less water than the target, then top up to the 500 mL line in a volumetric flask.

The order matters: dissolving 14.61 g of NaCl in 500 mL of water gives slightly more than 500 mL of solution, and therefore slightly less than 0.5 M. Molarity is per liter of solution, not per liter of solvent added; that distinction is the whole reason volumetric flasks exist.

Molarity, molality, percent: not interchangeable

Molarity (mol per liter of solution) is convenient because volumes are easy to measure with glassware, but it shifts slightly with temperature as the solution expands or contracts. Molality, moles per kilogram of solvent written m, ignores volume entirely and stays constant with temperature, which is why colligative-property calculations (freezing point depression, boiling point elevation) use it.

Mass percent (g of solute per 100 g of solution) is how concentrated stock chemicals are usually labeled. Converting a bottle labeled "37% HCl" to molarity requires its density; the conversion is routine but not automatic, and it is a separate calculation from the one on this page.

Dilutions with C₁V₁ = C₂V₂

Diluting changes the volume but not the moles of solute, so concentration × volume stays equal before and after: C₁V₁ = C₂V₂. To make 500 mL of 0.5 M solution from a 6 M stock: V₁ = (0.5 × 500) ÷ 6 = 41.7 mL of stock, topped up to 500 mL.

For strong acids, the safety rule rides along with the math: add the concentrated acid to the water, never water to the acid, so the heat of mixing is absorbed by the larger volume.

Molar masses of common lab compounds (PubChem)

Compound Formula Molar mass Grams for 1 L of 1 M
Sodium chlorideNaCl58.44 g/mol58.44 g
Sodium hydroxideNaOH40.00 g/mol40.00 g
Potassium chlorideKCl74.55 g/mol74.55 g
GlucoseC₆H₁₂O₆180.16 g/mol180.16 g
Sodium bicarbonateNaHCO₃84.01 g/mol84.01 g
Calcium carbonateCaCO₃100.09 g/mol100.09 g

For 1 L of 0.1 M, divide the last column by 10.

Frequently asked questions

How do I calculate molarity from grams?

Divide the mass in grams by the molar mass to get moles, then divide by the solution volume in liters. 20 g of NaOH (molar mass 40.00 g/mol) in 500 mL: 20 ÷ 40 = 0.5 mol, then 0.5 ÷ 0.5 L = 1.0 M.

What is the difference between molarity and moles?

Moles measure an amount of substance; molarity measures how concentrated it is: moles per liter of solution. Half a mole in half a liter and one mole in one liter are different amounts at the same 1 M concentration.

Is molarity affected by temperature?

Slightly, yes. Warming a solution expands its volume, so the same moles sit in more liters and molarity drops a little. Molality (per kg of solvent) does not change with temperature, which is why it is preferred for temperature-dependent property calculations.

Why use a volumetric flask instead of a beaker?

Because molarity is defined per liter of final solution. A volumetric flask lets you dissolve the solute first and then fill to a calibrated line, so the final volume, not the added water, is exactly right. Beaker graduations are far less accurate.

What does a 1 M solution mean in practice?

One mole of solute in every liter of solution. For table salt that is 58.44 g per liter; seawater, for comparison, is roughly 0.5 M in NaCl.

Embed this calculator

Paste this snippet into any blog post or web page to get the working molarity calculator — free to use, and the attribution link stays in place.

Built and maintained by Owen Zhang. Formulas verified against the sources above; last reviewed 2026-08-02.