# Stoichiometry Calculator

> Parses a balanced chemical equation, converts the given reactant masses or moles to moles, identifies the limiting reagent from mole-to-coefficient ratios and reports the theoretical yield (moles and grams) of every product and the amount of excess reactant left over.

- Calculator id: `stoichiometry` · Category: Chemistry (`chemistry`) · Tool name: `solve_stoichiometry`
- Canonical page: https://tttkmbb.com/chemistry/stoichiometry · This document: https://tttkmbb.com/chemistry/stoichiometry.md · JSON definition: https://tttkmbb.com/chemistry/stoichiometry.json

## Purpose

Parses a balanced chemical equation, converts the given reactant masses or moles to moles, identifies the limiting reagent from mole-to-coefficient ratios and reports the theoretical yield (moles and grams) of every product and the amount of excess reactant left over.

**Use when:** You have a balanced equation and the amount of one or two reactants and need the limiting reagent, the maximum product mass or moles, or how much of the other reactant remains.

**Do not use when:** You only need the molar mass of one substance (use molar-mass), a grams-to-moles conversion (use moles-mass), or the percent yield from a measured product mass (use percent-yield after this calculator).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `equation` | string |  | required | Balanced chemical equation with coefficients and formulas, e.g. 2H2 + O2 -> 2H2O or 3Si + 2N2 = Si3N4 (arrow: ->, =, →; states such as (aq) are ignored; write ion charges as Cu^2+ because Cu2+ is read as two copper atoms). An unbalanced equation is rejected. |
| `given_formula` | string |  | required | Formula of the reactant whose amount is known; must appear on the left side of the equation. |
| `given_mass_g` | number | g | optional | Mass of the given reactant in grams (alternative to given_moles). (> 0) |
| `given_moles` | number | mol | optional | Amount of the given reactant in moles; takes precedence over given_mass_g. (> 0) |
| `second_formula` | string |  | optional | Formula of a second reactant with a known amount, for limiting-reagent analysis. Omit to treat the given reactant as limiting. |
| `second_mass_g` | number | g | optional | Mass of the second reactant in grams (alternative to second_moles). (> 0) |
| `second_moles` | number | mol | optional | Amount of the second reactant in moles; takes precedence over second_mass_g. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `balanced_equation` | string |  | The parsed equation with its coefficients, confirming the atom balance. |
| `limiting_reagent` | string |  | Reactant with the smallest moles ÷ coefficient ratio among those with a known amount. |
| `limiting_reagent_moles` | number | mol | Amount of the limiting reagent available. |
| `extent_of_reaction_mol` | number | mol | ξ = moles of limiting reagent ÷ its coefficient; every species changes by coefficient × ξ. |
| `main_product` | string |  | First product in the equation, to which the theoretical-yield outputs refer. |
| `theoretical_yield_g` | number | g | Maximum mass of the main product. |
| `theoretical_yield_moles` | number | mol | Maximum moles of the main product. |
| `excess_reagent` | string |  | The other reactant with a known amount (only when second_formula is given). |
| `excess_remaining_moles` | number | mol | Moles of the excess reagent left after complete reaction. |
| `excess_remaining_g` | number | g | Mass of the excess reagent left after complete reaction. |
| `reactants` | list |  | Per reactant: formula, coefficient, molar mass, moles and mass consumed, and (when known) moles/mass available, moles/mass in excess and role. |
| `products` | list |  | Per product: formula, coefficient, molar mass, moles and mass formed (theoretical yields). |

## Formula

`n_i = mass_i / M_i; ξ = min over known reactants of n_i / ν_i (the reactant giving the minimum is limiting); moles_product = ν_product × ξ; theoretical_yield_g = ν_product × ξ × M_product; excess_remaining = n_excess − ν_excess × ξ`

Atom balance is checked with the same formula parser as molar-mass (charges are not balanced). Reactants without a stated amount are assumed to be in excess. Molar masses use IUPAC 2021 abridged atomic weights.

## Data Sources

- OpenStax Chemistry 2e – 4.3 Reaction Stoichiometry — https://openstax.org/books/chemistry-2e/pages/4-3-reaction-stoichiometry (textbook, retrieved 2026-09-24)
- OpenStax Chemistry 2e – 4.4 Reaction Yields — https://openstax.org/books/chemistry-2e/pages/4-4-reaction-yields (textbook, retrieved 2026-09-24)
- Wikipedia – Limiting reagent — https://en.wikipedia.org/wiki/Limiting_reagent (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/stoichiometry?equation=…&given_formula=…`
- `POST https://tttkmbb.com/api/v1/calculate/stoichiometry` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/stoichiometry · OpenAPI operationId `solve_stoichiometry` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "stoichiometry", "inputs": {…}}`

## Example

- 3Si + 2N2 -> Si3N4 with 2.00 g Si and 1.50 g N2: inputs `{"equation":"3Si + 2N2 -> Si3N4","given_formula":"Si","given_mass_g":2,"second_formula":"N2","second_mass_g":1.5}` → `{"limiting_reagent":"Si","limiting_reagent_moles":0.071212,"extent_of_reaction_mol":0.023737,"main_product":"Si3N4","theoretical_yield_g":3.33,"theoretical_yield_moles":0.023737,"excess_reagent":"N2","excess_remaining_moles":0.00607,"excess_remaining_g":0.17}`
- 2H2 + O2 -> 2H2O with 4.0 g H2 and 16.0 g O2: inputs `{"equation":"2H2 + O2 -> 2H2O","given_formula":"H2","given_mass_g":4,"second_formula":"O2","second_mass_g":16}` → `{"balanced_equation":"2 H2 + O2 → 2 H2O","limiting_reagent":"O2","theoretical_yield_g":18.016,"theoretical_yield_moles":1.00006,"excess_reagent":"H2","excess_remaining_g":1.9839,"excess_remaining_moles":0.98406}`

```
GET https://tttkmbb.com/api/v1/calculate/stoichiometry?equation=3Si+%2B+2N2+-%3E+Si3N4&given_formula=Si&given_mass_g=2&second_formula=N2&second_mass_g=1.5
```

## Limitations

You only need the molar mass of one substance (use molar-mass), a grams-to-moles conversion (use moles-mass), or the percent yield from a measured product mass (use percent-yield after this calculator). Atom balance is checked with the same formula parser as molar-mass (charges are not balanced). Reactants without a stated amount are assumed to be in excess. Molar masses use IUPAC 2021 abridged atomic weights. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if I only know the amount of one reactant?**

Omit second_formula: the given reactant is treated as limiting and the yields assume every other reactant is present in excess.

**Why is my equation rejected as unbalanced?**

Atom counts of every element must match on both sides, e.g. H2 + O2 -> H2O fails because oxygen is 2 on the left and 1 on the right. The error lists each element that differs; charges of ions are not checked.

**Which product does theoretical_yield_g refer to?**

The first product written in the equation (main_product); the products list gives the yield of every product.

## Related

- [Percent Yield Calculator](https://tttkmbb.com/chemistry/percent-yield.md) — Compare the measured product mass with this theoretical yield.
- [Molar Mass Calculator](https://tttkmbb.com/chemistry/molar-mass.md) — Molar mass and composition of any species in the equation.
- [Moles to Grams Calculator](https://tttkmbb.com/chemistry/moles-mass.md) — Plain grams-to-moles conversion for one substance.
