{
  "id": "formal-charge",
  "version": "3cfe514f4c76",
  "status": "published",
  "name": "Formal Charge Calculator",
  "question": "What is the formal charge?",
  "summary": "Finds the formal charge on an atom in a Lewis structure from its valence electrons, lone-pair electrons and bonds: FC = valence electrons − lone-pair electrons − ½ × bonding electrons.",
  "category": "chemistry",
  "subcategory": "atoms",
  "url": "https://www.acalculator.org/chemistry/formal-charge-calculator",
  "markdown": "https://www.acalculator.org/chemistry/formal-charge-calculator.md",
  "kind": "function",
  "method": "Formal charge = valence electrons of the free atom − lone-pair (nonbonding) electrons − ½ × bonding electrons; ½ × bonding electrons is the number of bonds (a double bond counts 2).",
  "assumptions": [
    "Main-group atoms (groups 1, 2 and 13 to 18) of periods 1 to 6; the valence electrons of the free atom follow the group: 1, 2, then 3 to 8 for groups 13 to 18, and 2 for helium.",
    "Each bond is one shared electron pair; the atom is assigned all of its lone-pair electrons and half of its bonding electrons.",
    "Formal charge is bookkeeping for comparing Lewis structures, not a measured charge."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "atom": {
        "title": "Atom",
        "description": "The atom whose formal charge you want; its valence electrons follow its group.",
        "type": "string",
        "enum": [
          "H",
          "He",
          "Li",
          "Be",
          "B",
          "C",
          "N",
          "O",
          "F",
          "Ne",
          "Na",
          "Mg",
          "Al",
          "Si",
          "P",
          "S",
          "Cl",
          "Ar",
          "K",
          "Ca",
          "Ga",
          "Ge",
          "As",
          "Se",
          "Br",
          "Kr",
          "Rb",
          "Sr",
          "In",
          "Sn",
          "Sb",
          "Te",
          "I",
          "Xe",
          "Cs",
          "Ba",
          "Tl",
          "Pb",
          "Bi",
          "Po",
          "At",
          "Rn"
        ]
      },
      "lp": {
        "title": "Lone-pair electrons",
        "description": "Nonbonding electrons on the atom in the Lewis structure: the dots, 2 for each lone pair.",
        "type": "integer",
        "minimum": 0,
        "maximum": 8
      },
      "b": {
        "title": "Bonds to the atom",
        "description": "Shared electron pairs between this atom and its neighbours: a single bond counts 1, a double bond 2, a triple bond 3.",
        "type": "integer",
        "minimum": 0,
        "maximum": 8
      }
    }
  },
  "outputs": {
    "charge": {
      "label": "Formal charge",
      "description": "The formal charge, with its sign.",
      "format": "text"
    },
    "fc": {
      "label": "Formal charge (number)",
      "description": "The formal charge as a signed whole number.",
      "format": "integer"
    },
    "working": {
      "label": "Working",
      "description": "Valence electrons minus lone-pair electrons minus half the bonding electrons.",
      "format": "text"
    },
    "valence": {
      "label": "Valence electrons (free atom)",
      "description": "The valence electrons of the neutral atom: its group number’s last digit (helium 2).",
      "format": "integer"
    },
    "bondingElectrons": {
      "label": "Bonding electrons",
      "description": "Electrons in the atom’s bonds: 2 per bond.",
      "format": "integer"
    },
    "assigned": {
      "label": "Electrons assigned to the atom",
      "description": "Its lone-pair electrons plus one electron from each bond.",
      "format": "integer"
    },
    "name": {
      "label": "Atom",
      "description": "The atom’s name and symbol.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "atom": "I",
      "lp": 4,
      "b": 4
    },
    "outputs": {
      "charge": "−1",
      "fc": -1,
      "working": "FC = 7 − 4 − ½ × 8 = −1",
      "valence": 7,
      "bondingElectrons": 8,
      "assigned": 8,
      "name": "iodine (I)"
    },
    "text": "The formal charge on iodine (I) is −1."
  },
  "examples": [
    {
      "given": {
        "atom": "I",
        "lp": 4,
        "b": 4
      },
      "expect": {
        "fc": -1,
        "charge": "−1",
        "assigned": 8
      },
      "source": "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance (formal charge = valence electrons − lone-pair electrons − ½ bonding electrons), https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance, Example 7.6 Calculating Formal Charge from Lewis Structures: I: 7 − 8 = −1"
    },
    {
      "given": {
        "atom": "Cl",
        "lp": 6,
        "b": 1
      },
      "expect": {
        "fc": 0,
        "assigned": 7
      },
      "source": "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance (formal charge = valence electrons − lone-pair electrons − ½ bonding electrons), https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance, Example 7.6: Cl: 7 − 7 = 0"
    },
    {
      "given": {
        "atom": "C",
        "lp": 2,
        "b": 3
      },
      "expect": {
        "fc": -1,
        "working": "FC = 4 − 2 − ½ × 6 = −1"
      },
      "source": "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance (formal charge = valence electrons − lone-pair electrons − ½ bonding electrons), https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance, Check Your Learning after Example 7.6 (CO): C −1"
    },
    {
      "given": {
        "atom": "O",
        "lp": 2,
        "b": 3
      },
      "expect": {
        "fc": 1,
        "charge": "+1"
      },
      "source": "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance (formal charge = valence electrons − lone-pair electrons − ½ bonding electrons), https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance, Check Your Learning after Example 7.6 (CO): O +1"
    },
    {
      "given": {
        "atom": "Br",
        "lp": 4,
        "b": 3
      },
      "expect": {
        "fc": 0
      },
      "source": "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance (formal charge = valence electrons − lone-pair electrons − ½ bonding electrons), https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance, Example 7.7: Br: 7 − 7 = 0"
    },
    {
      "given": {
        "atom": "N",
        "lp": 2,
        "b": 3
      },
      "expect": {
        "fc": 0,
        "valence": 5
      },
      "source": "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance (formal charge = valence electrons − lone-pair electrons − ½ bonding electrons), https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance, Check Your Learning after Example 7.7 (NCl₃): N 0"
    }
  ],
  "sources": [
    "OpenStax, Chemistry 2e, §7.4 Formal Charges and Resonance: the formal charge formula, the counting steps, the sum rule, the guidelines for the most likely structure, Example 7.6 (ICl₄⁻: I −1, Cl 0) and its Check Your Learning (CO: C −1, O +1), Example 7.7 (BrCl₃: all 0) and its Check Your Learning (NCl₃: all 0). https://openstax.org/books/chemistry-2e/pages/7-4-formal-charges-and-resonance (retrieved 2026-10-19)",
    "OpenStax, Chemistry 2e, §6.4 Electronic Structure of Atoms (Electron Configurations): main-group valence electrons are those in the highest shell, and elements in one group have the same number of valence electrons. https://openstax.org/books/chemistry-2e/pages/6-4-electronic-structure-of-atoms-electron-configurations (retrieved 2026-10-19)"
  ],
  "related": [
    "valence-electrons",
    "oxidation-number",
    "electronegativity",
    "bond-order"
  ],
  "changelog": []
}
