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.