I built this calculator because the ones I tested on the market failed on my real cases. The example that came up most: a 100 kg client at over 30% body fat, prescribed 200 g of protein a day. A quantity almost impossible to hold across a day, and one that adds pointless calories on top — because the dose is set on a weight that fat inflates, not on the mass that actually needs feeding.
The calculator turns a few profile inputs into a concrete target: a daily calorie intake and its macronutrient breakdown. The point is to build a meal plan that lines up with the person's goals from those figures.
The first part establishes the calorie chain, in three steps:
- Basal metabolic rate — expenditure at rest, estimated by two equations I retained because they are empirically validated in the literature.
- Total expenditure (TDEE) — I add real activity, read from three simple questions, then converted through multipliers also grounded in the literature.
- The goal — a deficit to lose weight, a surplus to gain, no change to maintain.
Those three steps are enough for a standard profile. They break down at the extremes. That is where the second part comes in, the more technical one: splitting that total into macronutrients — the rules I found in no other tool. A strict dosing order, protein then fat then carbohydrate with what remains, and bounds on each macro to rule out absurdities like 200 g of protein imposed on a body that has no use for it.
Then come the safeguards: pre-written messages that appear according to the inputs, to steer profiles outside the general case toward an alternative rather than hand them a result that does not fit. The last part leaves calculation aside — it sets the legal and ethical frame of the tool: who it is for, and what it does not replace.
What follows lays out these rules in that order, from the simplest to the most complex.
1 Step
Basal metabolic rate
Basal metabolic rate (BMR) is energy expenditure at rest: the calories the body burns over 24 hours with no activity at all. It is the first value the calculator estimates, since everything downstream rests on it.
Two equations are available. The choice between them turns on a single input: whether body fat percentage is given.
Without body fat: Mifflin–St Jeor.
This is the default equation. Published in 1990 by Mifflin and St Jeor, it asks for four inputs only — sex, age, height, weight. I retain it for two reasons. Simplicity: everyone knows those four variables, with no measurement or equipment. Scientific consensus: since publication it has displaced older equations such as Harris–Benedict (1919) and remains the recommended predictive estimate for healthy adults, validated on large samples. On a profile with no body composition data, a more complex formula would add nothing more reliable.
With body fat: Katch–McArdle.
As soon as the user enters body fat, the calculator switches to Katch–McArdle. This equation, put forward by physiologists Frank Katch and William McArdle in 1996, works on lean mass rather than total weight — the tissue that is metabolically active. Muscle burns energy at rest, fat far less. Knowing the share of each allows a closer estimate.
The switch corrects in both directions.
Katch–McArdle recomputes BMR from actual composition, and the correction can go up or down.
On an average profile, around 18% body fat, the two equations converge. A man of 80 kg, 178 cm, 30 years old: Mifflin gives 1,770 kcal, Katch 1,790 — a 20 kcal gap.
The gap shows at the extremes. The same man at 85 kg but 9% body fat: Mifflin 1,830 kcal, Katch 2,040. Katch raises BMR by 210 kcal, because at equal weight this subject carries far more muscle. The other way, on a profile at 32% body fat, Katch brings BMR back down about sixty calories below Mifflin.
Against a BMR of 1,800 to 2,000 kcal, these gaps stay minor — a few percent. But they matter: 200 kcal at the base carries through to total expenditure and then to the target. Entering body fat therefore anchors the estimate on the body's real composition, beyond the scale reading alone.
2 Step
Real expenditure: from rest to daily life
Basal metabolic rate covers expenditure at rest only. To get real expenditure across a day — the TDEE (Total Daily Energy Expenditure) — BMR is multiplied by an activity factor.
TDEE = BMR × activity factor
Everything hinges on the choice of that factor. Most calculators ask the user to classify himself: "sedentary", "moderately active", "very active". The problem is well known in the field: almost everyone overrates himself. An office worker who hits the gym twice a week calls himself "active" while sitting ten hours the rest of the time. The factor comes out too high, the TDEE inflated, and the calorie target wrong from the start.
I replaced self-assessment with three factual questions. The user describes his behaviour; the calculator infers the level.
Three questions, three distinct measures.
Each question captures a different component of expenditure. None overlaps with the others.
- Steps per day (7-day average) — under 8,000: 0 / 8,000 to 15,000: 1 / 15,000 and over: 2. This is background movement, the expenditure independent of training.
- Sitting time per day, excluding sleep — over 8h: 0 / 4 to 8h: 1 / under 4h: 2. This is sedentary behaviour, and it is not the mirror image of step count. Someone can log 9,000 steps and still sit ten hours on top: the two describe separate realities.
- Days of physical activity (resistance training, HIIT, sport, over 7 days) — 0 to 1: 0 / 2 to 4: 1 / 5 to 7: 2. This is structured training, deliberate expenditure.
Each answer is worth 0, 1 or 2 points. The total runs from 0 to 6.
From score to factor.
The total score sets the activity factor applied to BMR.
| Score | Level | Factor |
|---|---|---|
| 0 | Sedentary | 1.20 |
| 1–2 | Lightly active | 1.30 |
| 3–4 | Moderately active | 1.45 |
| 5 | Very active | 1.60 |
| 6 | Extremely active | 1.75 |
The cut-offs on each question and the progression of the factors were set by iteration, testing the grid against real profiles until each tier matched a credible level of expenditure.
Example.
The man from section 1 — 80 kg, Mifflin BMR 1,770 kcal. He walks 10,000 steps a day (1), sits 6h (1), trains 0 times over the week (0): score 2, factor 1.30. His TDEE comes out at 1,770 × 1.30 = 2,300 kcal. The goal is then calculated from that base.
3 Step
Adapting to the goal
TDEE is what the body spends to hold its weight. The calorie target follows from it according to the aim. Three cases.
Maintenance.
The target is TDEE, with no adjustment. You eat what you spend.
Muscle gain.
The target is TDEE + 400 kcal. A moderate surplus. Too wide a surplus does not build more muscle, it mostly adds fat to lose again later; 400 kcal are enough to support muscle building without overshoot.
Weight loss.
The trickiest case. I set the deficit at 400 kcal. A moderate deficit, sustainable over time, that preserves lean mass — beyond it, comfort and adherence suffer. For low-expenditure profiles, where 400 kcal would still weigh too heavily, the safety calorie floor (section 4) prevents dropping below a minimum. The two work together: the fixed deficit bounds the cut from above, the floor bounds intake from below.
Example.
The man followed since section 1 — TDEE 2,300 kcal, goal loss. Deficit 400 kcal → target 1,900 kcal, above the male floor (1,400). Intake retained: 1,900 kcal.
4 Step
The safety calorie floor
Step 3 produces a target. This section adds a minimum below which the target never drops, whatever deficit is computed. It applies to weight loss only.
- Women: 1,100 kcal/day
- Men: 1,400 kcal/day
Why a floor.
On a low-expenditure profile, a 400 kcal deficit can push the target under the vital minimum. A small sedentary woman whose TDEE sits near 1,400 kcal would land at 1,000 kcal after the deficit — too low to cover basic needs, which eats into lean mass and breaks adherence. The floor prevents that: below the minimum, the target is raised back to it.
Why at this level.
The values often cited in the literature — around 1,200 kcal for women, 1,500 for men — proved too high on part of my client base. At the standard floor, their deficit became too small and loss would not start. Coming down about a hundred kcal gives the deficit room to work, without falling into dangerous intakes. The choice is empirical: it comes from real cases where the higher floor blocked progress, not from a theoretical target.
This floor targets the general case. Some profiles fall outside it — an elite athlete needing to cut fast before a deadline, for instance — and general recommendations do not apply to them. But those profiles are almost always already supervised. The tool does not try to cover them: for them, it flags its limits (section 7) rather than producing a target that does not fit.
Mechanism.
The floor is the last lock in the calorie chain. It applies after the deficit:
Final intake = max(target after deficit ; applicable floor)
When the floor wins, the real deficit falls under the theoretical 400 kcal: safety takes priority over speed of loss.
Example.
A sedentary woman, TDEE 1,400 kcal, goal loss. Deficit 400 → target 1,000 kcal. The female floor (1,100) takes over: intake retained 1,100 kcal, a real deficit of 300 kcal. For the man followed from the start (1,900 kcal, floor 1,400), the floor does not come into play — he stays at 1,900.
5 Step
The reference weight
Up to here the whole calculation dealt with calories. From here macronutrients are dosed, and the first question is: on which weight?
The reflex would be to take the scale reading. For protein that is wrong. The role of protein in a deficit is to preserve muscle. Fat mass does not need protein to be maintained. Dosing protein on the total weight of someone carrying a lot of fat therefore overstates his needs: the calculation preserves a tissue that asks for nothing.
The reference weight corrects this. It is the weight protein is calculated on — not necessarily the scale reading. Fat is always calculated on current weight (section 6); this section concerns protein only.
Precedence.
If body fat is given, it decides (lean mass or total weight, according to the threshold). The declared build — athletic / average / overweight — only serves when body fat is absent.
Athletic or average profile → current weight.
Little or no excess fat to exclude. The scale reading is a reliable base, used as is.
Declared overweight → adjusted weight.
When the user declares fat to lose without giving a percentage, dosing does not run on raw weight. An adjusted weight is used, taken from clinical nutrition (adjusted body weight):
Adjusted weight = ideal weight + 0.25 × (current weight − ideal weight)
Ideal weight = 23 × height² (in m)
A BMI of 23 places the ideal weight in the middle of the WHO health range (18.5–24.9): a plausible target for the frame. The 0.25 coefficient reflects a simple clinical assumption — about a quarter of the excess weight above ideal is active tissue (supporting muscle, organs), the rest is fat. Only a quarter of that excess therefore counts toward the weight used to dose protein.
Safeguard: if current weight is at or below ideal weight, the "overweight" declaration is ignored and the calculation returns to current weight. This avoids the absurdity of a lean person declaring overweight by mistake.
Body fat given (precise mode) → lean mass above a threshold.
When composition is known, the treatment depends on the fat level.
- Body fat ≥ 22% (men) / 30% (women): protein is dosed on lean mass. Lean mass = weight × (1 − body fat/100).
- Body fat below the threshold: total weight is kept. At that level, lean mass and total weight are already close — the switch would move protein by a few grams, for nothing.
Summary of the protein reference weight:
| Input | Reference weight |
|---|---|
| Body fat ≥ 22% M / 30% W | Lean mass |
| Body fat < threshold | Current weight |
| No body fat, athletic or average | Current weight |
| No body fat, overweight (and current > ideal) | Adjusted weight |
Example.
Woman, 1.65 m, 90 kg, declared overweight, goal loss.
- Ideal weight = 23 × 1.65² ≈ 63 kg
- Adjusted weight = 63 + 0.25 × (90 − 63) ≈ 70 kg
- Protein (1.8 g/kg, detail in section 6): 125 g on the adjusted weight, against 160 g on current weight.
A 35 g protein gap — about 140 kcal, which go back into carbohydrate and fat instead of protein she would not put to use. The calorie target does not move: the reference weight corrects the breakdown, not the total.
6 Step
The macronutrient breakdown
The calorie target is set. This step cuts it into protein, fat and carbohydrate. Two principles govern it.
Principle 1 — dose in g/kg, not as a percentage of calories.
The classic percentage split (40/30/30 and the like) ties macros to the calorie total, not to the body. Two people on the same intake but of opposite frames receive the same grams of protein, which makes no sense: protein need depends on the mass to maintain, not on the calorie count. Protein and fat are therefore calculated in g/kg — protein on the reference weight (section 5), fat on current weight — and carbohydrate takes what remains.
Principle 2 — an order of priority: protein → fat → carbohydrate.
This order is a hierarchy. Protein first: it preserves lean mass, non-negotiable in a deficit. Fat next: below a threshold, it compromises hormone production. Carbohydrate last: it absorbs the remaining calories. Not the least important, but the adjustment variable.
Protein
Base ratios, applied to the reference weight:
| Goal | Men | Women |
|---|---|---|
| Loss | 2.0 | 1.8 |
| Maintenance | 1.6 | 1.4 |
| Gain | 1.8 | 1.6 |
When the reference weight is lean mass (body fat ≥ 22% men / 30% women, section 5), each ratio is raised by +0.4 g/kg. Dosing on lean mass excludes fat from the calculation: a higher protein density can therefore be applied to that tissue without overloading total intake.
| Goal | Men (lean mass) | Women (lean mass) |
|---|---|---|
| Loss | 2.4 | 2.2 |
| Maintenance | 2.0 | 1.8 |
| Gain | 2.2 | 2.0 |
An absolute ceiling applies in every case, including lean-mass mode: 200 g men / 150 g women. Protein synthesis saturates around 1.6–2.2 g/kg (Morton et al., 2018). The lean-mass ratios draw on the Helms meta-analysis (2014) and ISSN recommendations for deficit phases.
Fat
Calculated on current weight, never on an adjusted weight: adipose tissue does not waive hormonal needs, which bear on the real body.
| Goal | g/kg |
|---|---|
| Loss | 1.0 |
| Maintenance | 1.0 |
| Gain | 1.1 |
Fixed bounds: floor 60 g men / 50 g women, ceiling 120 g men / 100 g women. The floor is a hormonal safety threshold — the literature places the drop in testosterone around 0.5–0.6 g/kg in men, with cycle disruption in women below a comparable level.
Carbohydrate
What remains, once protein and fat are taken out of the intake:
Carbohydrate = (intake − protein × 4 − fat × 9) / 4
Floor: 80 g. Below it, basic function and performance drop off.
The cascade — when carbohydrate falls under 80 g
On a profile in a tight deficit (low calories, high protein and fat), the remainder left to carbohydrate can fall under the floor. That is not allowed to stand: calories are recovered from the other macros, in a strict order.
- Lower fat to its floor (60 / 50). The fat margin above the hormonal threshold is drawn on first.
- If that is not enough, lower protein to 1.6 g/kg — the muscle-preservation threshold, never below.
- Recompute carbohydrate.
This order is the priority hierarchy taken backwards: the least critical margin is sacrificed first. If, after those two steps, carbohydrate stays under 80 g, the calorie intake itself is too low — it is already bounded by the floor from section 4, and a message flags it (section 7).
Fibre
15 g per 1,000 kcal of intake. Indexed on calories rather than g/kg, because fibre need follows total food volume, not body mass.
Example — standard breakdown
The man followed from the start: 80 kg, 178 cm, declared "average" (no body fat), goal loss, intake 1,900 kcal. Average build → reference weight = current weight = 80 kg.
- Protein: 2.0 × 80 = 160 g → 640 kcal (under the 200 ceiling)
- Fat: 1.0 × 80 = 80 g → 720 kcal (within the 60–120 bounds)
- Carbohydrate: (1,900 − 640 − 720) / 4 = 135 g → 540 kcal (above the floor, no cascade)
- Fibre: 15 × 1.9 ≈ 29 g
Check: 640 + 720 + 540 = 1,900 kcal. The full chain: 1,770 (BMR) → 2,300 (TDEE) → 1,900 (target) → 160 P / 80 F / 135 C.
Example — the cascade fires
Woman, 1.65 m, 90 kg declared overweight → reference weight 70 kg (adjusted weight, section 5), current weight 90 kg. Loss, intake low at 1,400 kcal.
- Initial calculation: Protein 1.8 × 70 = 125 g (500 kcal); Fat 1.0 × 90 = 90 g (810 kcal).
- Carbohydrate = (1,400 − 500 − 810) / 4 = 22 g → far under the floor. The cascade engages.
- Step 1: fat brought back to its floor, 50 g (450 kcal). Carbohydrate = (1,400 − 500 − 450) / 4 = 112 g → above 80. It stops there, protein does not move.
- Result: 125 g P / 50 g F / 112 g C. The fat margin was sacrificed to bring carbohydrate back above the threshold.
7 Step
Safeguards and contextual messages
The calculator can display messages alongside the result. The principle governing them: a message appears only under a precise condition, and never otherwise. Each message matches a situation actually detected in the calculation, and disappears as soon as it does not apply.
Two rules complete this principle:
- A hierarchy to avoid redundancy. When two messages could fire together and say the same thing at bottom — "your profile falls outside the general case" — only one shows. Disclaimer B is hidden when disclaimer A is present.
- Two intensities of exit route. Messages do not all carry the same weight. When the tool hits a real limit, the redirection toward coaching is direct: that is the right reflex. When the user has a perfectly usable result, the exit stays discreet — an option, not an injunction. Otherwise every message ends up selling, and the signal dilutes.
Five messages, in three families.
The two profile disclaimers (direct exit route)
They flag that the profile falls outside the general case the tool is built to cover. That is where redirection is legitimate.
The two calculation signals (light exit route)
They explain a decision the tool took during the calculation. The user has a valid result; the message gives context.
The precision indicator (permanent, no exit route)
It warns of nothing: it tells the user which calculation mode is in use and invites him to refine it. Two states, according to whether body fat is given.
8 Step
The frame and safety
The seven previous sections describe what the tool calculates. This one describes what it refuses to do.
Adults only — a hard block
Under 18, the calculator computes nothing. No warning displayed above a result that shows anyway: the result does not appear at all. Access is cut upstream, with a redirection message.
The choice is deliberate. A growing body does not have the same needs as an adult, and none of the equations used here is validated for adolescents.
A minor's redirection does not point to my coaching. It steers him toward a trusted adult or a health professional.
Before 18, the body is still growing and its needs are not calculated this way. The equations used here are not valid for a developing profile.
If you have questions about your diet, talk to a trusted adult, a doctor or a health professional.
No data collected
The calculator runs 100% in the browser. The data entered — weight, height, age, composition — is neither stored nor sent to a server. The calculation happens on the device, and nothing leaves it.
This is not medical advice
The tool produces an estimate, not a prescription. The equations are statistical averages: they know nothing of a current treatment, a thyroid disorder, kidney disease or a pregnancy. For those situations, a health professional takes precedence over any automatic calculation.
Legal frame
The tool's legal notice covers the applicable French frame (LCEN), limitation of liability, the age restriction, data confidentiality and intellectual property. It states that the tool does not substitute for medical advice.
Scientific references
- Mifflin M.D., St Jeor S.T. (1990) — predictive equation for resting energy expenditure.
- Katch F., McArdle W. (1996) — metabolism estimated on lean mass.
- Harris J., Benedict F. (1919) — historical equation, displaced as reference by Mifflin–St Jeor.
- Morton R.W. et al. (2018) — meta-analysis on protein synthesis saturation.
- Helms E. et al. (2014) — meta-analysis on protein needs in a deficit.
- ISSN — recommendations on protein intake during loss phases.
- WHO — healthy BMI range (18.5–24.9).