How to calculate molarity
Molarity is the amount of solute in moles divided by the final solution volume in liters. If you know the solute's mass, first divide it by the molar mass to obtain moles. The combined equation is M = m / (MW × V), where mass is in grams, molar mass is in grams per mole, and volume is in liters.
Choose the quantity you need at the top of the calculator. It can find concentration from mass and volume, the mass required for a target concentration, or the final volume corresponding to a known mass and concentration. The selected unknown disappears from the input fields. Unit conversions happen before calculation, and the result shows the equation in grams, liters and moles so you can check it.
Concentration to molarity at a glance
To turn any mass concentration into molarity, express it in grams per liter of final solution and divide by the molar mass (MW, in g/mol). Weight percent and ppm by mass also need the whole solution's density in g/mL.
| You have | Molarity | Example: sodium chloride, 58.44 g/mol |
|---|---|---|
| g/L | M = g/L ÷ MW | 5.844 g/L = 0.1 M |
| mg/mL | mM = mg/mL × 1,000 ÷ MW | 1 mg/mL = 17.112 mM |
| µg/mL | µM = µg/mL × 1,000 ÷ MW | 1 µg/mL = 17.112 µM |
| g/mL | M = g/mL × 1,000 ÷ MW | 0.005844 g/mL = 0.1 M |
| % w/v | M = % × 10 ÷ MW | 0.9% w/v = 154 mM |
| % w/w | M = % × 10 × density ÷ MW | Needs the solution's density |
| ppm by mass | mM = ppm × density ÷ MW | Needs the solution's density |
To go back from molarity, multiply instead: g/L = M × MW, and mg/mL = mM × MW ÷ 1,000. The sections below explain each row, and the calculator does every conversion with your own molar mass.
Convert µg/mL or mg/mL to molarity
A concentration in µg/mL or mg/mL becomes molarity when divided by the molar mass: c = ρ ÷ MW, using g/L and g/mol. Use the conversion shortcut above the calculator, or choose To molarity under Calculate. Enter the molar mass and mass concentration, then choose a Result unit or leave it on Automatic.
For a molar mass in g/mol, µM = µg/mL × 1,000 ÷ MW, and mM = mg/mL × 1,000 ÷ MW. For example, 50 µg/mL of a 25,000 g/mol protein is 2 µM, or 2,000 nM. A 1 mg/mL sodium chloride solution (58.44 g/mol) is 17.112 mM.
g/mL to molarity
Choose To molarity and the g/mL concentration unit. With molar mass in g/mol, M = g/mL × 1,000 ÷ MW. For example, 0.005844 g/mL at 58.44 g/mol gives 0.1 M, or 100 mM. For the reverse conversion, choose To mass conc. and g/mL as the result unit.
Here g/mL means grams of solute per mL of final solution. The density of the whole solution alone cannot give its molarity: you also need the solute's mass fraction, such as % w/w.
Molarity to mass concentration
Use the Molarity to mass concentration shortcut, or choose To mass conc. under Calculate. Enter the molar mass and molarity, then select mg/mL or another Result unit. The mass-per-volume relationship is ρ = c × MW, using mol/L and g/mol to obtain g/L.
For example, 10 µM sodium chloride at 58.44 g/mol is 0.0005844 mg/mL, or 584.4 ng/mL. The conversion uses only the molar mass; it does not assume a density, purity or dissociation. The shortcuts change the calculation direction and keep your entered quantities, molar mass and unit choices.
M, mM, µM and nM: molarity units
M means mol/L. The prefixes change the unit's size, so 1 mM = 1,000 µM = 1,000,000 nM. Changing the result unit does not change the solution's concentration.
| Unit | Name | In mol/L |
|---|---|---|
| M | Molar | 1 |
| mM | Millimolar | 0.001 |
| µM | Micromolar | 0.000001 |
| nM | Nanomolar | 0.000000001 |
For example, the same 2 µM result is 0.002 mM or 0.000002 M. Result units are available for both Find molarity and To molarity. Your copy or download keeps the selected unit.
The mol/L convention follows IUPAC's amount concentration definition; milli, micro and nano follow the BIPM SI prefixes.
Convert percent concentration to molarity
Choose To molarity, then choose the percentage basis. % w/v means grams of solute per 100 mL of final solution; 0.9% w/v is 9 g/L. % w/w means grams of solute per 100 g of solution and requires the solution density in g/mL. For example, 10% w/w with a density of 1.05 g/mL gives 105 g/L; a molar mass of 40 g/mol makes that 2.625 M.
The density belongs to the whole solution at your conditions. The calculator requires you to enter it for weight percent; it does not substitute water's density. To reverse the calculation, choose To mass conc. and select a result unit.
Convert ppm to molarity
Here, ppm by mass explicitly means mg of solute per kg of solution. Enter its density to convert to mg/L before dividing by molar mass. For example, 250 ppm by mass at 1.2 g/mL is 300 mg/L. With a molar mass of 100 g/mol, that is 3 mM.
If a measurement is already in mg/L, select mg/L directly; it needs no density. A ppm value is numerically equal to mg/L only when the solution density is 1 g/mL. Volume-based or gas-phase ppm is a different basis and is not converted here. These definitions follow OpenStax Chemistry 2e, Other Units for Solution Concentrations.
To convert ppm to mg/L, ppb or percent without a molar mass, or to work out the solute or stock for a ppm target, use the ppm calculator.
Worked example: 100 mM sodium chloride
Using a molar mass of 58.44 g/mol, 0.5844 g of sodium chloride represents 0.01000 mol. A final solution volume of 100 mL is 0.100 L. Dividing 0.01000 mol by 0.100 L gives 0.1000 mol/L, or 100 mM. These are the example values in the calculator. Under Molar mass source, choose Known value to enter the molecular weight yourself, or Formula to calculate it from NaCl.
To work in the opposite direction, select Find mass, enter 100 mM, 100 mL and 58.44 g/mol. The result is the same 0.5844 g. For a different compound, replace the molar mass before interpreting the result.
Molar masses of common lab reagents
Values below come from the calculator itself, using its Formula option and CIAAW 2024 abridged atomic weights. Weigh the exact form named: a hydrate weighs more per mole than the anhydrous salt.
| Reagent | Molar mass, g/mol | 1 L at 100 mM | 1 mg/mL is |
|---|---|---|---|
| Sodium chloride, NaCl | 58.44 | 5.844 g | 17.112 mM |
| Potassium chloride, KCl | 74.548 | 7.4548 g | 13.414 mM |
| Magnesium chloride hexahydrate, MgCl2·6H2O | 203.3 | 20.33 g | 4.919 mM |
| Calcium chloride dihydrate, CaCl2·2H2O | 147.01 | 14.701 g | 6.8024 mM |
| Tris base, C4H11NO3 | 121.14 | 12.114 g | 8.2552 mM |
| HEPES, C8H18N2O4S | 238.3 | 23.83 g | 4.1964 mM |
| EDTA disodium dihydrate, C10H14N2Na2O8·2H2O | 372.24 | 37.224 g | 2.6865 mM |
| Glucose, C6H12O6 | 180.16 | 18.016 g | 5.5507 mM |
| Sucrose, C12H22O11 | 342.3 | 34.23 g | 2.9214 mM |
| Glycine, C2H5NO2 | 75.067 | 7.5067 g | 13.321 mM |
| Sodium dodecyl sulfate (SDS), C12H25NaO4S | 288.38 | 28.838 g | 3.4677 mM |
| Sodium hydroxide, NaOH | 39.997 | 3.9997 g | 25.002 mM |
| Potassium phosphate, monobasic, KH2PO4 | 136.08 | 13.608 g | 7.3484 mM |
| Sodium phosphate, dibasic (anhydrous), Na2HPO4 | 141.96 | 14.196 g | 7.0443 mM |
Masses are for a final volume of 1 L at 100 mM. For another volume or concentration, scale them or enter the formula in the calculator. The table does not account for purity, pH adjustment or solubility limits.
Final volume and compound identity matter
Final solution volume includes the solute. Adding a solid to 100 mL of solvent is not the same as preparing a final volume of 100 mL. Enter the final volume used by your preparation method.
Use the molar mass of the exact chemical form on the container, including any waters of hydration. Choose a known numeric value or enter its chemical formula. The formula option uses the same CIAAW 2024 abridged atomic weights and grouped-atom parser as the molar mass calculator, which shows the full element breakdown. Calculations retain the unrounded formula mass internally.
Formula input supports parentheses, brackets and middle-dot hydrates such as CuSO4·5H2O. It does not infer a compound's identity, purity or hydrate from a name, support isotope/charge notation, or convert liquid volume into mass using density. Display rounding does not determine the precision of your measurements.
Preparing a working solution from a stock
For DNA mass or concentration, the copy number worksheet converts to molecules using the DNA length or a known molar mass. It also gives copies in a measured aliquot and the mass needed for a target copy count.
If you already have a stock solution with a known concentration, use the dilution calculator. That calculation conserves the amount of solute and gives the stock volume needed for a final concentration. It does not require the molar mass when both concentrations use compatible units. For a buffer at a set pH, the buffer calculator weighs both forms of the buffer or plans a titration.
The definition and dilution relationship are described in OpenStax Chemistry 2e, Molarity. Calculations run locally; Copy calculation and Save calculation preserve the current inputs, equation and assumptions.