{
  "id": "molar-mass",
  "version": "64d3ffc23a66",
  "status": "published",
  "name": "Molar Mass Calculator",
  "question": "What is the molar mass?",
  "summary": "Computes the molar mass (molecular weight) of a chemical formula in g/mol from the IUPAC standard atomic weights, with each element’s share by mass, and converts grams to moles and moles to grams.",
  "category": "chemistry",
  "subcategory": "stoichiometry",
  "url": "https://www.acalculator.org/chemistry/molar-mass-calculator",
  "markdown": "https://www.acalculator.org/chemistry/molar-mass-calculator.md",
  "kind": "function",
  "method": "molar mass = Σ (atoms of each element × its standard atomic weight), in g/mol; moles = grams ÷ molar mass.",
  "assumptions": [
    "Atomic weights are the CIAAW abridged standard atomic weights (2024), the values printed on most periodic tables: for example H 1.0080, C 12.011, O 15.999, Na 22.990, Cl 35.45.",
    "Elements with no standard atomic weight (technetium, promethium, and polonium onward except thorium, protactinium and uranium) give no answer.",
    "A charge does not change the molar mass here: the mass of the electrons gained or lost is left out. A phase label such as (aq) is ignored.",
    "A whole number typed before the formula multiplies it (2H2O is two water molecules, 36.030 g/mol)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "f": {
        "title": "Chemical formula",
        "description": "The chemical formula, such as H2O, Ca(OH)2 or CuSO4·5H2O. Element symbols start with a capital letter.",
        "type": "string",
        "maxLength": 100
      },
      "m": {
        "title": "Mass of sample",
        "description": "A mass of the substance to convert to moles.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "mass",
        "minimum": 0,
        "maximum": 1000000
      },
      "mol": {
        "title": "Amount (mol)",
        "description": "An amount of the substance in moles to convert to grams.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "molarMass": {
      "label": "Molar mass",
      "description": "The sum of each element’s standard atomic weight × its number of atoms, in grams per mole.",
      "format": "number"
    },
    "formulaText": {
      "label": "Formula",
      "description": "The formula as read, with subscripts.",
      "format": "text"
    },
    "composition": {
      "label": "Composition by mass",
      "description": "For each element: atoms × atomic weight = its part of the molar mass, and its share by mass.",
      "format": "text"
    },
    "atoms": {
      "label": "Atoms in the formula",
      "description": "The total number of atoms in one formula unit.",
      "format": "integer"
    },
    "molesOut": {
      "label": "Moles in the sample",
      "description": "Mass of sample in grams ÷ molar mass.",
      "format": "number"
    },
    "grams": {
      "label": "Mass of the amount",
      "description": "Amount in moles × molar mass, in grams.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "C6H12O6"
    },
    "outputs": {
      "molarMass": 180.156,
      "formulaText": "C₆H₁₂O₆",
      "composition": "C: 6 × 12.011 = 72.066 g/mol (40.002%); H: 12 × 1.008 = 12.096 g/mol (6.714%); O: 6 × 15.999 = 95.994 g/mol (53.284%)",
      "atoms": 24
    },
    "text": "The molar mass of C₆H₁₂O₆ is 180.156 g/mol."
  },
  "examples": [
    {
      "given": {
        "f": "H2O"
      },
      "expect": {
        "molarMass": 18.015,
        "composition": "H: 2 × 1.008 = 2.016 g/mol (11.191%); O: 1 × 15.999 = 15.999 g/mol (88.809%)",
        "atoms": 3
      },
      "source": "CIAAW, Abridged Standard Atomic Weights (H 1.0080, O 15.999), https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: 2 × 1.0080 + 15.999 = 18.015"
    },
    {
      "given": {
        "f": "C6H12O6",
        "m": 0.09
      },
      "expect": {
        "molarMass": 180.156,
        "formulaText": "C₆H₁₂O₆",
        "molesOut": 0.49956704189702256,
        "atoms": 24
      },
      "source": "CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, O 15.999), https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: 6 × 12.011 + 12 × 1.0080 + 6 × 15.999 = 180.156; 90 ÷ 180.156 = 0.49957 mol"
    },
    {
      "given": {
        "f": "NaCl",
        "mol": 2
      },
      "expect": {
        "molarMass": 58.44,
        "grams": 116.88
      },
      "source": "CIAAW, Abridged Standard Atomic Weights (Na 22.990, Cl 35.45), https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: 22.990 + 35.45 = 58.44; 2 × 58.44 = 116.88 g"
    },
    {
      "given": {
        "f": "CuSO4·5H2O"
      },
      "expect": {
        "molarMass": 249.677,
        "formulaText": "CuSO₄·5H₂O",
        "atoms": 21
      },
      "source": "hand calculation in content.mdx: 63.546 + 32.06 + 9 × 15.999 + 10 × 1.0080 = 249.677 (weights from CIAAW, https://ciaaw.org/abridged-atomic-weights.htm)"
    },
    {
      "given": {
        "f": "Ca(OH)2"
      },
      "expect": {
        "molarMass": 74.092,
        "formulaText": "Ca(OH)₂",
        "atoms": 5
      },
      "source": "hand calculation in content.mdx: 40.078 + 2 × 15.999 + 2 × 1.0080 = 74.092 (CIAAW, https://ciaaw.org/abridged-atomic-weights.htm)"
    },
    {
      "given": {
        "f": "K4[Fe(CN)6]"
      },
      "expect": {
        "molarMass": 368.345,
        "atoms": 17
      },
      "source": "hand calculation in content.mdx: 4 × 39.098 + 55.845 + 6 × 12.011 + 6 × 14.007 = 368.345 (CIAAW, https://ciaaw.org/abridged-atomic-weights.htm)"
    }
  ],
  "sources": [
    "IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), Abridged Standard Atomic Weights (2024 table). https://ciaaw.org/abridged-atomic-weights.htm",
    "Prohaska, T., and others (2022). Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure and Applied Chemistry 94(5), 573–600. https://doi.org/10.1515/pac-2019-0603",
    "OpenStax, Chemistry 2e, §3.1 Formula Mass and the Mole Concept (molar mass as the sum of atomic masses; grams to moles). https://openstax.org/books/chemistry-2e/pages/3-1-formula-mass-and-the-mole-concept"
  ],
  "related": [
    "molarity",
    "dilution",
    "chemical-equation-balancer"
  ],
  "changelog": []
}
