Back to Blog

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:

TDEE = BMR + Activity + TEF
  • 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.

Men: BMR = (10 × weight_kg) + (6.25 × height_cm) - (5 × age) + 5
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.

LBM = weight_kg × (1 - body_fat_% / 100)
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 LevelMultiplierDescription
Sedentary1.2Desk job, little exercise
Lightly active1.375Light exercise 1-3 days/week
Moderately active1.55Moderate exercise 3-5 days/week
Very active1.725Hard exercise 6-7 days/week
Extremely active1.9Physical 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:

TDEE = Formula BMR + Real Active Calories (from iPhone motion sensors)

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:

TDEE = Apple Watch BMR (yesterday) + Apple Watch Active Calories (today)

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:

MacronutrientThermic EffectExample (100g)TEF Calories
Protein25%100g × 4 kcal × 0.25100 kcal
Carbs7.5%100g × 4 kcal × 0.07530 kcal
Fat2.5%100g × 9 kcal × 0.02522.5 kcal

The formula used in the app:

TEF = (protein_g × 4 × 0.25) + (carbs_g × 4 × 0.075) + (fat_g × 9 × 0.025)

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:

Target = TDEE + TEF - Deficit

How Deficit is Calculated

Your weekly weight loss goal determines the daily deficit:

Daily Deficit = (weekly_goal_kg × 7,700 kcal) / 7 days

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:

New weekly rate = remaining kg ÷ remaining weeks

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):

WeekWeigh-inRemainingWeeks leftNew rateWhat happens
085.0 kg5.0 kg100.50 kg/wkStarting plan
284.5 kg4.5 kg80.56 kg/wkBehind schedule → deficit increases slightly
482.8 kg2.8 kg60.47 kg/wkAhead of schedule → deficit decreases, you eat more
880.5 kg0.5 kg20.25 kg/wkAlmost there → gentle coast to finish
980.0 kg0 kg10 kg/wkGoal 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.

Frequently Asked Questions

What is TDEE and how is it calculated?
TDEE (Total Daily Energy Expenditure) is the total number of calories your body burns in a day. It's calculated as BMR (Basal Metabolic Rate) + Activity calories + TEF (Thermic Effect of Food). AI Food Coach uses the Mifflin-St Jeor formula by default, or the more accurate Katch-McArdle formula when body fat percentage is known.
What is the difference between Mifflin-St Jeor and Katch-McArdle?
Mifflin-St Jeor uses weight, height, age, and gender to estimate BMR. Katch-McArdle uses lean body mass (weight minus fat), making it more accurate for people with higher or lower than average body fat. In AI Food Coach, setting your body fat percentage automatically switches to Katch-McArdle — no manual selection needed.
Does Apple Watch make calorie tracking more accurate?
Yes, significantly. Without a wearable, calorie burn is estimated using activity multipliers (1.2x-1.9x). With Apple Watch, AI Food Coach uses your real measured BMR and real active calories from HealthKit. This is especially important for people whose actual activity levels don't match the standard multiplier categories.
What is TEF (Thermic Effect of Food)?
TEF is the energy your body uses to digest, absorb, and process food. Protein costs 25% of its calories to digest, carbs cost 7.5%, and fat costs 2.5%. On a high-protein diet, TEF can add 100-200 extra calories burned per day. Most calorie trackers ignore TEF entirely — AI Food Coach calculates it dynamically as you eat.
What is dynamic deficit and how does it work?
Dynamic deficit means your calorie deficit recalculates every time you log your weight. The app divides the remaining weight to lose by the remaining weeks until your target date, producing a new weekly rate. If you lose weight faster than planned, the deficit shrinks so you don't over-restrict. If progress is slower, the deficit increases — up to a safe maximum of 1 kg per week. This self-correcting mechanism keeps you on track despite daily inaccuracies in calorie logging.
What happens if I lose weight faster or slower than planned?
The app adjusts automatically. If you're ahead of schedule, your deficit decreases — you get to eat more because you need a smaller weekly loss to hit your goal on time. If you're behind schedule, the deficit increases (within safe limits: max 1 kg/week, minimum 1,200 kcal/day). If you reach your target weight early, the deficit drops to zero and you switch to maintenance calories.

See Your Real TDEE

Download AI Food Coach, set up your profile, and see your dynamic TDEE with all three components — BMR, Activity, and TEF — calculated in real time.