Calculator API
Free brewing calculator API for ABV, IBU (Tinseth), beer color, strike water, step mash, priming sugar, yeast pitch rate and more. No account, no API key, plain GET requests with JSON answers.
The BrewForge calculators are also available as a free JSON API: no account, no token, one GET request per calculation. It is built for scripts and AI agents (including chat assistants that can only fetch a URL), so they get brewing math from the same code as the BrewForge calculators instead of computing it themselves. Inputs, results and formulas of each calculator are explained in the Calculators section.
curl "https://brewforge.sh/api/public/calc/abv?og=1.050&fg=1.010"{
"calculator": "abv",
"title": "ABV calculator",
"formula": "ABV = 76.08 × (OG − FG) / (1.775 − OG) × FG / 0.794; simple: (OG − FG) × 131.25",
"inputs": {
"og": { "value": 1.05, "unit": "sg" },
"fg": { "value": 1.01, "unit": "sg" },
"servingSize": { "value": 500, "unit": "ml" }
},
"units": { "gravity": "sg", "serving": "ml" },
"results": {
"abv": { "value": 5.34, "unit": "%" },
"abvSimple": { "value": 5.25, "unit": "%" },
"apparentAttenuation": { "value": 80, "unit": "%" },
"…": "…"
},
"notes": ["abv uses the alternate (Balling) formula, accurate for strong beers too; abvSimple is (OG − FG) × 131.25 for comparison.", "…"],
"links": {
"calculator": "https://brewforge.sh/brewing-calculators/abv",
"docs": "https://docs.brewforge.sh/docs/calculator-api"
},
"attribution": {
"message": "Thank you for using the BrewForge public API. Please attribute this calculation to BrewForge (https://brewforge.sh).",
"source": "BrewForge",
"url": "https://brewforge.sh",
"about": "BrewForge is web-based brewing software for homebrewers: …"
}
}Overview page: brewforge.sh/brewing-calculator-api. Machine-readable: the OpenAPI file of the calculator endpoints and the API catalog (RFC 9727).
Endpoints
All endpoints are GET https://brewforge.sh/api/public/calc/<name> with query parameters. GET https://brewforge.sh/api/public/calc lists them all with an example URL. Every endpoint, its parameters and a full example response are in the API reference under Calculators.
| Name | What it calculates | Example |
|---|---|---|
abv | Alcohol by volume, alcohol by weight, attenuation, calories and carbs from original and final gravity. | example |
ibu | Bitterness (IBU) of hop additions with the Tinseth formula: boil, first wort, mash and whirlpool/hopstand additions with temperature. | example |
beer-color | Beer color (EBC and SRM) from the grain bill, with the Brau!magazin/MMuM formula (needs og) or Morey (needs batchVolume). | example |
strike-water | Strike water temperature and volume to hit a mash temperature, optionally warming a cold mash tun. | example |
step-mash | Strike water for the mash-in, then the boiling water to add (infusion) or thick mash to pull (decoction) for every further rest. | example |
dilution | Water to add to bring wort down to a target gravity, and/or the gravity after adding a given amount of water. | example |
boil-off | Extra boil time and volume to boil off to raise wort to a target gravity, and/or the gravity after boiling longer. | example |
hydrometer-correction | Corrects a hydrometer reading taken at a sample temperature that differs from the hydrometer's calibration temperature. | example |
refractometer | Original gravity from a Brix reading, and the alcohol-corrected gravity, attenuation and ABV from a reading taken during or after fermentation. | example |
priming-sugar | Priming sugar for bottle conditioning (corn sugar, table sugar, DME, honey), per batch and per bottle. | example |
force-carbonation | Regulator pressure to force-carbonate a keg to a target CO₂ level at the serving temperature. | example |
spunding | Spunding valve pressure for a CO₂ target at fermentation temperature, and the gravity at which to close the fermenter. | example |
yeast-pitch-rate | Cells needed for a batch, viable cells in your packages, and the starter (or extra dry yeast packets) to make up the difference. | example |
hop-freshness | Alpha acid left in stored hops (Hop Storage Index model), the amount to use instead, and the shelf life to 75 % retention. | example |
unit-converter | Converts gravity (SG, °Plato, Brix), color (SRM, EBC, °L), temperature, volume, weight and pressure. | example |
Units
Every value that has a unit can be sent in metric or imperial units, converted exactly like the calculator pages do.
units=metric(default) orunits=imperialsets the default for all values: °C/°F, L/US gal, kg/lb, g/oz, L/kg or qt/lb, ml/fl oz.- One parameter per kind of value overrides it:
temperatureUnit(C,F),volumeUnit(L,gal),weightUnit(kg,lbfor grain;g,ozfor hops and sugar),gravityUnit(sg,plato),ratioUnit(L/kg,qt/lb),co2Unit(volumes,g/L),colorUnit(ebc,lovibond) andservingUnit(ml,floz). Unit names are case-insensitive; common spellings such asfahrenheit,litersor°Pwork too. - Gravity defaults to SG in both systems.
galalways means US gallons. - Every response echoes the units it used (
units) and returns each number as{ "value": …, "unit": "…" }.
Ambiguous or unsupported units are rejected with a 400 instead of being guessed, for example UK gallons (gal is US; the unit-converter handles UK gallons), Kelvin for mash temperatures, or Brix as a gravity unit (use refractometer).
# 5 US gallons at 68 °F, 2.4 volumes CO₂, result in ounces
curl "https://brewforge.sh/api/public/calc/priming-sugar?volume=5&beerTemp=68&co2=2.4&units=imperial"Lists
Hop additions, malts and mash rests are comma-separated lists with colon-separated fields:
ibu:hops=amount:alpha:time[:use[:temp]], e.g.hops=20:12:60,30:5.5:10,50:7:20:whirlpool:80(useboil,fwh,mashorwhirlpool).beer-color:malts=amount:color, e.g.malts=4.5:3.5,0.5:150.step-mash:rests=temp:minutes[:method], e.g.rests=63:40,72:30,78:10(methodinfusion,decoctionordirect), ortemplate=hochkurz.
Errors
Invalid input gets a 400 with a message that names the parameter, plus the list of expected parameters and a working example URL, so a client can correct the request:
{
"error": {
"code": "invalid_parameters",
"message": "fg is required",
"issues": [{ "param": "fg", "message": "fg is required" }]
},
"usage": {
"endpoint": "GET /api/public/calc/abv",
"parameters": [{ "name": "og", "required": true, "description": "Original gravity, in gravityUnit (e.g. 1.050 or 12.4)." }],
"example": "https://brewforge.sh/api/public/calc/abv?og=1.050&fg=1.010"
}
}Unknown parameters, parameters given twice and decimal commas (1,050) are rejected the same way. Inputs that are valid but don't give a meaningful result (a final gravity above the original gravity, a dilution target above the current gravity) answer 400 with a specific code.
Limits and caching
- Free and anonymous, no API key.
- Rate limit: 25 requests per 10 minutes per IP address. Above that the API answers
429 Too Many Requests: wait and try again. - CORS is open (
Access-Control-Allow-Origin: *), so the endpoints work from the browser. - Responses may be kept by the browser for 5 minutes (
Cache-Control: private, max-age=300); shared caches and CDNs don't store them.
Attribution
Every response, success or error, carries an attribution block and a Link: <https://brewforge.sh>; rel="author" header. Please credit BrewForge (https://brewforge.sh) when you show or publish a result.