API & MCP

Everything a person can do on Solution, Gas Law & pH Calculator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Solution, Gas Law & pH Calculator

One calculator for the everyday quantities of solution chemistry, with units you type yourself (250 mL, 0.1 M, 25 °C, 1 atm): molarity from mass and volume or any of the three from the other two, dilutions with C1·V1 = C2·V2, mass, moles and particles of a formula, the ideal gas law solved for any variable with Dalton partial pressures of a mixture, and the pH of strong and weak acids and bases (exact quadratic and full charge balance) and of buffers (Henderson–Hasselbalch checked against the exact result). Part of the Proofline math notebook.

Inputs of Solution, Gas Law & pH Calculator
FieldTypeDefaultDescription
modeselect (molarity, dilution, amount, gas, ph)"molarity"Calculation
formulatext—Formula of the solute or gas. Gives the molar mass for conversions between mass and moles (molarity, amount, gas).
molarMassnumber—Molar mass (instead of a formula)
solutetext—Solute (mass or amount). Molarity: leave exactly one of solute, volume and concentration empty — that one is calculated.
volumetext—Volume of solution. Molarity: the final volume of the solution in L, mL, µL, dm3 or cm3.
concentrationtext—Concentration. Molarity: M, mM, µM, mol/L or g/L.
c1text—C1 (stock concentration)
v1text—V1 (volume of stock)
c2text—C2 (final concentration)
v2text—V2 (final volume). Dilution: leave exactly one of C1, V1, C2 and V2 empty.
quantitytext—Quantity. A mass (g), an amount (mol) or a number of particles (1.5e23 molecules).
pressuretext—Pressure. Pa, kPa, bar, atm, mmHg, torr or psi. Gas law: leave exactly one of pressure, volume, amount and temperature empty.
gasVolumetext—Volume of gas. L, mL or m3.
temperaturetext—Temperature. K, °C or °F.
gasAmounttext—Amount of gas. mol, or a mass with the formula. Leave empty to use the sum of the mixture.
mixturetextarea—Gas mixture (optional). Each gas with an amount or a mass: mole fractions and partial pressures (Dalton’s law).
solutionTypeselect (strong-acid, strong-base, weak-acid, weak-base, buffer)"weak-acid"Solution
phConcentrationtext—Acid or base concentration. pH: the concentration of the acid or base; for a buffer the concentration of the weak acid HA. M, mM or mol/L.
constanttext—Ka, pKa, Kb or pKb. A bare number is Ka for acids and buffers and Kb for bases; write pKa 4.76 or Kb 1.8e-5 to be explicit.
conjugatetext—Conjugate base concentration (buffer)
equivalentsinteger1H⁺ or OH⁻ per formula unit (strong). For example 2 for Ba(OH)2.

Example request

Molarity of 5.844 g NaCl in 250 mL

curl -X POST https://prooflinesolutioncalculator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"molarity","formula":"NaCl","solute":"5.844 g","volume":"250 mL"}'

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-solution-calculator": { "type": "http", "url": "https://prooflinesolutioncalculator.usefulweb.site/mcp" }
  }
}