Thermic effect by macronutrient
A meal with 40 g of protein, 50 g of carbohydrate and 15 g of fat has 495 kcal, and 58.7 kcal of that goes to digestion, leaving 436.3 kcal. You see the digestive cost of each macro separately. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Protein g
- 40
- Carbs g
- 50
- Fat g
- 15
- Protein cost
- 0.25
- Carbs cost
- 0.08
- Fat cost
- 0.02
- Protein kcal
- 160
The thermic effect of feeding is the extra energy your body spends digesting, absorbing, and processing food after a meal. Protein, carbohydrate, and fat do not cost the same to process: protein typically burns a large share of its own calories, carbohydrate a modest share, and fat almost none. This thermic effect by macronutrient calculator turns gram amounts of each macro into intake kilocalories with classic Atwater factors, multiplies each energy stream by a digestion-cost fraction, and returns the TEF breakdown plus net metabolizable energy. Defaults match common textbook midpoints—twenty-five percent for protein, eight percent for carbohydrate, two percent for fat—while optional cost fields let meal planners and research scripts plug in study-specific coefficients.
How TEF is computed from grams and digestion costs
Start with three gram amounts: protein, carbohydrate, and fat for a meal, a day, or any window you care about. Convert grams to kilocalories with Atwater densities—four kilocalories per gram for protein, four for carbohydrate, and nine for fat—so a plate with forty grams of protein, fifty grams of carbohydrate, and fifteen grams of fat becomes one hundred sixty, two hundred, and one hundred thirty-five kilocalories respectively, or four hundred ninety-five total.
Apply a digestion-cost fraction to each stream: by default protein costs twenty-five percent of its energy, carbohydrate eight percent, and fat two percent. Multiplying stream energy by its cost yields the thermic contribution of that macro; summing the three contributions yields total TEF in kilocalories. Divide total TEF by total intake energy and multiply by one hundred to get TEF as a percent of intake, then subtract total TEF from total intake to report net metabolizable energy—the portion left after the digestive “tax.”
Optional cost parameters accept any fraction from zero through one so you can model high-protein trials, low-cost fat-dominant menus, or published ranges instead of the defaults. Zero grams of a single macro is allowed; a completely empty intake with all three at zero is rejected as non-positive because there is no thermic effect to compute.
Where a TEF-by-macro calculator earns its keep
Coaches and dietitians use a thermic effect by macronutrient calculator when comparing high-protein versus high-carb menus that share the same labeled calories but not the same digestive cost. Fitness apps can show net metabolizable energy next to gross intake so users understand why protein-heavy days often feel leaner at the same calorie count. Research notebooks and meal-planning generators need a deterministic oracle that applies fixed Atwater factors and explicit cost fractions instead of a black-box LLM estimate.
Keep requests small, pin rounded TEF totals in tests, and you get reproducible digestion-cost math for coaching portals, LMS nutrition units, and edge workers without standing up a full nutrition database of your own.
What you can do with it
Meal TEF comparison
Compare two plates with the same total calories but different protein, carb, and fat splits to see which meal spends more energy on digestion.
Coaching and meal-plan dashboards
Show daily TEF and net metabolizable kilocalories next to macro targets so clients see the digestive cost of high-protein days.
Research and automation scripts
Batch-evaluate study menus with fixed or custom digestion-cost fractions without network calls or non-deterministic models.
FAQ
How is the thermic effect of feeding calculated from macros?
Convert protein, carbohydrate, and fat grams to kilocalories with 4, 4, and 9 kcal/g, multiply each stream by its digestion-cost fraction (defaults 0.25, 0.08, 0.02), and sum the three TEF parts.
Can one macronutrient be zero grams?
Yes. Zero grams for a single macro is allowed.
Can I change the digestion cost percentages?
Omit them to use the default 0.25 / 0.08 / 0.02 midpoint values.
How much more does protein cost to digest than fat?
By default protein costs 25% of its own calories, carbohydrate 8% and fat 2%. In the sample meal, 160 kcal of protein cost 40 kcal to process, while 135 kcal of fat cost only 2.7 kcal.
What does net metabolizable energy mean?
It is the energy left after subtracting the digestive cost from what you ate. For a 495 kcal meal with a thermic effect of 58.7 kcal, the net figure is 436.3 kcal.
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/tef-by-macro \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"protein_g":40,"carbs_g":50,"fat_g":15}'const res = await fetch("https://api.kit.forhosting.com/health/tef-by-macro", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"protein_g": 40,
"carbs_g": 50,
"fat_g": 15
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/health/tef-by-macro",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"protein_g": 40,
"carbs_g": 50,
"fat_g": 15
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/health/tef-by-macro", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"protein_g":40,"carbs_g":50,"fat_g":15}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"protein_g":40,"carbs_g":50,"fat_g":15}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/health/tef-by-macro", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"protein_g": 40,
"carbs_g": 50,
"fat_g": 15
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "health.tef_by_macro",
"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
Input contract, response shape, and error behaviour
Their sum must be strictly positive. Optional precision is an integer from zero to fifteen that rounds every numeric output field, default two. POST a JSON body with three required finite numbers: protein_g, carbs_g, and fat_g, each greater than or equal to zero. Optional protein_cost, carbs_cost, and fat_cost are fractions between zero and one inclusive; omit them to use zero point two five, zero point zero eight, and zero point zero two. Aliases such as protein, carbs, fat, protein_tef, and decimals are accepted so notebook scripts can speak either long or short names. On success the body echoes grams and costs, lists protein_kcal, carbs_kcal, fat_kcal, and total_kcal, then lists tef_protein_kcal, tef_carbs_kcal, tef_fat_kcal, and tef_total_kcal, plus tef_percent_of_intake, net_metabolizable_kcal, method, formula, and precision. Missing fields, non-finite values, negative grams, cost fractions outside zero to one, and a non-positive total gram sum fail with invalid_input and a message that names the problem; those failures are not billed. Numbers may arrive as JSON numbers or as plain decimal strings.
Technical questions
What does net metabolizable energy mean here?
net_metabolizable_kcal is total intake kilocalories minus total TEF kilocalories—the energy left after applying the per-macro digestion costs used in this model.
What does the thermic effect by macronutrient calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.