Compare cost per serving for two recipes
A lower total recipe cost does not always mean a lower cost per serving. This calculator puts two recipes on equal terms by dividing each total cost by the number of servings it produces.
Run — free
It then shows the signed and absolute difference and identifies the cheaper recipe. Use it for meal planning, catering quotes, menu decisions, or any comparison where batch sizes differ. Enter costs in the same currency and use comparable serving definitions for a meaningful result.
Enter comparable totals and serving counts
Start with the complete batch cost for recipe A and recipe B. Each total should cover the same categories of expense. For example, do not include packaging in one recipe while entering ingredients alone for the other. Then enter how many servings each full batch actually produces. A serving may represent one plate, one container, one slice, or another consistent portion, but the definition must match across both recipes. Serving counts must be greater than zero because division by zero cannot produce a usable unit cost. Total costs may be zero, which can be useful for donated ingredients or test scenarios, but they cannot be negative. Use the same currency for both totals. The calculator does not perform currency conversion or infer whether a cost is in dollars, euros, or another unit. Accurate inputs make the result suitable for budgeting; inconsistent accounting or portion sizes can make a mathematically correct comparison misleading. Decimal costs and serving counts are accepted when your planning method uses them.
Read the per-serving values and difference
The calculator divides recipe A's total cost by its serving count, then repeats the same operation for recipe B. These normalized values are the fairest basis for comparing batches of different sizes. The signed cost-per-serving difference is calculated as recipe A minus recipe B. A negative difference means A costs less per serving, a positive difference means B costs less, and zero means they tie at the displayed precision. The absolute difference reports the size of the gap without a sign, which is convenient when you only need to know how far apart the choices are. The cheaper recipe field states A, B, or tie so that automated workflows do not need to interpret the sign themselves. Results are rounded consistently to twelve decimal places to avoid distracting floating-point noise while retaining useful precision. The original totals and serving counts are also returned alongside each normalized value, making the output easy to review or store with a decision record.
Turn a unit-cost comparison into a decision
Cost per serving is a useful baseline, but it should be combined with practical context. A recipe that is slightly cheaper may require more preparation time, specialized equipment, expensive storage, or ingredients with a shorter shelf life. Likewise, servings must reflect what people actually receive rather than an optimistic yield printed on a package. For catering, compare recipes using your planned plated portion and include every cost category required by the quote. For household meal planning, you might compare the same dish from two stores, two batch sizes, or homemade and prepared versions. For menu development, the absolute difference can be multiplied by expected sales to estimate the effect of choosing one recipe, though that projection is outside this calculator and should account for waste. Save the inputs with the result so future reviewers know what was included. The calculation is deterministic, uses no network service, and produces the same output for the same input, making it appropriate for repeatable spreadsheets, scripts, and approval workflows.
What you can do with it
Compare catering recipes
Normalize two differently sized batches before selecting the more economical option for a quote.
Plan a household meal budget
Compare homemade, prepared, or alternative recipes even when their stated yields are different.
Evaluate menu alternatives
Measure the per-portion gap between two menu recipes before considering labor, waste, and margin.
FAQ
What does the comparison cost?
The API price is $0.002 per request. The browser calculator is available on this page.
How is the difference calculated?
The signed difference is recipe A's cost per serving minus recipe B's cost per serving.
Can the two recipes have different batch sizes?
Yes. Different batch sizes are the main reason to compare cost per serving instead of total cost.
What happens if a serving count is zero or negative?
The request returns an invalid-input error because a cost per serving requires a positive serving count.
Does the calculator convert currencies?
No. Enter both total costs in the same currency so the comparison is meaningful.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/recipe-cost-per-serving-compare \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"recipe_a_total_cost":24,"recipe_a_servings":8,"recipe_b_total_cost":18,"recipe_b_servings":4}'const res = await fetch("https://api.kit.forhosting.com/math/recipe-cost-per-serving-compare", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"recipe_a_total_cost": 24,
"recipe_a_servings": 8,
"recipe_b_total_cost": 18,
"recipe_b_servings": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/recipe-cost-per-serving-compare",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"recipe_a_total_cost": 24,
"recipe_a_servings": 8,
"recipe_b_total_cost": 18,
"recipe_b_servings": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/recipe-cost-per-serving-compare", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"recipe_a_total_cost":24,"recipe_a_servings":8,"recipe_b_total_cost":18,"recipe_b_servings":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"recipe_a_total_cost":24,"recipe_a_servings":8,"recipe_b_total_cost":18,"recipe_b_servings":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/recipe-cost-per-serving-compare", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"recipe_a_total_cost": 24,
"recipe_a_servings": 8,
"recipe_b_total_cost": 18,
"recipe_b_servings": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.recipe_cost_per_serving_compare",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |