Food calorie density calculator
A 100 g portion with 250 kcal has a calorie density of 2.5 kcal per gram, or 250 kcal per 100 g. Enter the calories and the edible weight of a portion to compare how energy-packed different foods are. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Daily calories
- 250
- Weight g
- 100
- Calorie density kcal g
- 2.5 kcal/g
- Calorie density kcal 100g
- 250
This food calorie density calculator turns a single portion into a clear calories-per-gram figure so you can compare how filling or energy-packed different foods really are. Calorie density is simply total kilocalories divided by edible weight in grams; a low number means more volume for the same energy, which is why salads and broths feel bulkier than oils and nuts at the same calorie budget. Enter non-negative calories from a label, recipe, or meal log, plus a positive weight in grams from a kitchen scale, and the engine returns density in kcal per gram and the familiar kcal per one hundred grams scale used on packaging.
What calorie density means and what the calculator returns
Calorie density answers a practical kitchen question: how many kilocalories sit in each gram of edible food. Nutrition educators often talk about high-density foods such as oils, cheese, and dried fruit, and low-density foods such as vegetables, fruit with high water content, and clear soups. The mathematics behind that language is a single ratio.
You supply the total energy of a portion in kilocalories, often printed on a package as Calories with a capital C, and the weight of the edible part in grams after peeling, draining, or cooking losses if you care about what is actually eaten. There is no ingredient lookup, no macro-to-calorie conversion, and no volume-to-mass step: if you only know cups or tablespoons, convert weight first with a scale or a dedicated unit tool.
Invalid cases include missing fields, non-finite numbers, negative calories, and any weight that is zero or negative, because density is undefined when mass cannot divide energy in a physical portion. The design stays intentional and documented so two clients never disagree about how a logged meal becomes a density figure when they share this contract.
Where food calorie density fits in cooking, meal prep, and software
Home cooks use calorie density when comparing a snack of nuts against a bowl of berries at roughly the same energy budget, or when deciding whether a prepared sauce makes a plate denser than the plain protein and vegetables underneath. Meal-prep and weight-management logs convert each line item into kcal per gram so weekly averages stay comparable even when portion sizes change day to day. Culinary students and dietetics workshops grade density classifications without trusting opaque mobile apps that may round differently or silently swap food Calories for kilojoules.
Product teams call the same contract from scripts to seed deterministic test vectors for nutrition importers, to normalize user-entered plate fields before ranking recipes by density, or to satisfy programming-challenge statements that demand a documented ratio rather than a hand-waved label glance.
What you can do with it
Compare snacks by energy per gram
Enter label calories and scale weight to rank nuts, chips, fruit, and yogurt by calorie density before packing a lunch.
Normalize meal-prep log lines
Convert each prepared portion into kcal/g and kcal/100g so weekly density averages stay comparable across different serving sizes.
FAQ
What does the food calorie density calculator cost?
It is free in your browser on this page.
What happens if weight is zero or negative?
Weight must be a finite positive number because density is undefined for non-positive mass.
Can calories be zero?
Yes. Zero calories with a positive weight yields zero density, which is valid for plain water or similar zero-energy portions.
Does this look up foods in a database?
No. You supply total calories and weight; the engine only divides. Use a nutrition database or label first if you do not already know those numbers.
Which foods have a high or a low calorie density?
Oils, cheese and dried fruit are high; vegetables, watery fruit and clear soups are low. A low number means more food for the same energy, which is why a salad feels bulkier than nuts with the same calories.
Related tools
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/cook/calorie-density \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"calories":250,"weight_g":100}'const res = await fetch("https://api.kit.forhosting.com/cook/calorie-density", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"calories": 250,
"weight_g": 100
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/cook/calorie-density",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"calories": 250,
"weight_g": 100
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/cook/calorie-density", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"calories":250,"weight_g":100}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"calories":250,"weight_g":100}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/cook/calorie-density", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"calories": 250,
"weight_g": 100
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "cook.calorie_density",
"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. |
Technical notes
Use it free in the browser while planning plates, or call the API at $0.002 per successful request when your product must compute density without re-implementing the division.
What calorie density means and what the calculator returns
This tool divides calories by weight_g to produce calorie_density_kcal_g, multiplies that result by one hundred for calorie_density_kcal_100g so you can read numbers the way European and many North American labels present them, and echoes both inputs with a short formula string and unit tag kcal/g. Failed validation returns invalid_input with a clear message and is not charged.
How calories and weight_g are read so results stay reproducible
Optional leading plus signs and scientific notation on numeric strings are accepted when they parse as finite decimals; embedded spaces, hex prefixes, booleans, and non-numeric tokens are rejected so a bad cell does not become a silent wrong density. Zero calories with a positive weight is valid and yields zero density, which correctly describes water, plain tea without sugar, or a diet soda with a rounded zero on the label. Negative zero is collapsed to plain zero. The preferred fields are calories for total energy and weight_g for edible mass in grams. Aliases such as energy, kcal, energy_kcal, total_calories, and total_kcal map to calories; weight, mass_g, mass, grams, and portion_g map to weight_g, so spreadsheets, query strings, and typed forms can reuse the same contract without renaming columns. Weight must be strictly positive: zero and negative masses throw invalid_input because you cannot form a density for a non-existent or inverted portion. Computation performs one division and one scale-by-one-hundred step, then cleans floats with stable precision so JSON goldens compare byte-for-byte across runtimes. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the density formula yourself.
Where food calorie density fits in cooking, meal prep, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a kitchen demo to an automated pipeline without changing the mathematical result. Pair it with macro energy or unit converters when you need those intents, and keep this endpoint when the search is specifically food calorie density as calories per gram from total calories and weight.
Integration use cases
Deterministic nutrition test fixtures
Generate reproducible calorie-density vectors for unit tests, recipe importers, and CI without re-coding the division.
Technical questions
How is calorie density calculated?
calorie_density_kcal_g = calories / weight_g. The response also includes calorie_density_kcal_100g = density × 100 for label-style comparison.