Dietary energy density calculator
Turns a meal's calories and weight into one comparable figure: 450 kcal on a 350 g plate is about 128.57 kcal per 100 g. Compare soups, snacks and recipes by concentration, not just by total calories. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Energy kcal
- 450
- Mass g
- 350
- Energy density kcal g
- 1.2857142857 kcal/g
- Energy density kcal 100g
- 128.571428571
- Energy density kj g
- 5.3794285714
Dietary energy density is how many kilocalories sit in each gram of a meal or portion—the figure that turns a plate’s total energy and plated mass into a single intensive number you can compare across recipes, cafeteria trays, and research menus. This dietary energy density calculator takes total meal energy in kilocalories and edible mass in grams, divides energy by mass, and returns kilocalories per gram, the familiar kilocalories per one hundred grams used on many food labels, and kilojoules per gram for SI reporting.
What dietary energy density measures and why it matters
Energy density is total metabolizable energy divided by edible mass. A watery vegetable soup can deliver hundreds of grams with modest kilocalories and therefore a low kcal-per-gram figure, while a nut mix or fried snack packs many kilocalories into little mass and scores high. Nutrition research and clinical teaching often group foods into density bands so clients can fill a plate with lower-density items when satiety per calorie is the goal, or choose higher-density options when energy needs are high and volume is limited.
Energy must be non-negative and mass must be strictly positive; zero mass is rejected because density would be undefined and would hide a missing weigh-in. The result is intensive: doubling both energy and mass leaves density unchanged, which is exactly what you want when scaling a recipe while checking that the concentration profile stayed the same.
Who uses meal energy density, and how
Diet coaching platforms already store plate energy and weighed portions; dividing once server-side keeps every client and report on one definition of kcal per gram instead of diverging spreadsheet cells. Research coordinators convert weighed-food diaries into density columns without re-implementing floating-point cleanup in three languages. Cafeteria and meal-kit engineering teams rank menu items by concentration for satiety messaging or high-energy packs for athletes and clinical supplemental feeding.
Label and menu tools can show both kcal/g and kcal/100g beside total energy so shoppers and patients see concentration, not only absolute calories. Failed validation does not consume balance.
What you can do with it
Compare plates by kcal per gram
Weigh a plated meal, sum its energy from labels or macros, and obtain energy density so lower- and higher-concentration options sort on one intensive scale.
Menu and meal-kit density checks
Batch-compute energy density for recipes when engineering satiety-focused menus or compact high-energy packs without re-coding the division in every client.
FAQ
How is dietary energy density calculated?
The response also multiplies by 100 for kcal/100g and by 4.184 for kJ/g.
Is this the same as calories from macronutrients?
No. Calories-from-macros estimates total energy from protein, carb, fat, and alcohol grams. This calculator assumes you already know total energy and mass and only computes density.
Which foods have a low energy density?
Watery foods such as a vegetable soup give many grams for modest calories, so they score low, while a nut mix or a fried snack packs many calories into little weight and scores high. The calculator gives the number; it does not label foods or recommend a diet.
Why does doubling a recipe not change its energy density?
Because density is a ratio: twice the calories over twice the weight gives the same kcal per gram. That makes it handy for checking that a scaled-up recipe kept the same concentration.
What weight should I enter for a meal?
Enter the edible weight of the portion in grams, the same portion whose calories you added up. The weight must be above zero, because density cannot be worked out without it and a zero usually means a missing weigh-in.
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/health/energy-density-diet \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"energy_kcal":450,"mass_g":350}'const res = await fetch("https://api.kit.forhosting.com/health/energy-density-diet", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"energy_kcal": 450,
"mass_g": 350
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/health/energy-density-diet",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"energy_kcal": 450,
"mass_g": 350
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/health/energy-density-diet", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"energy_kcal":450,"mass_g":350}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"energy_kcal":450,"mass_g":350}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/health/energy-density-diet", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"energy_kcal": 450,
"mass_g": 350
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "health.energy_density_diet",
"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
What dietary energy density measures and why it matters
This calculator does not classify bands or recommend diets: it only evaluates the ratio energy_kcal divided by mass_g and presents related units so you can compare plates on one scale.
Input contract, response fields, and validation errors
Negative energy is rejected; mass must be positive, so zero or negative mass fails with a clear message that density cannot be computed without a positive mass. Missing either required field also fails and is not billed. Example: four hundred fifty kilocalories over three hundred fifty grams yields roughly one point two eight six kilocalories per gram and about one hundred twenty-eight point six kilocalories per one hundred grams. POST a JSON object with two required fields. energy_kcal is total meal or food energy in kilocalories (food Calories); aliases energy, calories, kcal, total_kcal, and total_energy are accepted so trackers and forms can reuse existing keys. mass_g is edible portion mass in grams; aliases mass, weight_g, grams, portion_g, and weight are accepted. Values may arrive as JSON numbers or numeric strings; empty strings, booleans, objects, NaN, and Infinity fail with invalid_input naming the field. On success the response echoes cleaned energy_kcal and mass_g, returns energy_density_kcal_g as energy divided by mass, energy_density_kcal_100g as that value times one hundred for label-style display, energy_density_kj_g as kcal-per-gram times four point one eight four, a short formula string, and unit set to kcal/g for the primary density figure. Pair the free browser check with API automation when the same density must appear in a backend log or meal-plan report.
Integration use cases
Audit meal plans and research diaries
Convert logged total_kcal and portion grams into kcal/g and kcal/100g with a deterministic API contract for coaching reports and study tables.
Technical questions
What inputs does the dietary energy density calculator need?
Two required finite numbers: energy_kcal (non-negative total kilocalories) and mass_g (positive edible mass in grams). Common aliases such as calories and weight_g are accepted.
Why was mass_g rejected when I sent zero?
Density is energy per unit mass. Zero or negative mass makes the ratio undefined or nonsensical, so the API returns invalid_input instead of Infinity or a silent NaN.
What does the dietary energy density calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.