A ketogenic diet works only when macronutrients are calculated for the individual, not copied from a generic plan. The starting point is total calorie needs; fats, protein and carbohydrates are then distributed according to the protocol's proportions.

First step: calorie needs
Daily calorie needs are estimated from basal metabolic rate (the calories the body uses at rest) multiplied by a physical-activity factor. The most widely used formulas — Mifflin–St Jeor is considered one of the most accurate for the general population — take weight, height, age and sex into account. Anyone aiming to lose body fat can then apply a moderate deficit, typically 300–500 kcal below maintenance needs.

Protein comes first
Contrary to a common assumption, protein is not the leftover variable: it should be set first, based on lean mass rather than total body weight. A common range is 1.6–2.2 g of protein per kilogram of lean mass per day, with a higher target for people who lift weights or are in a substantial calorie deficit, to preserve muscle mass.

Carbohydrates come second
The net-carbohydrate target — typically 20–50 g per day — should reflect individual metabolic sensitivity: people who are already insulin-resistant often need to stay near the lower end to maintain ketosis, while those with good insulin sensitivity who train intensely may tolerate slightly higher amounts. Net carbohydrates are easy to calculate: total carbohydrates on the label minus grams of fiber (fiber is not digested and absorbed like sugar).

Fat fills the remainder
Once protein and carbohydrates are set, fat covers the remaining calories up to total needs. For example, for someone whose needs are 2,000 kcal, with 120 g of protein (480 kcal) and 30 g of net carbohydrates (120 kcal), about 1,400 kcal remain from fat, or roughly 155 g per day — an example, not a universal value.

A complete calculation example
For a person weighing 70 kg, with an estimated lean mass of 55 kg, maintenance needs of 2,200 kcal, and a moderate deficit set at 1,800 kcal:
| Macronutrient | Amount | Calories | % of calories |
|---|---|---|---|
| Protein | 110 g (2 g/kg massa magra) | 440 kcal | 24% |
| Net carbohydrates | 25 g | 100 kcal | 6% |
| Fat | 140 g | 1260 kcal | 70% |

Common calculation mistakes
- Calculating protein from total body weight instead of lean mass, which overestimates needs when body-fat mass is high.
- Setting fat as the starting point instead of the residual variable, and losing control of total calories.
- Ignoring fiber when calculating net carbohydrates, and unintentionally moving outside ketosis.
- Not recalculating targets after a significant weight change:needs should be reviewed after every 5–7 kg lost, rather than fixed once and for all.

These calculations are only a starting estimate: the most reliable way to check whether they work is to track weight, energy and, when available, ketone bodies for 2–3 weeks, then adjust accordingly.
