{
  "id": "mole",
  "version": "c8d606edc612",
  "status": "published",
  "name": "Mole Calculator",
  "question": "How many moles are in my sample?",
  "summary": "Converts between mass, moles and number of particles: n = m ÷ M and N = n × Avogadro’s number, with the molar mass from a chemical formula or typed in.",
  "category": "chemistry",
  "subcategory": "stoichiometry",
  "url": "https://www.acalculator.org/chemistry/mole-calculator",
  "markdown": "https://www.acalculator.org/chemistry/mole-calculator.md",
  "kind": "function",
  "method": "n = m ÷ M (mass in grams over molar mass in g/mol); m = n × M; N = n × N_A with N_A = 6.02214076 × 10²³ per mole exactly; M = Σ atoms × CIAAW standard atomic weight.",
  "assumptions": [
    "Atomic weights are the CIAAW abridged standard atomic weights (2024), the values printed on most periodic tables.",
    "Avogadro’s number is the exact SI value 6.02214076 × 10²³ per mole.",
    "Particles means whatever one formula unit is: atoms for an element, molecules for a compound such as H₂O."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "src": {
        "title": "Molar mass from",
        "description": "Work the molar mass out from a chemical formula, or type it in g/mol.",
        "type": "string",
        "enum": [
          "formula",
          "typed"
        ]
      },
      "f": {
        "title": "Chemical formula",
        "description": "The substance, such as H2O, NaCl or C6H12O6. Element symbols start with a capital letter.",
        "type": "string",
        "maxLength": 100
      },
      "M": {
        "title": "Molar mass (g/mol)",
        "description": "The mass of one mole of the substance, in grams per mole.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000
      },
      "k": {
        "title": "What do you know?",
        "description": "The mass of the sample, the amount in moles, or the number of particles.",
        "type": "string",
        "enum": [
          "mass",
          "moles",
          "particles"
        ]
      },
      "m": {
        "title": "Mass",
        "description": "The mass of the sample.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "mass",
        "minimum": 0,
        "maximum": 1000
      },
      "n": {
        "title": "Amount (mol)",
        "description": "The amount of substance in moles.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000
      },
      "N": {
        "title": "Number of particles",
        "description": "How many atoms, molecules or formula units, such as 6.022e23.",
        "type": "number",
        "minimum": 0,
        "maximum": 1e+33
      }
    }
  },
  "outputs": {
    "molesOut": {
      "label": "Moles",
      "description": "The amount of substance: mass in grams ÷ molar mass, or particles ÷ Avogadro’s number.",
      "format": "number"
    },
    "grams": {
      "label": "Mass",
      "description": "Moles × molar mass, in grams.",
      "format": "number"
    },
    "count": {
      "label": "Particles",
      "description": "Moles × Avogadro’s number, 6.02214076 × 10²³ per mole.",
      "format": "number"
    },
    "countText": {
      "label": "Particles (scientific)",
      "description": "The number of particles as d.ddddd × 10ⁿ.",
      "format": "text"
    },
    "molar": {
      "label": "Molar mass",
      "description": "The molar mass used, in grams per mole.",
      "format": "number"
    },
    "formulaText": {
      "label": "Formula",
      "description": "The formula as read, with subscripts.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "src": "formula",
      "f": "H2O",
      "M": 18.015,
      "k": "mass",
      "m": 0.03603,
      "n": 1,
      "N": 6.02214076e+23
    },
    "outputs": {
      "molesOut": 2,
      "grams": 36.03,
      "count": 1.204428152e+24,
      "countText": "1.20443 × 10²⁴",
      "molar": 18.015,
      "formulaText": "H₂O"
    },
    "text": "2 mol, 36.03 g and 1.20443 × 10²⁴ particles at 18.015 g/mol."
  },
  "examples": [
    {
      "given": {
        "src": "formula",
        "f": "H2O",
        "k": "mass",
        "m": 0.03603
      },
      "expect": {
        "molar": 18.015,
        "molesOut": 2,
        "count": 1.204428152e+24,
        "countText": "1.20443 × 10²⁴"
      },
      "source": "CIAAW, Abridged Standard Atomic Weights (H 1.0080, O 15.999), https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: M = 18.015 g/mol, 36.03 ÷ 18.015 = 2 mol; × 6.02214076 × 10²³ (BIPM, SI Brochure 9th edition) = 1.204428152 × 10²⁴"
    },
    {
      "given": {
        "src": "formula",
        "f": "NaCl",
        "k": "moles",
        "n": 0.5
      },
      "expect": {
        "molar": 58.44,
        "grams": 29.22
      },
      "source": "CIAAW, Abridged Standard Atomic Weights (Na 22.990, Cl 35.45), https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: 0.5 × 58.44 = 29.22 g"
    },
    {
      "given": {
        "src": "formula",
        "f": "C6H12O6",
        "k": "mass",
        "m": 0.09
      },
      "expect": {
        "molar": 180.156,
        "molesOut": 0.49956704189702256
      },
      "source": "OpenStax, Chemistry 2e, §3.1 Formula Mass and the Mole Concept (grams to moles), https://openstax.org/books/chemistry-2e/pages/3-1-formula-mass-and-the-mole-concept; CIAAW weights; Python 3: 90/180.156"
    },
    {
      "given": {
        "src": "typed",
        "M": 12.011,
        "k": "particles",
        "N": 3.01107038e+23
      },
      "expect": {
        "molesOut": 0.5,
        "grams": 6.0055
      },
      "source": "BIPM, SI Brochure 9th edition (2019), N_A = 6.02214076 × 10²³ mol⁻¹, https://www.bipm.org/en/publications/si-brochure; hand calculation in content.mdx: 3.01107038 × 10²³ ÷ N_A = 0.5 mol; × 12.011 = 6.0055 g"
    },
    {
      "given": {
        "src": "formula",
        "f": "CO2",
        "k": "mass",
        "m": 0.1
      },
      "expect": {
        "molar": 44.009,
        "molesOut": 2.2722624917630485
      },
      "source": "CIAAW, Abridged Standard Atomic Weights (C 12.011, O 15.999), https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: 100 ÷ 44.009 = 2.27226 mol"
    }
  ],
  "sources": [
    "IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), Abridged Standard Atomic Weights (2024 table). https://ciaaw.org/abridged-atomic-weights.htm (retrieved 2026-10-01)",
    "BIPM, The International System of Units (SI Brochure), 9th edition (2019), §2.2, Table 1: the Avogadro constant N_A = 6.02214076 × 10²³ mol⁻¹ exactly. https://www.bipm.org/en/publications/si-brochure (retrieved 2026-10-01)",
    "OpenStax, Chemistry 2e, §3.1 Formula Mass and the Mole Concept (molar mass; converting between mass, moles and particles). https://openstax.org/books/chemistry-2e/pages/3-1-formula-mass-and-the-mole-concept (retrieved 2026-10-01)"
  ],
  "related": [
    "molar-mass",
    "molarity",
    "dilution"
  ],
  "changelog": []
}
