{
  "id": "concentration",
  "version": "02e7cbdebd3d",
  "status": "published",
  "name": "Concentration Calculator",
  "question": "What is the concentration?",
  "summary": "Computes the concentration of a solution as molarity, grams per litre, % w/v, mass percent, ppm, ppb and molality from the solute mass, its molar mass and the solution volume or mass.",
  "category": "chemistry",
  "subcategory": "solutions",
  "url": "https://www.acalculator.org/chemistry/concentration-calculator",
  "markdown": "https://www.acalculator.org/chemistry/concentration-calculator.md",
  "kind": "function",
  "method": "moles = mass ÷ molar mass; molarity = moles ÷ litres; g/L = grams ÷ litres; % w/v = grams ÷ mL × 100; mass percent = solute mass ÷ solution mass × 100; ppm = × 10⁶; ppb = × 10⁹; molality = moles ÷ (solution kg − solute kg).",
  "assumptions": [
    "The solution mass is volume × density (or the mass you type); its volume is mass ÷ density when you type the mass.",
    "Dilute water solutions have a density close to 1 g/mL, the default.",
    "Molality uses the solvent mass: the solution mass less the solute mass."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "m": {
        "title": "Mass of solute",
        "description": "The mass of the substance dissolved.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "mass",
        "minimum": 1e-12,
        "maximum": 1000
      },
      "mm": {
        "title": "Molar mass of solute (g/mol)",
        "description": "The mass of one mole of the solute, in grams per mole: 58.44 for sodium chloride.",
        "type": "number",
        "minimum": 1,
        "maximum": 10000000
      },
      "by": {
        "title": "I know the solution’s",
        "description": "Whether you know the volume or the mass of the whole solution.",
        "type": "string",
        "enum": [
          "volume",
          "mass"
        ]
      },
      "v": {
        "title": "Volume of solution",
        "description": "The volume of the whole solution (solute and solvent together).",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "volume",
        "minimum": 1e-12,
        "maximum": 1000
      },
      "ms": {
        "title": "Mass of solution",
        "description": "The mass of the whole solution (solute and solvent together).",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "mass",
        "minimum": 1e-12,
        "maximum": 1000
      },
      "d": {
        "title": "Density of solution",
        "description": "The density of the whole solution; dilute water solutions are close to 1 g/mL.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "density",
        "minimum": 100,
        "maximum": 25000
      }
    }
  },
  "outputs": {
    "molarity": {
      "label": "Molarity",
      "description": "Moles of solute per litre of solution (mol/L, M).",
      "format": "number"
    },
    "gramsPerLiter": {
      "label": "Mass concentration",
      "description": "Grams of solute per litre of solution (equal to mg/mL).",
      "format": "number"
    },
    "wv": {
      "label": "Mass/volume percent",
      "description": "Grams of solute per 100 mL of solution (% w/v).",
      "format": "number"
    },
    "ww": {
      "label": "Mass percent",
      "description": "Mass of solute ÷ mass of solution × 100 (% w/w).",
      "format": "number"
    },
    "ppm": {
      "label": "Parts per million",
      "description": "Mass of solute ÷ mass of solution × 1,000,000.",
      "format": "number"
    },
    "ppb": {
      "label": "Parts per billion",
      "description": "Mass of solute ÷ mass of solution × 1,000,000,000.",
      "format": "number"
    },
    "molality": {
      "label": "Molality",
      "description": "Moles of solute per kilogram of solvent (solution mass − solute mass).",
      "format": "number"
    },
    "moles": {
      "label": "Moles of solute",
      "description": "Mass of solute ÷ molar mass.",
      "format": "number"
    },
    "solutionMass": {
      "label": "Mass of solution",
      "description": "Volume × density, or the mass you typed.",
      "format": "quantity",
      "unit": "g"
    },
    "solutionVolume": {
      "label": "Volume of solution",
      "description": "The volume you typed, or mass ÷ density.",
      "format": "quantity",
      "unit": "mL"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "m": 0.0252,
      "mm": 60.052,
      "by": "volume",
      "v": 0.0005,
      "ms": 0.5,
      "d": 1000
    },
    "outputs": {
      "molarity": 0.839272630386998,
      "gramsPerLiter": 50.4,
      "wv": 5.039999999999999,
      "ww": 5.04,
      "ppm": 50400,
      "ppb": 50400000,
      "molality": 0.8838170075684477,
      "moles": 0.419636315193499,
      "solutionMass": 0.5,
      "solutionVolume": 0.0005
    },
    "text": "25.2 g of solute in 500 mL of solution is 0.839273 mol/L (5.04% by mass)."
  },
  "examples": [
    {
      "given": {
        "m": 0.0252,
        "mm": 60.052,
        "by": "volume",
        "v": 0.0005,
        "d": 1000
      },
      "expect": {
        "molarity": 0.839272630386998,
        "gramsPerLiter": 50.4,
        "wv": 5.04,
        "molality": 0.8838170075684477
      },
      "source": "OpenStax Chemistry 2e, section 3.3, Molarity, Example 3.16: 25.2 g of acetic acid (60.052 g/mol) in 0.500 L is 0.839 M (https://openstax.org/books/chemistry-2e/pages/3-3-molarity, retrieved 2026-10-01); Python 3 cross-check at full precision"
    },
    {
      "given": {
        "m": 0.00000375,
        "mm": 180.156,
        "by": "mass",
        "ms": 0.005,
        "d": 1000
      },
      "expect": {
        "ww": 0.075,
        "ppm": 750
      },
      "source": "OpenStax Chemistry 2e, section 3.4, Other Units for Solution Concentrations, Example 3.22: 3.75 mg of glucose in 5.0 g is 0.075% by mass (https://openstax.org/books/chemistry-2e/pages/3-4-other-units-for-solution-concentrations, retrieved 2026-10-01)"
    },
    {
      "given": {
        "m": 4.5e-9,
        "mm": 207.2,
        "by": "volume",
        "v": 0.0003,
        "d": 1000
      },
      "expect": {
        "ppb": 15,
        "ppm": 0.015
      },
      "source": "OpenStax Chemistry 2e, section 3.4, Example 3.25: 15 ppb of lead in 300 mL of water (density ~1.00 g/mL) is 4.5 µg (https://openstax.org/books/chemistry-2e/pages/3-4-other-units-for-solution-concentrations)",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Chemistry 2e, section 3.3, Molarity (M = mol solute ÷ L solution; Example 3.16), CC BY 4.0, retrieved 2026-10-01. https://openstax.org/books/chemistry-2e/pages/3-3-molarity",
    "OpenStax, Chemistry 2e, section 3.4, Other Units for Solution Concentrations (mass percentage, mass-volume percentage, ppm, ppb; Examples 3.22 and 3.25), CC BY 4.0, retrieved 2026-10-01. https://openstax.org/books/chemistry-2e/pages/3-4-other-units-for-solution-concentrations"
  ],
  "related": [
    "molarity",
    "dilution"
  ],
  "changelog": []
}
