The osmolarity of a solution, given in osmoles per liter (osmol/L) is calculated from the following expression:
where
*  is the osmotic coefficient, which accounts for the degree of non-ideality of the solution. In the simplest case it is the degree of dissociation of the solute. Then,  is between 0 and 1 where 1 indicates 100% dissociation. However,  can also be larger than 1 (e.g. for sucrose). For salts, electrostatic effects cause  to be smaller than 1 even if 100% dissociation occurs (see Debye–Hückel equation);
*  is the number of particles (e.g. ions) into which a molecule dissociates. For example: glucose has  of 1, while NaCl has  of 2;
*  is the molar concentration of the solute;
* the index  represents the identity of a particular solute.
Osmolarity can be measured using an osmometer which measures colligative properties, such as Freezing-point depression, Vapor pressure, or Boiling-point elevation.