TDEE Calculator: How AI Food Coach Calculates Your Daily Calories
Most calorie calculators give you a static number. Enter your weight, height, age, pick an activity level from a dropdown, and you get a number that never changes. That's not how your body works.
AI Food Coach calculates your TDEE dynamically — it updates as you eat, move, and log weight. Here's exactly how it works, with the actual formulas from the app's source code.
What is TDEE?
TDEE (Total Daily Energy Expenditure) is the total number of calories your body burns in a day. It has three components:
- BMR (Basal Metabolic Rate) — calories burned at rest, just to keep you alive. Typically 60-75% of total burn.
- Activity — calories burned through movement, exercise, and daily activities. 15-30% of total burn.
- TEF (Thermic Effect of Food) — calories burned digesting food. 5-15% of total burn, depending on what you eat.
Most calorie trackers only account for the first two. AI Food Coach calculates all three — and updates them dynamically throughout the day.
Step 1: BMR — Your Base Metabolic Rate
BMR is the energy your body needs at complete rest — lying in bed, not moving, not digesting food. It's the largest component of your daily burn.
AI Food Coach uses two peer-reviewed formulas and automatically selects the best one for your situation:
Mifflin-St Jeor (Default)
The most widely validated BMR formula. Used when body fat percentage is not set.
Women: BMR = (10 × weight_kg) + (6.25 × height_cm) - (5 × age) - 161
Example: A 30-year-old man, 80 kg, 180 cm:
BMR = (10 × 80) + (6.25 × 180) - (5 × 30) + 5 = 800 + 1125 - 150 + 5 = 1,780 kcal
Why Mifflin-St Jeor?
Published in 1990 and validated across hundreds of studies, Mifflin-St Jeor is considered the gold standard for BMR estimation when body composition is unknown. It's more accurate than the older Harris-Benedict equation for modern populations.
Katch-McArdle (When Body Fat % is Known)
A more accurate formula that uses lean body mass instead of total weight. Automatically activated when you set your body fat percentage in Macro Targets.
BMR = 370 + (21.6 × LBM)
Example: Same 80 kg man, 20% body fat:
LBM = 80 × (1 - 0.20) = 64 kg
BMR = 370 + (21.6 × 64) = 370 + 1382 = 1,752 kcal
Why it matters: Two people can weigh 80 kg but have very different body compositions. One has 15% body fat (68 kg lean mass), another has 30% (56 kg lean mass). Mifflin-St Jeor gives them the same BMR. Katch-McArdle correctly gives the leaner person a higher BMR — because muscle burns more energy than fat.
Auto-selection: You don't need to choose a formula. Set your body fat percentage in the app → Katch-McArdle activates automatically. Don't know your body fat? Mifflin-St Jeor works well as default. The TDEE breakdown modal shows which formula is active.
Apple Watch Override
If you wear an Apple Watch or a smart tracker that writes to Apple Health, its BMR measurement overrides both formulas. Your wearable uses real heart rate, movement patterns, and biometrics to measure basal energy — no formula can match this accuracy.
The app reads yesterday's basal energy from HealthKit for stability (today's data is incomplete until midnight). It also calculates a 30-day average to correct for days with incomplete data — for example, if you forgot to charge your watch or didn't wear it on your wrist all day.
Step 2: Activity — Three Tiers of Accuracy
Activity calories are where most calculators fail. They ask you to pick from vague categories like "moderately active" — but what does that actually mean?
AI Food Coach supports three tiers, from least to most accurate:
Tier 1: No Wearable (Activity Multiplier)
The classic approach. Your BMR is multiplied by an activity factor:
| Activity Level | Multiplier | Description |
|---|---|---|
| Sedentary | 1.2 | Desk job, little exercise |
| Lightly active | 1.375 | Light exercise 1-3 days/week |
| Moderately active | 1.55 | Moderate exercise 3-5 days/week |
| Very active | 1.725 | Hard exercise 6-7 days/week |
| Extremely active | 1.9 | Physical job + hard exercise |
Problem: A "moderately active" person could burn anywhere from 300 to 800 calories through activity. The multiplier is a rough average — it's wrong for most individuals on any given day.
Tier 2: iPhone Only (Formula BMR + Real Active)
With HealthKit enabled but no Apple Watch, the app uses:
The iPhone tracks steps and movement through its accelerometer, giving a better activity estimate than a static multiplier. BMR still comes from the formula since iPhone can't measure basal energy.
Tier 3: Apple Watch (Real BMR + Real Active)
The most accurate tier. Both components come from real measurements:
Apple Watch measures basal energy using heart rate and movement patterns 24/7. Active energy comes from the motion coprocessor and heart rate sensor during exercise. No formulas, no multipliers — just real data.
Why yesterday's basal?
Today's basal energy reading is incomplete until midnight — it grows throughout the day. Using yesterday's completed measurement gives a stable, accurate value. The app also maintains a 30-day average to smooth out days with incomplete data — e.g., if you forgot to charge your watch or didn't wear it on your wrist all day.
Step 3: TEF — The Hidden Calorie Burn
Most calorie trackers ignore TEF entirely. They calculate BMR, add activity, and call it a day. But digesting food burns real calories — and the amount depends heavily on what you eat.
TEF (Thermic Effect of Food) is the energy cost of digesting, absorbing, and processing the food you eat. Different macronutrients have very different thermic effects:
| Macronutrient | Thermic Effect | Example (100g) | TEF Calories |
|---|---|---|---|
| Protein | 25% | 100g × 4 kcal × 0.25 | 100 kcal |
| Carbs | 7.5% | 100g × 4 kcal × 0.075 | 30 kcal |
| Fat | 2.5% | 100g × 9 kcal × 0.025 | 22.5 kcal |
The formula used in the app:
Example: You eat 150g protein, 30g carbs, 120g fat in a day:
TEF = (150 × 4 × 0.25) + (30 × 4 × 0.075) + (120 × 9 × 0.025)
TEF = 150 + 9 + 27 = 186 kcal
That's 186 extra calories burned just by digesting your food. On a high-protein keto diet, TEF typically adds 100-200 kcal/day.
TEF is dynamic. Your calorie target grows as you eat throughout the day. In the morning (0 meals logged), TEF = 0 and your target equals the base value. After a high-protein lunch, the target increases because your body will burn more calories digesting it. This is reflected in real-time on the dashboard.
Why Does This Matter?
If your TDEE is 2,200 kcal and TEF is 186 kcal, ignoring TEF means your tracker thinks you burn 2,200 kcal — but you actually burn 2,386 kcal. Over a week, that's a 1,300 kcal difference. Over a month, it's over 5,000 kcal — roughly 0.7 kg of fat.
This is why some people lose weight faster than their calorie deficit predicts, especially on high-protein diets. TEF is the "hidden deficit" that most trackers miss.
References: Hall et al. (2009) — thermic coefficients for macronutrients. Westerterp (2004) — diet-induced thermogenesis review.
Your Calorie Target
Once TDEE is calculated, the app determines your daily calorie target:
How Deficit is Calculated
Your weekly weight loss goal determines the daily deficit:
7,700 kcal is the approximate energy content of 1 kg of body fat. So:
- 0.25 kg/week → 275 kcal/day deficit (gentle)
- 0.5 kg/week → 550 kcal/day deficit (moderate)
- 0.75 kg/week → 825 kcal/day deficit (aggressive)
- 1.0 kg/week → 1,100 kcal/day deficit (maximum)
The app enforces safety minimums — it won't suggest a target below 1,200 kcal for women or 1,500 kcal for men, regardless of how aggressive the deficit is.
Dynamic Deficit — Why the Scale is the Only Source of Truth
Everything above — the BMR formulas, the Apple Watch data, the TEF calculation — is our best effort to estimate how many calories you burn. And it's pretty good. But it will never be perfect.
The bigger source of error isn't your TDEE — it's the food side. You estimate 150g of rice but it was 180g. You forget to log a handful of almonds. The nutrition label rounds down. These small inaccuracies add up over weeks.
That's why AI Food Coach doesn't rely solely on the math. The scale is the only source of truth.
How It Works
When you set a weight goal, you define three things: your current weight, your target weight, and a weekly rate (how fast you want to lose). From that, the app calculates a target date.
Every time you step on the scale and log your weight, the app recalculates:
That new rate determines your daily calorie deficit. If you're ahead of schedule, the deficit shrinks. If you're behind, it increases. The target date stays fixed — the deficit adjusts to get you there.
Example
Say your goal is to go from 85 kg to 80 kg in 10 weeks (0.5 kg/week):
| Week | Weigh-in | Remaining | Weeks left | New rate | What happens |
|---|---|---|---|---|---|
| 0 | 85.0 kg | 5.0 kg | 10 | 0.50 kg/wk | Starting plan |
| 2 | 84.5 kg | 4.5 kg | 8 | 0.56 kg/wk | Behind schedule → deficit increases slightly |
| 4 | 82.8 kg | 2.8 kg | 6 | 0.47 kg/wk | Ahead of schedule → deficit decreases, you eat more |
| 8 | 80.5 kg | 0.5 kg | 2 | 0.25 kg/wk | Almost there → gentle coast to finish |
| 9 | 80.0 kg | 0 kg | 1 | 0 kg/wk | Goal reached → maintenance mode |
Notice how the system self-corrects. Week 2 was slower than planned — maybe you underestimated portions or had a social dinner. The deficit nudged up. By week 4 the faster loss brought you ahead, so the deficit eased off. You never had to manually adjust anything.
Safety Limits
The dynamic deficit has built-in guardrails:
- Maximum 1 kg/week — even if you're far behind schedule, the app won't suggest a dangerously aggressive deficit
- Minimum 1,200 kcal/day — your calorie target never drops below a safe floor, regardless of the calculated deficit
- Goal reached = maintenance — if you hit your target weight before the deadline, the deficit drops to zero. No unnecessary restriction.
This is how you reach your goal despite daily inaccuracies. No calorie tracker is perfectly accurate — not this one, not any other. The difference is what happens next. A static deficit ignores reality and hopes the math works out. A dynamic deficit checks your actual progress on the scale and course-corrects every time you weigh in.