Calories & nutrition · Calculation notebook

Macros calculator for keto diet: formulas, examples and mathematical principles

Learn the inputs, formula and worked example behind the Macros calculator for keto diet, including energy bookkeeping and weighted allocation, result interpretation, assumptions and sources.

Purpose and steps

Calculates protein from body weight, subtracts protein and net-carbohydrate calories, and assigns the remaining calories to fat.

  1. Choose units and use the pre-pregnancy, resting or current measurements requested by the tool; keep observation dates consistent.
  2. Prepare Weight, Daily calorie target, Protein per kg of body weight, Daily net carbohydrates. Defaults demonstrate the model rather than your personal circumstances.
  3. Check the headline result and its components. A key interpretation for this tool is: The three macro calorie totals should add back to the entered calorie target.
  4. Compare the baseline with a changed scenario: Changing protein or carb targets automatically changes the remaining fat allowance.

Input reference and units

These values reproduce the model’s demonstration. Replace them with your own records or measurements; they are not recommended targets.

On a small screen, swipe horizontally to see all columns. With a keyboard, focus the table and use the arrow keys.

Parameters used by this calculator
ParameterDemonstration valueHow to enter it
Weight70 kgUse the definition shown in the field label; keep this assumption consistent when comparing scenarios.
Daily calorie target2000 kcalUse the definition shown in the field label; keep this assumption consistent when comparing scenarios.
Protein per kg of body weight1.6 g/kg Use the definition shown in the field label; keep this assumption consistent when comparing scenarios.
Daily net carbohydrates30 g Use the definition shown in the field label; keep this assumption consistent when comparing scenarios.

Model-specific method

How this calculator produces its result

Protein grams = body weight in kg × selected protein rate. Protein and net carbs use 4 kcal/g; remaining calories are assigned to fat at 9 kcal/g.

Energy bookkeeping and weighted allocation

Energy allocation is a weighted sum because grams of protein, carbohydrate and fat have different modeled energy densities. Subtract the energy already assigned before converting the remainder into another nutrient. Dividing remaining calories by four rather than nine would miscalculate fat grams.

A static deficit or surplus is a budgeting estimate rather than a linear prediction of body-weight change. Expenditure can adapt, measurement is imperfect and changes in water and lean tissue affect weight. Activity factors can already include exercise; adding it again may double-count energy use.

TDEE ≈ estimated resting energy × activity factor
Energy from macros = 4 × protein grams + 4 × carb grams + 9 × fat grams
Planned balance = intake − estimated expenditure
  • kcal: energy, not food mass
  • g: grams of the selected macronutrient
  • Activity factor: empirical multiplier, not measured exercise energy
  • Balance: model estimate over the specified period

Worked example

At 70 kg, 2,000 kcal, 1.6 g/kg protein, and 30 g net carbs: protein is 112 g, carbs are 30 g, and remaining fat is about 159 g.

Reproduce the default scenario

This reproduces the default inputs in the reference table above; it is not an additional independent example. Displayed rounding may differ from intermediate precision. Health examples use metric units.

Daily fat
159 g
Daily protein
112 g
Daily net carbohydrates
30 g
Calories from fat
72%

Reading results without overstating them

  • The three macro calorie totals should add back to the entered calorie target.
  • Changing protein or carb targets automatically changes the remaining fat allowance.

Assumptions and exclusions

  • Net-carbohydrate labeling varies and is not defined identically for every food.
  • The tool does not assess micronutrients, fiber quality, medications, or whether keto is appropriate.
Test a changed assumption in the calculator

Sources and content notes

Toolify describes the implemented algorithm and its assumptions. Sources below support the topic or applicable rules; they do not endorse this calculator. Examples are illustrative, and published rules take precedence over simplified estimates.

Report a formula, example or translation issue through our contact page. Include the tool name, inputs and expected result so it can be reproduced. Contact Toolify

From question to result

Continue with a related question

Explore all Calories & nutrition tools and guides