{
  "id": "equilibrium-constant",
  "version": "ce4fb2aa6fa4",
  "status": "published",
  "name": "Equilibrium Constant Calculator",
  "question": "What is the equilibrium constant?",
  "summary": "Finds the equilibrium constant Kc or Kp of a reaction from the equilibrium concentrations or partial pressures and the balanced coefficients, and converts between Kc and Kp with Kp = Kc(RT)^Δn.",
  "category": "chemistry",
  "subcategory": "solutions",
  "url": "https://www.acalculator.org/chemistry/equilibrium-constant-calculator",
  "markdown": "https://www.acalculator.org/chemistry/equilibrium-constant-calculator.md",
  "kind": "function",
  "method": "K = product of (product amounts ^ coefficients) ÷ product of (reactant amounts ^ coefficients); Kp = Kc × (RT)^Δn with R = 8.31446261815324 ÷ 101.325 = 0.0820573660809597 L·atm/(mol·K) and Δn = gas moles of products − gas moles of reactants.",
  "assumptions": [
    "The amounts are equilibrium values; amounts away from equilibrium give the reaction quotient Q instead.",
    "Pure solids and liquids are left out (their activity is 1); concentrations and pressures stand for activities.",
    "Converting between Kc and Kp treats every listed species as a gas; Δn counts gas moles only."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "m": {
        "title": "Work from",
        "description": "Equilibrium amounts of every species, or a known Kc or Kp to convert.",
        "type": "string",
        "enum": [
          "amounts",
          "convert"
        ]
      },
      "k": {
        "title": "Amounts as",
        "description": "Concentrations in mol/L give Kc; partial pressures in atm give Kp. In Kc ⇄ Kp, the constant you know.",
        "type": "string",
        "enum": [
          "c",
          "p"
        ]
      },
      "species": {
        "title": "Reactants and products",
        "description": "One row per gas or dissolved species: reactant or product, its coefficient, and its equilibrium amount.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "s": {
              "title": "Side",
              "description": "Whether the species is a reactant or a product.",
              "type": "string",
              "enum": [
                "r",
                "p"
              ]
            },
            "n": {
              "title": "Coefficient",
              "description": "The species’ coefficient in the balanced equation.",
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            },
            "x": {
              "title": "Amount",
              "description": "The equilibrium concentration (mol/L) or partial pressure (atm).",
              "type": "number",
              "minimum": 1e-30,
              "maximum": 1000000
            }
          }
        }
      },
      "kv": {
        "title": "Known K",
        "description": "The equilibrium constant you know: Kc or Kp, as chosen above.",
        "type": "number",
        "minimum": 1e-100,
        "maximum": 1e+100
      },
      "dn": {
        "title": "Δn (gas moles)",
        "description": "Moles of gaseous products minus moles of gaseous reactants in the balanced equation.",
        "type": "integer",
        "minimum": -40,
        "maximum": 40
      },
      "t": {
        "title": "Temperature",
        "description": "The temperature, to convert between Kc and Kp; only when every listed species is a gas.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "temperature",
        "minimum": 0.000001,
        "maximum": 100000
      }
    }
  },
  "outputs": {
    "result": {
      "label": "Equilibrium constant",
      "description": "Kc or Kp, to 6 significant figures.",
      "format": "text"
    },
    "expression": {
      "label": "Working",
      "description": "Products’ amounts to their coefficients over reactants’ amounts to theirs.",
      "format": "text"
    },
    "kc": {
      "label": "Kc",
      "description": "The equilibrium constant in concentrations (mol/L).",
      "format": "number"
    },
    "kp": {
      "label": "Kp",
      "description": "The equilibrium constant in partial pressures (atm).",
      "format": "number"
    },
    "dnOut": {
      "label": "Δn",
      "description": "Moles of gaseous products minus moles of gaseous reactants.",
      "format": "integer"
    },
    "other": {
      "label": "Converted",
      "description": "The other constant from Kp = Kc × (RT)^Δn, with R = 0.0820574 L·atm/(mol·K).",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "m": "amounts",
      "k": "c",
      "species": [
        {
          "side": "r",
          "n": 2,
          "x": 0.016
        },
        {
          "side": "p",
          "n": 1,
          "x": 0.042
        }
      ],
      "kv": 0.28,
      "dn": -2
    },
    "outputs": {
      "result": "Kc = 164.063",
      "expression": "Kc = 0.042 ÷ 0.016² = 164.063",
      "kc": 164.0625,
      "dnOut": -1
    },
    "text": "The equilibrium constant is Kc = 164.063."
  },
  "examples": [
    {
      "given": {
        "m": "amounts",
        "k": "c",
        "species": [
          {
            "side": "r",
            "n": 2,
            "x": 0.016
          },
          {
            "side": "p",
            "n": 1,
            "x": 0.042
          }
        ]
      },
      "expect": {
        "kc": 164.0625,
        "expression": "Kc = 0.042 ÷ 0.016² = 164.063",
        "dnOut": -1
      },
      "source": "OpenStax, Chemistry 2e, §13.2 Equilibrium Constants (Qc and Kc; Kp = Kc(RT)^Δn), https://openstax.org/books/chemistry-2e/pages/13-2-equilibrium-constants, Example 13.2 (b): Kc = 0.042 ÷ (0.016)² = 1.6 × 10²; hand calculation in content.mdx"
    },
    {
      "given": {
        "m": "amounts",
        "k": "c",
        "species": [
          {
            "side": "r",
            "n": 2,
            "x": 0.9
          },
          {
            "side": "r",
            "n": 1,
            "x": 0.35
          },
          {
            "side": "p",
            "n": 2,
            "x": 1.1
          }
        ]
      },
      "expect": {
        "kc": 4.268077601410935
      },
      "source": "OpenStax, Chemistry 2e, §13.2 Equilibrium Constants (Qc and Kc; Kp = Kc(RT)^Δn), https://openstax.org/books/chemistry-2e/pages/13-2-equilibrium-constants, Check Your Learning after Example 13.2: Kc = 4.3; Python 3"
    },
    {
      "given": {
        "m": "amounts",
        "k": "c",
        "species": [
          {
            "side": "r",
            "n": 1,
            "x": 0.011
          },
          {
            "side": "r",
            "n": 1,
            "x": 0.0011
          },
          {
            "side": "p",
            "n": 1,
            "x": 0.037
          },
          {
            "side": "p",
            "n": 1,
            "x": 0.046
          }
        ]
      },
      "expect": {
        "kc": 140.6611570247934
      },
      "source": "OpenStax, Chemistry 2e, §13.2 Equilibrium Constants (Qc and Kc; Kp = Kc(RT)^Δn), https://openstax.org/books/chemistry-2e/pages/13-2-equilibrium-constants, Example 13.3 Predicting the Direction of Reaction, experiment 2: Qc = 1.4 × 10²; Python 3"
    },
    {
      "given": {
        "m": "convert",
        "k": "c",
        "kv": 0.28,
        "dn": -2,
        "t": 1173
      },
      "expect": {
        "kp": 0.000030222254735518405
      },
      "source": "OpenStax, Chemistry 2e, §13.2 Equilibrium Constants (Qc and Kc; Kp = Kc(RT)^Δn), https://openstax.org/books/chemistry-2e/pages/13-2-equilibrium-constants, Example 13.4 (d): Kp = 0.28 × [(0.0821)(1173)]⁻² = 3.0 × 10⁻⁵; Python 3 with the exact R",
      "tolerance": 1e-12
    },
    {
      "given": {
        "m": "convert",
        "k": "c",
        "kv": 0.0952,
        "dn": 2,
        "t": 500
      },
      "expect": {
        "kp": 160.25518960984226
      },
      "source": "OpenStax, Chemistry 2e, §13.2 Equilibrium Constants (Qc and Kc; Kp = Kc(RT)^Δn), https://openstax.org/books/chemistry-2e/pages/13-2-equilibrium-constants, Check Your Learning after Example 13.4 (d): Kp = 0.0952 × [(0.0821)(500)]² = 160; Python 3",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Chemistry 2e, §13.2 Equilibrium Constants: Qc and Kc for mA + nB ⇌ xC + yD, Qp, Kp = Kc(RT)^Δn, solids and liquids left out, Example 13.2 (2NO₂ ⇌ N₂O₄: Kc = 1.6 × 10²) and its Check Your Learning (Kc = 4.3), Example 13.3 (experiment 2: Qc = 1.4 × 10², reverse), Example 13.4 (d) (Kp = 3.0 × 10⁻⁵) and its Check Your Learning (d) (Kp = 160). https://openstax.org/books/chemistry-2e/pages/13-2-equilibrium-constants (retrieved 2026-10-19)",
    "OpenStax, Chemistry 2e, §16.4 Free Energy, Table 16.4: K above 1, products more abundant; below 1, reactants; equal to 1, comparable. https://openstax.org/books/chemistry-2e/pages/16-4-free-energy (retrieved 2026-10-19)",
    "NIST, CODATA 2022 value: molar gas constant R = 8.314 462 618… J/(mol·K), exact. https://physics.nist.gov/cgi-bin/cuu/Value?r (retrieved 2026-10-19)"
  ],
  "related": [
    "ksp",
    "gibbs-free-energy",
    "ph",
    "partial-pressure"
  ],
  "changelog": []
}
