API & MCP

Everything a person can do on Molar Mass & Composition Calculator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Molar Mass & Composition Calculator

Type a chemical formula — with nested brackets, hydrate water, charges or isotopes — and get its molar mass from the current IUPAC standard atomic weights with the combined uncertainty, the formula in Hill order and the mass and atom percentage of every element. Up to ten formulas at once. The second mode turns mass percentages from an elemental analysis into the empirical formula and, with a molar mass, the molecular formula. Part of the Proofline math notebook.

Inputs of Molar Mass & Composition Calculator
FieldTypeDefaultDescription
modeselect (formula, empirical)"formula"Calculation
formulastextarea—Formulas (one per line). Element symbols with counts (H2O), brackets ( ) and [ ] that may nest (K4[Fe(CN)6]), hydrates with · or * or a dot (CuSO4·5H2O), charges at the end (SO4^2-, Fe+3, NH4+), isotopes (^13C, D, T) and state symbols such as (aq), which are ignored. At most 10 lines.
percentagestextarea—Mass percentages. Empirical formula: each element with its mass percentage, separated by commas or lines.
molarMassnumber—Molar mass of the compound (optional). Empirical formula: with a measured molar mass the molecular formula is the nearest whole multiple.

Example request

Water

curl -X POST https://prooflinemolarmass.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"formulas":"H2O"}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "proofline-molar-mass": { "type": "http", "url": "https://prooflinemolarmass.usefulweb.site/mcp" }
  }
}