The ketogenic diet has a specific metabolic mechanism behind it, not just a general instruction to eat fewer carbs. Understanding the biochemistry — and the math — makes the difference between a diet that works and one that stalls after two weeks. The numbers are more precise than most people realize.

How Keto Works: The 20g Carb Threshold

Under normal conditions, your body runs on glucose derived from dietary carbohydrates. When carbohydrate intake drops below roughly 20–50 grams of net carbs per day, liver glycogen becomes depleted within 24–48 hours. At that point, the liver begins converting fatty acids into ketone bodies — acetoacetate, beta-hydroxybutyrate, and acetone — which serve as an alternative fuel for the brain and muscles.

This metabolic state is called nutritional ketosis. Blood ketone levels in ketosis typically measure 0.5–3.0 mmol/L, compared to under 0.1 mmol/L in a standard carbohydrate-fed state.

The 20g figure is conservative and works for most people. Some individuals can maintain ketosis at 30–50g net carbs, particularly those who are physically active. However, 20g is the safe starting point because it reliably induces ketosis across a wide range of metabolic backgrounds.

Net Carbs = Total Carbohydrates − Dietary Fiber − Sugar Alcohols

Standard Keto Macro Split: 70/25/5

The classic ketogenic macro ratio divides daily calories as follows:

Macro% of CaloriesCalories per gram
Fat70–75%9 cal/g
Protein20–25%4 cal/g
Carbs5–10%4 cal/g

The high fat percentage often surprises people. It's not about eating unlimited fat for its own sake — it's that when carbohydrates are nearly eliminated, fat must replace them as the primary caloric fuel. Protein is moderate, not high, because excess protein can be converted to glucose through gluconeogenesis, potentially disrupting ketosis.

A common mistake is treating keto as a high-protein diet. Protein should be sufficient to preserve muscle mass (roughly 1.2–1.6g per kg of lean body mass) but not excessive.

Calculating Your Personal Keto Macros

The calculation starts with your Total Daily Energy Expenditure (TDEE), then applies the macro ratios.

Step 1: Estimate TDEE

Use the Mifflin-St Jeor equation for Basal Metabolic Rate (BMR):

Men:   BMR = (10 × weight kg) + (6.25 × height cm) − (5 × age) + 5
Women: BMR = (10 × weight kg) + (6.25 × height cm) − (5 × age) − 161

Multiply BMR by activity factor: sedentary (1.2), lightly active (1.375), moderately active (1.55), very active (1.725).

Step 2: Apply macro ratios

Example: a 35-year-old woman, 68kg, 165cm, moderately active. TDEE ≈ 2,100 calories.

For weight loss, apply a 20% deficit: 2,100 × 0.80 = 1,680 calories/day target.

Fat:     1,680 × 0.72 = 1,210 cal ÷ 9 = 134g fat/day
Protein: 1,680 × 0.23 = 386 cal ÷ 4 = 97g protein/day
Carbs:   1,680 × 0.05 = 84 cal ÷ 4 = 21g carbs/day

This 21g carb ceiling keeps her solidly in ketosis while protein is sufficient to preserve muscle at 1.4g/kg lean body mass (assuming 25% body fat, lean mass ≈ 51kg → 51 × 1.4 = 71g minimum protein).

Net Carbs vs Total Carbs

Keto tracks net carbs, not total carbs. The distinction matters significantly for food choices.

Net Carbs = Total Carbs − Fiber − Sugar Alcohols

Dietary fiber cannot be digested and does not raise blood glucose. Sugar alcohols (erythritol, xylitol, sorbitol) have partial or negligible impact depending on type. Erythritol is typically subtracted entirely; sorbitol is not.

A 100g serving of avocado has 9g total carbs, but 7g is fiber:

Net Carbs = 9 − 7 = 2g net carbs

This makes avocado a keto staple despite its apparent carbohydrate content.

Common Foods and Their Net Carbs

Food (100g serving)Total CarbsFiberNet CarbsKeto-Friendly?
Spinach (raw)3.6g2.2g1.4gYes
Avocado8.5g6.7g1.8gYes
Broccoli7.0g2.6g4.4gYes (moderate)
Almonds21.6g12.5g9.1gYes (portion control)
Raspberries11.9g6.5g5.4gYes (small serving)
Blueberries14.5g2.4g12.1gLimit carefully
White bread (1 slice)28g1.2g26.8gNo (entire day's carbs)
White rice (cooked)28g0.4g27.6gNo
Pasta (cooked)31g1.8g29.2gNo
Apple (medium)25g4.4g20.6gNo (entire day's carbs)
Banana (medium)27g3.1g23.9gNo

A single medium apple consumes essentially the entire daily carb budget. This is why fruit — often considered health food — must be dramatically limited or eliminated on keto. Berries are the exception because of their high fiber-to-sugar ratio.

Keto Adaptation Timeline: What to Expect

The transition to ketosis follows a predictable physiological timeline that most people experience in similar stages.

TimelineWhat's HappeningCommon Symptoms
Days 1–3Glycogen depletion; body burning stored glucoseNormal energy, possible carb cravings
Days 4–7Glycogen depleted; ketone production beginning"Keto flu": headache, fatigue, brain fog
Weeks 1–2Electrolyte loss accelerates as insulin dropsMuscle cramps, lethargy, poor sleep
Weeks 2–4Ketone production stable; body adaptingImproving energy, reduced appetite
Week 4+Fat-adapted; efficient ketone useStable energy, mental clarity, satiety

The "keto flu" occurs because insulin levels fall sharply as carbs are eliminated. Lower insulin signals the kidneys to excrete sodium, which takes potassium and magnesium with it. The symptoms are almost entirely explained by electrolyte loss, not ketosis itself.

Mitigation strategy:

Sodium:    2,000–4,000mg/day (salt food liberally, use bouillon)
Potassium: 3,500–4,700mg/day (avocado, leafy greens, salt substitute)
Magnesium: 300–500mg/day (supplement with magnesium glycinate)

By week 4–6, fat adaptation is typically complete. Fat-adapted athletes often report more stable energy during endurance activity, less reliance on mid-workout fueling, and a blunted hunger response compared to their carbohydrate-fueled baseline. The adaptation period is real, measurable, and temporary — the math and the biology both point the same direction if you stay consistent through the first month.