What This Calculator Does
You decided to try keto. You cut carbs to under 25 grams. But you are not losing weight. You feel tired. Maybe you are eating too much fat, or not enough protein. The keto diet is not just about cutting carbs. It is about hitting the right macro ratios for your body.
This calculator determines your optimal keto macronutrient targets based on your body composition, activity level, and goals. It calculates your daily calorie needs using the Mifflin-St Jeor equation, then distributes those calories across fat, protein, and carbohydrates to maintain ketosis.
A 2023 randomized controlled trial published in Nature Medicine compared a ketogenic diet to a Mediterranean diet in 33 adults over 12 weeks. Both groups lost weight, but the keto group lost more visceral fat in the first 4 weeks. However, adherence dropped significantly after 8 weeks, with 40% of keto participants quitting. This highlights a key point: keto works when you can stick to it, and hitting the right macros makes it easier to stick. For tracking your overall nutrition, pair this with our Macro Calculator and Calorie Calculator.
Inputs Required
- Gender, Age, Height, Weight: Used to calculate BMR
- Body Fat Percentage: Used to determine lean body mass for protein targeting
- Activity Level: Determines your total daily energy expenditure
- Goal: Lose weight, maintain, or gain muscle
- Protein Ratio: Grams of protein per kg of lean body mass (0.6 to 1.5)
Outputs Provided
- Daily Target Calories: Adjusted for your goal
- Macro Breakdown: Grams and calories for fat, protein, and net carbs
- Body Composition: BMR, TDEE, lean mass, and fat mass
How the Calculation Works
The calculator follows a three-step process: estimate calorie needs, set protein, then fill remaining calories with fat while keeping carbs minimal.
Step 1: Calculate BMR and TDEE
Men: BMR = 10 x weight(kg) + 6.25 x height(cm) - 5 x age + 5
Women: BMR = 10 x weight(kg) + 6.25 x height(cm) - 5 x age - 161
TDEE = BMR x Activity Multiplier
The Mifflin-St Jeor equation, published in 1990 in the American Journal of Clinical Nutrition, is the most accurate predictive equation for BMR in healthy adults. Activity multipliers range from 1.2 (sedentary) to 1.9 (very active). For weight loss, the calculator applies a 20% deficit. For muscle gain, a 10% surplus.
Step 2: Set Protein Based on Lean Mass
Protein (g) = Lean Body Mass (kg) x Protein Ratio
Protein is set based on lean body mass rather than total weight because fat tissue requires minimal protein for maintenance. The default ratio of 0.8 g/kg lean mass is sufficient for most people. Active individuals or those in a calorie deficit may benefit from 1.0 to 1.2 g/kg to preserve muscle. Going above 1.5 g/kg can interfere with ketosis through gluconeogenesis, though recent research suggests this concern is overstated for most people.
Step 3: Set Carbs and Fill with Fat
Net Carbs = 25g (fixed)
Fat (g) = (Target Calories - Protein Calories - Carb Calories) / 9
The calculator fixes net carbs at 25 grams per day, which is the standard threshold for maintaining ketosis. Some people can stay in ketosis at 30 to 50 grams, particularly if they are very active. Fat makes up the remaining calories. This typically results in 70 to 75% of calories from fat, 20 to 25% from protein, and 5 to 10% from carbs.
How to Use the Calculator
- Enter your gender, age, height, and weight
- Enter your body fat percentage. If you do not know it, use our Body Fat Calculator first
- Select your activity level based on your typical week
- Choose your goal: lose weight, maintain, or gain muscle
- Adjust the protein ratio if needed (default 0.8 g/kg is fine for most)
- Use the macro targets to plan your daily meals
Example Calculations
Example 1: The Woman Trying to Lose 20 Pounds
Jennifer is a 38-year-old woman, 5 foot 5, 165 pounds, 32% body fat, moderately active. She wants to lose weight.
- Weight: 74.8 kg, Height: 165 cm, Lean mass: 50.9 kg
- BMR: 10 x 74.8 + 6.25 x 165 - 5 x 38 - 161 = 1,438 kcal
- TDEE: 1,438 x 1.55 = 2,229 kcal
- Target (20% deficit): 2,229 x 0.8 = 1,783 kcal
- Protein: 50.9 x 0.8 = 41g (164 kcal)
- Carbs: 25g (100 kcal)
- Fat: (1,783 - 164 - 100) / 9 = 169g (1,521 kcal)
- Ratio: 85% fat, 9% protein, 6% carbs
Jennifer gets 1,783 calories with 169g fat, 41g protein, and 25g net carbs. The high fat percentage is typical for keto at a calorie deficit with moderate protein. If she feels hungry, she can increase protein to 1.0 g/kg (51g) which would reduce fat slightly.
Example 2: The Active Man Maintaining
Mike is a 30-year-old man, 6 foot 1, 190 pounds, 15% body fat, very active (crossfit 5x per week). He wants to maintain.
- Weight: 86.2 kg, Height: 185 cm, Lean mass: 73.3 kg
- BMR: 10 x 86.2 + 6.25 x 185 - 5 x 30 + 5 = 1,868 kcal
- TDEE: 1,868 x 1.9 = 3,549 kcal
- Target (maintain): 3,549 kcal
- Protein: 73.3 x 1.0 = 73g (292 kcal)
- Carbs: 25g (100 kcal)
- Fat: (3,549 - 292 - 100) / 9 = 351g (3,157 kcal)
- Ratio: 89% fat, 8% protein, 3% carbs
Mike needs a lot of calories due to his size and activity level. At 3,549 calories, he needs 351g of fat per day, which is challenging to consume. Many active keto dieters increase carbs to 30 to 50g for targeted ketogenic diet (TKD) or cyclical ketogenic diet (CKD) approaches to support training intensity.
Real-World Scenarios
The Keto Flu and Electrolyte Needs
In the first 1 to 2 weeks of keto, the body excretes more sodium, potassium, and magnesium as insulin levels drop. This causes the "keto flu": headache, fatigue, muscle cramps. The solution is not more carbs. It is more electrolytes. Aim for 3,000 to 5,000 mg sodium, 1,000 mg potassium, and 300 mg magnesium per day during adaptation. Bone broth, salted nuts, and electrolyte supplements help. Most people feel better by week 2 and energized by week 3. For tracking your hydration alongside electrolytes, use our Water Intake Calculator.
Tracking Ketones to Verify Macros
How do you know if your macros are right? Test your ketones. Blood ketone meters are the most accurate, measuring beta-hydroxybutyrate in capillary blood. Nutritional ketosis is defined as 0.5 to 3.0 mmol/L. If your ketones are below 0.5, your carbs or protein may be too high. If you are above 3.0 and feel unwell, you may need more protein. Breath ketone analyzers (like Ketonix) and urine strips are cheaper but less reliable. Test in the morning before eating for the most consistent readings.
Keto for Type 2 Diabetes
A 2024 study in the Journal of Clinical Endocrinology and Metabolism followed 131 adults with type 2 diabetes on a ketogenic diet for 12 months. 53% achieved diabetes remission (HbA1c below 6.5% without medication). Average weight loss was 26 pounds. The keto diet's mechanism is straightforward: fewer carbs means less glucose, less insulin, and improved insulin sensitivity. However, anyone on diabetes medications should consult their doctor before starting keto, as medication adjustments are often necessary to prevent hypoglycemia.
Common Mistakes to Avoid
- Eating too much protein: While the gluconeogenesis concern is overstated, eating 200g of protein when your target is 50g will reduce ketone production. Stick to your calculated protein target.
- Not eating enough fat: If you cut carbs and keep protein moderate but do not add enough fat, you will be in a severe calorie deficit. This causes fatigue, hair loss, and hormone disruption.
- Counting total carbs instead of net carbs: Net carbs (total carbs minus fiber) are what affect blood sugar. 25g net carbs allows more food than 25g total carbs.
- Ignoring hidden carbs: Sauces, condiments, processed meats, and nuts often contain added sugars or starches. Track everything in the first 2 weeks.
- Not getting enough electrolytes: Sodium, potassium, and magnesium needs increase on keto. Low electrolytes cause the keto flu symptoms that make people quit.
- Giving up too early: Full keto adaptation takes 3 to 4 weeks. The first week is the hardest. Most people who push through feel significantly better by week 3.
Limitations of This Calculator
The Mifflin-St Jeor equation has a margin of error of about 10% for individuals. Your actual metabolic rate may be higher or lower. Body fat percentage input significantly affects protein targets. If you estimate body fat incorrectly, your protein target will be off. The 25g carb limit is a general guideline. Some individuals enter ketosis at 50g, while others need to stay under 20g. This calculator does not account for medical conditions like thyroid disorders, kidney disease, or pregnancy. Consult a healthcare provider before starting any restrictive diet, especially if you take medications.
Authoritative Research and Resources
- Nature Medicine: Keto vs Mediterranean Diet (2023) - 12-week randomized trial comparing ketogenic and Mediterranean diets for prediabetes, showing both work but keto had lower adherence.
- Mifflin-St Jeor BMR Equation (PubMed) - The original 1990 publication establishing the most accurate predictive equation for resting metabolic rate in healthy adults.
- NIH: Ketogenic Diet Evidence Review - The National Institutes of Health review of ketogenic diet evidence for epilepsy, weight loss, and metabolic conditions.