# Keto Calculator (Ketogenic Diet Macros)

URL: https://speedycalculator.com/calculators/health/keto/
Last updated: 2026-10-30

> The keto calculator sets ketogenic diet macros: it estimates your daily energy needs, applies a deficit if you want to lose fat, caps net carbs at your chosen limit, sets protein from lean body mass and fills the rest with fat.

## Inputs

- Sex
- Age (years)
- Weight (kg, lb, st, g)
- Height (cm, in, m, ft, mm)
- Body fat (%)
- Activity level
- Net carbs (g/day)
- Protein ratio (g per kg lean mass)
- Calorie deficit (%)

## Results

- Lean body mass
- TDEE
- Target calories
- Protein
- Net carbs
- Fat
- Fat share of calories
- Protein share
- Carb share

## Formula

```
Lean mass = weight × (1 − body fat %)
Target kcal = TDEE × (1 − deficit %)
Protein g = lean mass × protein g/kg
Fat g = (target − net carbs × 4 − protein × 4) ÷ 9
```

## Explanation

A ketogenic diet keeps carbohydrates low enough – usually 20–50 g of net carbs a day – that the body shifts to burning fat and producing ketones. Protein is set moderately, from lean mass, so it does not interfere with ketosis.

### How to use the Keto Calculator

- **Sex**
- **Age**
- **Weight**
- **Height**
- **Body fat**
- **Activity level**
- **Net carbs**
- **Protein ratio**
- **Calorie deficit**

Results update as you type, and every field accepts the units shown in its menu.

### How it works

Enter your details, body fat, activity, net-carb limit, protein ratio and deficit. The calculator works out your TDEE, target calories and each macro in grams and as a percentage of calories.

### Inputs explained

FieldWhat to enterSexChoose one: Male, FemaleAgeIn yearsWeightUnits: kg, lb, st, gHeightUnits: cm, in, m, ft, mmBody fatIn %Activity levelChoose one: Basal metabolic rate (no activity), Sedentary – little or no exercise, Light – exercise 1–3 times a week, Moderate – exercise 4–5 times a week …Net carbsIn g/dayProtein ratioIn g per kg lean massCalorie deficitIn %

### What each result means

- **Lean body mass** = [Weight]×(1 - [Body fat]÷100)
- **TDEE** = (370 + 21.6×[Lean body mass])×[Activity level]
- **Target calories** = [TDEE]×(1 - [Calorie deficit]÷100)
- **Protein** = [Lean body mass]×[Protein ratio]
- **Fat** = max(([Target calories] - [Net carbs]×4 - [Protein]×4)÷9, 0)
- **Fat share of calories** = [Fat]×9÷[Target calories]×100
- **Protein share** = [Protein]×4÷[Target calories]×100
- **Carb share** = [Net carbs]×4÷[Target calories]×100

### Example values

How the main result changes when **Age** changes and everything else stays at the example values above:

Age (years)Target calories (kcal/day)151,85222.51,852301,85237.51,852451,852601,852
*Health note: this calculator is for education and screening only and is not a diagnosis or treatment advice. Discuss your results with a qualified clinician.*

## Worked example

Inputs — Sex: Male; Age: 30 years; Weight: 75 kg; Height: 178 cm; Body fat: 25 %; Activity level: Light – exercise 1–3 times a week; Net carbs: 25 g/day; Protein ratio: 1.6 g per kg lean mass; Calorie deficit: 15 %.

Results — Lean body mass = 56.3 kg; TDEE = 2,179 kcal/day; **Target calories = 1,852 kcal/day**; Protein = 90 g/day; Net carbs = 25 g/day; Fat = 155 g/day; Fat share of calories = 75 %; Protein share = 19 %; Carb share = 5 %.

## Key terms

- **Net carbs**: Total carbohydrate minus fibre (and sugar alcohols).
- **Ketosis**: A state where the body uses fat-derived ketones for fuel.

## FAQ

**How many carbs can I eat on keto?**
Usually 20–50 g of net carbs a day; 20–25 g is the most reliable for ketosis.

**Does too much protein kick you out of ketosis?**
Moderate protein (about 1.2–2.0 g/kg of lean mass) is fine for most people.

**Is keto safe?**
Many people do well on it short term; people with diabetes on medication, kidney disease or pregnancy should get medical advice first.


## Sources

- [Mifflin MD et al. A new predictive equation for resting energy expenditure in healthy individuals. Am J Clin Nutr, 1990](https://pubmed.ncbi.nlm.nih.gov/2305711/)
- [Roza AM, Shizgal HM. The Harris Benedict equation reevaluated. Am J Clin Nutr, 1984](https://pubmed.ncbi.nlm.nih.gov/6741850/)
- McArdle WD, Katch FI, Katch VL. Exercise Physiology: Nutrition, Energy and Human Performance
- [Masood W et al. Ketogenic diet. StatPearls, 2023](https://www.ncbi.nlm.nih.gov/books/NBK499830/)
