Molarity Calculator
This molarity calculator finds the concentration of a solution in moles per liter. Start from a mass of solute with its molar mass, or straight from moles, add the solution volume, and you'll get the molarity, the moles, and the grams per liter. Everything updates as you type, so it's quick for class or lab prep. It's free and runs entirely in your browser.
- Molarity in M
- Moles of solute
- Grams per liter
- From mass or moles
- Molar mass table
Last updated July 24, 2026 Moles per liter Published by Muhammad Younus
Enter the values above zero to find the molarity.
The molar mass is the grams in one mole, found by adding the atomic masses in the formula. The volume is the total solution, not just the solvent. See the table below for common molar masses.
How do you calculate molarity?
Molarity is the concentration of a solution, and it's defined as moles of solute per liter of solution. The formula is short: molarity equals moles divided by liters. The catch is that you usually weigh out a solid rather than count moles, so there's one step before it. To get the moles, divide the mass in grams by the molar mass, which is the weight of one mole of that substance. Take table salt: its molar mass is 58.44 grams per mole, so 58.44 grams is exactly 1 mole, and stirring that into 1 liter of water gives a molarity of 1, written 1 M. Halve the volume and the molarity doubles, since the same moles are packed into less liquid. That's the whole idea, and it's why chemists reach for molarity constantly: reactions run mole for mole, so a known molarity lets you pour out an exact number of moles just by measuring a volume. This tool does the mass-to-moles step and the division together, and it also reports the grams per liter, so you'll see the concentration three ways the moment you type your numbers.
Making a solution, step by step
Here's the routine for 58.44 grams of salt in 1 liter, and it's just three steps:
- 1
Find the molesDivide 58.44 grams by the molar mass 58.44, which is 1 mole.
- 2
Set the volumeThe solution is 1 liter, the bottom of the fraction.
- 3
Divide for molarity1 mole over 1 liter is a molarity of 1, written 1 M.
Common molar masses
Here are molar masses for compounds you'll meet often, in grams per mole. Drop one into the molar mass box, and you're ready to find the molarity.
| Compound | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H2O | 18.02 |
| Table salt | NaCl | 58.44 |
| Sodium hydroxide | NaOH | 40.00 |
| Glucose | C6H12O6 | 180.16 |
| Sucrose | C12H22O11 | 342.30 |
Converting concentration to molarity
Sometimes you already know the concentration in grams per liter and just want the molarity, without the separate mass and volume. For that, divide the grams per liter by the molar mass and you land on moles per liter. So 58.44 grams per liter of table salt over its molar mass of 58.44 is 1 M, and 20 grams per liter of sodium hydroxide over 40.00 comes out at 0.5 M. To run it the other way, from molarity to grams per liter, you multiply instead: a 0.5 M sodium hydroxide solution holds 0.5 times 40.00, or 20 grams in every liter. Need the total grams to weigh out? Multiply by the volume as well, so 0.5 M in 2 liters is 0.5 times 40.00 times 2, which is 40 grams. If you're beginning from a moles figure rather than a concentration, the moles calculator handles that first step, and once a stock is made up you can thin it down with the dilution calculator.
| Concentration | Compound (molar mass) | Molarity |
|---|---|---|
| 58.44 g/L | NaCl (58.44 g/mol) | 1 M |
| 20 g/L | NaOH (40.00 g/mol) | 0.5 M |
| 40 g/L | NaOH (40.00 g/mol) | 1 M |
| 90 g/L | Glucose (180.16 g/mol) | ≈0.50 M |
| 342.30 g/L | Sucrose (342.30 g/mol) | 1 M |
Frequently asked questions
You choose how you're starting, from a mass of solute or from moles, then enter the values and the solution volume. From a mass it finds the moles by dividing by the molar mass, then divides those moles by the volume in liters for the molarity. Everything loads instantly in the page, so you'll see the concentration update as you type, and your numbers never leave your device. It also shows the moles and the grams-per-liter alongside.
Molarity is moles of solute divided by liters of solution. If you have a mass, first turn it into moles by dividing the grams by the molar mass, then divide by the volume. So 58.44 grams of table salt, which has a molar mass of 58.44, is exactly 1 mole, and dissolved in 1 liter that's a molarity of 1, written 1 M. The calculator runs both steps the moment you type the mass, molar mass, and volume.
Molarity is the most common way to express concentration in chemistry: the number of moles of a dissolved substance per liter of solution. A 2 M solution has 2 moles in every liter. It's written with a capital M, so 0.5 M reads as half-molar. Because reactions happen mole for mole, molarity lets you measure out exact amounts for a reaction, which is why it shows up all over lab work and homework.
They sound alike but divide by different things. Molarity is moles per liter of solution, while molality is moles per kilogram of solvent. Molarity is easier to measure, since you just make up a volume, so it's the everyday choice. Molality matters when temperature changes, because volume shifts with heat but mass doesn't, so it's used for boiling-point and freezing-point work. This tool calculates molarity, the one you'll meet most often.
Add up the atomic masses of every atom in the formula. For table salt, NaCl, sodium is about 22.99 and chlorine about 35.45, so the molar mass is 58.44 grams per mole. For water, two hydrogens at 1.008 plus one oxygen at 16.00 gives 18.02. Once you have that number, type it into the molar mass box here, or let the molar mass calculator add it up from the formula for you. The reference table below lists a few common compounds too.
When a concentration is given in grams per liter, divide it by the molar mass to get the molarity in moles per liter. Take 58.44 grams per liter of table salt: dividing by the molar mass of 58.44 lands on 1 M. The step works because grams per liter over grams per mole cancels to moles per liter, which is molarity by definition. If the concentration already sits in a molar unit, no real conversion is needed, so 500 mM is just 0.5 M.
Multiply the molarity by the molar mass to reach grams per liter, then by the volume in liters for the total grams. A 0.25 M glucose solution, molar mass 180.16, carries 0.25 times 180.16, or about 45 grams in every liter. Make up 2 liters of it and you'll weigh out 0.25 times 180.16 times 2, close to 90 grams. Molarity to grams is really the concentration calculation run in reverse.
Yes, it's completely free, with no sign-up, and it runs right in your browser, so nothing you type is uploaded. Pick your starting point, type the mass or moles and the volume, and read the molarity in a tap. Bookmark it for chemistry class, lab prep, or making up solutions, and you'll have the molarity formula, the moles, and the concentration all in one place whenever you need them.
Related tools
More chemistry and math tools.
Add up atomic masses from a formula.
Moles CalculatorMoles from mass, molar mass, or volume.
Dilution CalculatorThin a stock with C1V1 = C2V2.
Mixing up a solution?
Find the molarity above, or work out a material's density.