{
  "id": "empirical-formula",
  "version": "339b71eba114",
  "status": "published",
  "name": "Empirical Formula Calculator",
  "question": "What is the empirical formula?",
  "summary": "Finds the empirical formula of a compound from the mass or mass percent of each element, with the mole ratios, and the molecular formula when you know the molar mass.",
  "category": "chemistry",
  "subcategory": "stoichiometry",
  "url": "https://www.acalculator.org/chemistry/empirical-formula-calculator",
  "markdown": "https://www.acalculator.org/chemistry/empirical-formula-calculator.md",
  "kind": "function",
  "method": "moles = grams (or percent) ÷ atomic weight; ratio = moles ÷ smallest moles; multiply by the smallest k from 1 to 10 that brings every ratio within 0.1 of a whole number and round; n = round(molar mass ÷ empirical formula mass).",
  "assumptions": [
    "Atomic weights are the CIAAW abridged standard atomic weights (2024); elements with no standard atomic weight are not offered.",
    "A mass percent is read as the grams in a 100 g sample, so percents need not add up to exactly 100.",
    "A ratio counts as whole when it is within 0.1 of a whole number after multiplying; measurement error larger than that can give a different formula."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "basis": {
        "title": "Amounts are",
        "description": "Whether each amount is a percent by mass or a mass in grams.",
        "type": "string",
        "enum": [
          "percent",
          "grams"
        ]
      },
      "parts": {
        "title": "Elements",
        "description": "One row per element in the compound: the element and its amount.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "e": {
              "title": "Element",
              "description": "The element.",
              "type": "string",
              "enum": [
                "H",
                "He",
                "Li",
                "Be",
                "B",
                "C",
                "N",
                "O",
                "F",
                "Ne",
                "Na",
                "Mg",
                "Al",
                "Si",
                "P",
                "S",
                "Cl",
                "Ar",
                "K",
                "Ca",
                "Sc",
                "Ti",
                "V",
                "Cr",
                "Mn",
                "Fe",
                "Co",
                "Ni",
                "Cu",
                "Zn",
                "Ga",
                "Ge",
                "As",
                "Se",
                "Br",
                "Kr",
                "Rb",
                "Sr",
                "Y",
                "Zr",
                "Nb",
                "Mo",
                "Ru",
                "Rh",
                "Pd",
                "Ag",
                "Cd",
                "In",
                "Sn",
                "Sb",
                "Te",
                "I",
                "Xe",
                "Cs",
                "Ba",
                "La",
                "Ce",
                "Pr",
                "Nd",
                "Sm",
                "Eu",
                "Gd",
                "Tb",
                "Dy",
                "Ho",
                "Er",
                "Tm",
                "Yb",
                "Lu",
                "Hf",
                "Ta",
                "W",
                "Re",
                "Os",
                "Ir",
                "Pt",
                "Au",
                "Hg",
                "Tl",
                "Pb",
                "Bi",
                "Th",
                "Pa",
                "U"
              ]
            },
            "a": {
              "title": "Amount",
              "description": "The element’s mass percent, or its mass in grams.",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1000000000
            }
          }
        }
      },
      "mm": {
        "title": "Molar mass (g/mol)",
        "description": "The compound’s molar mass, to find the molecular formula. Leave empty to skip.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000
      }
    }
  },
  "outputs": {
    "formula": {
      "label": "Empirical formula",
      "description": "The simplest whole-number ratio of atoms, in Hill order (C, then H, then A to Z).",
      "format": "text"
    },
    "molecular": {
      "label": "Molecular formula",
      "description": "The empirical formula times the whole number n that matches the molar mass.",
      "format": "text"
    },
    "n": {
      "label": "Formula units per molecule (n)",
      "description": "Molar mass ÷ empirical formula mass, rounded to a whole number.",
      "format": "integer"
    },
    "mass": {
      "label": "Empirical formula mass (g/mol)",
      "description": "The sum of the atomic weights in the empirical formula.",
      "format": "number"
    },
    "ratios": {
      "label": "Mole ratios",
      "description": "Each element’s moles divided by the smallest, to 4 significant digits.",
      "format": "text"
    },
    "multiplier": {
      "label": "Ratios multiplied by",
      "description": "The smallest whole number, 1 to 10, that brings every ratio within 0.1 of a whole number.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "basis": "percent",
      "parts": [
        {
          "el": "C",
          "amt": 40
        },
        {
          "el": "H",
          "amt": 6.71
        },
        {
          "el": "O",
          "amt": 53.29
        }
      ]
    },
    "outputs": {
      "formula": "CH₂O",
      "mass": 30.026,
      "ratios": "C 1 : H 1.999 : O 1",
      "multiplier": 1
    },
    "text": "The empirical formula is CH₂O."
  },
  "examples": [
    {
      "given": {
        "basis": "grams",
        "parts": [
          {
            "el": "Fe",
            "amt": 34.97
          },
          {
            "el": "O",
            "amt": 15.03
          }
        ]
      },
      "expect": {
        "formula": "Fe₂O₃",
        "multiplier": 2,
        "mass": 159.687,
        "ratios": "Fe 1 : O 1.5"
      },
      "source": "OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: 34.97 g Fe and 15.03 g O give Fe₂O₃; Example 3.12: 27.29% C and 72.71% O give CO₂; Example 3.13: nicotine, 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol, gives C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: Fe 0.62620 mol, O 0.93943 mol, ratio 1 : 1.5002, × 2"
    },
    {
      "given": {
        "basis": "percent",
        "parts": [
          {
            "el": "C",
            "amt": 27.29
          },
          {
            "el": "O",
            "amt": 72.71
          }
        ]
      },
      "expect": {
        "formula": "CO₂",
        "multiplier": 1,
        "mass": 44.009
      },
      "source": "OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: 34.97 g Fe and 15.03 g O give Fe₂O₃; Example 3.12: 27.29% C and 72.71% O give CO₂; Example 3.13: nicotine, 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol, gives C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm"
    },
    {
      "given": {
        "basis": "percent",
        "parts": [
          {
            "el": "C",
            "amt": 74.02
          },
          {
            "el": "H",
            "amt": 8.71
          },
          {
            "el": "N",
            "amt": 17.27
          }
        ],
        "mm": 162.3
      },
      "expect": {
        "formula": "C₅H₇N",
        "molecular": "C₁₀H₁₄N₂",
        "n": 2,
        "mass": 81.118
      },
      "source": "OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: 34.97 g Fe and 15.03 g O give Fe₂O₃; Example 3.12: 27.29% C and 72.71% O give CO₂; Example 3.13: nicotine, 74.02% C, 8.710% H, 17.27% N, 162.3 g/mol, gives C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm; hand calculation in content.mdx: 5 × 12.011 + 7 × 1.0080 + 14.007 = 81.118"
    },
    {
      "given": {
        "basis": "percent",
        "parts": [
          {
            "el": "C",
            "amt": 40
          },
          {
            "el": "H",
            "amt": 6.71
          },
          {
            "el": "O",
            "amt": 53.29
          }
        ],
        "mm": 180.16
      },
      "expect": {
        "formula": "CH₂O",
        "molecular": "C₆H₁₂O₆",
        "n": 6,
        "mass": 30.026
      },
      "source": "hand calculation in content.mdx: C 3.3303, H 6.6567, O 3.3308 mol; ratio 1 : 2 : 1; 180.16 ÷ 30.026 = 6.0001; CIAAW, Abridged Standard Atomic Weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). https://ciaaw.org/abridged-atomic-weights.htm"
    }
  ],
  "sources": [
    "OpenStax, Chemistry 2e, §3.2 Determining Empirical and Molecular Formulas (Example 3.11: hematite, Fe₂O₃; Example 3.12: CO₂ from 27.29% C and 72.71% O; Example 3.13: nicotine, C₅H₇N and C₁₀H₁₄N₂). https://openstax.org/books/chemistry-2e/pages/3-2-determining-empirical-and-molecular-formulas (retrieved 2026-10-02)",
    "Commission on Isotopic Abundances and Atomic Weights (CIAAW), Abridged Standard Atomic Weights (2024). https://ciaaw.org/abridged-atomic-weights.htm (retrieved 2026-10-02)"
  ],
  "related": [
    "molar-mass",
    "mole",
    "stoichiometry",
    "percent-yield"
  ],
  "changelog": []
}
