molecalculator

Moles & Molar Mass

Density and Molarity: The Relation and Formula

Calculator No. 01-4778 · Updated · Formula and assumptions shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

Density and molarity are related when you know a solution’s composition: density converts a measured volume of solution into mass, while molar mass converts solute mass into moles. Density alone does not determine molarity; you also need the solute’s mass fraction or another measure of its concentration. This calculator uses solution density, solute mass fraction, and solute molar mass to calculate molarity.

Formula

The formula is M = 1000ρw / W. Here, M is molarity in moles per liter (mol/L); ρ is solution density in grams per milliliter (g/mL); w is the solute mass fraction, expressed as a decimal; and W is the solute molar mass in grams per mole (g/mol). The factor 1000 converts milliliters to liters: 1 L = 1000 mL.

The calculation starts with one liter of solution. At density ρ, that liter has a mass of 1000ρ grams. A fraction w of that mass is solute, giving 1000ρw grams of solute per liter. Dividing by W converts those grams to moles, which gives molarity. The calculator’s second result converts mol/L to mmol/L by multiplying by 1000.

Worked Example

Using the default values, the solution density is 1.05 g/mL, the solute mass fraction is 0.10, and the solute molar mass is 58.44 g/mol.

  1. Mass of one liter of solution: 1.05 g/mL × 1000 mL/L = 1050 g/L.
  2. Solute mass per liter: 1050 g/L × 0.10 = 105 g/L.
  3. Moles of solute per liter: 105 g/L ÷ 58.44 g/mol = 1.79603 mol/L.
  4. Rounded to four decimal places, molarity is 1.7960 mol/L. In millimolar units, 1.79603 mol/L × 1000 = 1796.03 mmol/L, or 1796.03 mmol/L to two decimal places.

Assumptions

  • The input density is for the complete solution, not the pure solvent.
  • Mass fraction is a decimal: 10% by mass is 0.10.
  • The molar mass corresponds to the stated solute formula and chemical form.
  • The solution’s density and composition refer to the same conditions, including temperature.
  • The calculation gives analytical molarity; it does not account for chemical reactions or dissociation.

When Density Helps Calculate Molarity

Density is useful when a solution is specified by mass percentage but you need concentration per unit volume. For example, a label might report a solute as a percentage by mass. If you also know the solution density and the solute molar mass, the formula turns that mass-based composition into mol/L.

By contrast, if a solution’s molarity is already given, density is not needed to use that molarity. Likewise, density and molar mass alone are insufficient: density tells you the mass of the whole solution in a given volume, but not what portion of that mass is solute. You need composition information such as mass fraction, mass percentage, or a directly supplied solute mass.

Mass fraction and mass percentage mean the same kind of composition expressed on different scales. A mass fraction of 0.10 is 10% by mass. If the composition is stated as a percentage, divide it by 100 before entering it. Do not confuse mass percent with volume percent or a mass-per-volume percentage; they are different quantities and cannot be substituted without suitable additional data.

How to Use the Calculator

  • Enter the density of the entire solution in g/mL, not the density of the pure solute or solvent.
  • Enter the solute’s mass fraction as a decimal—for example, enter 0.10 for 10% by mass.
  • Enter the solute’s molar mass in g/mol. For a compound, calculate it from its chemical formula and suitable atomic weights.
  • Read the first result as molarity in mol/L and the second as the same concentration in mmol/L.

For a mixture with multiple solutes, calculate each solute’s molarity separately using its own mass fraction and molar mass, provided the composition and density describe the same final solution. A mass fraction cannot be assigned to the solvent as though it were a solute unless that is the species whose concentration you intend to calculate.

Molarity, Molality, and Density

Molarity is moles of solute per liter of solution. Molality is moles of solute per kilogram of solvent. They are not interchangeable: molarity depends on solution volume, which changes with temperature and can also reflect mixing or contraction. Molality is based on solvent mass and does not use solution volume.

Density is mass per volume, commonly written as g/mL or kg/L. It relates solution mass to volume, but does not itself express how much solute is present. The mass fraction supplies that missing composition information. Together, density and mass fraction give solute mass per solution volume; molar mass then converts the mass to amount of substance.

Common Errors and Limits

  • Using solvent density: the formula requires the density of the complete solution. Adding solute often changes density.
  • Entering 10 instead of 0.10: the input is a fraction, not a percentage number. Enter 0.10 for 10% by mass.
  • Mixing units: this calculator expects density in g/mL and molar mass in g/mol. If you use another unit, convert it first.
  • Using the wrong chemical form: hydrates, salts, and compounds with different formulas have different molar masses. Use the formula that matches the solute being counted.
  • Assuming density is constant: solution density can vary with temperature and composition. Use a value measured or specified for the relevant conditions.

The result is only as reliable as the input data. Rounded density, approximate composition, impurities, volume changes, or a mismatch in temperature can affect the calculated molarity. The equation is a mass-balance conversion, not a prediction of how a solution behaves chemically. It does not determine pH, degree of ionization, or the concentration of a particular ion after dissociation.

Frequently Asked Questions

Can you calculate molarity from density alone?
No. Density gives the mass of solution per volume, but not the amount of solute in that solution. You also need its composition, such as mass fraction, and the solute’s molar mass.

What is the formula relating density and molarity?
For density in g/mL, mass fraction as a decimal, and molar mass in g/mol, use M = 1000ρw/W. The factor 1000 converts the solution volume from milliliters to liters.

How do I convert mass percent to mass fraction?
Divide the percentage by 100. For example, 25% by mass becomes a mass fraction of 0.25.

Does solution temperature affect this calculation?
It can. Density usually depends on temperature, and molarity is defined per solution volume. Use density for the temperature relevant to the solution and its stated composition.

Is molarity the same as molality?
No. Molarity is moles per liter of solution; molality is moles per kilogram of solvent. The denominator and the quantities required for each calculation differ.

Related

Formula used
in rho | Solution density | g/mL | 1.05 | 0
in w | Solute mass fraction | fraction | 0.10 | 0
in mm | Solute molar mass | g/mol | 58.44 | 0
out c | Molarity | mol/L | rho * 1000 * w / mm | 4
out cm | Concentration in millimolar | mmol/L | c * 1000 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →