Sedentary (little or no exercise)
Lightly active (light exercise/sports 1-3 days/week)
Moderately active (moderate exercise/sports 3-5 days/week)
Very active (hard exercise/sports 6-7 days a week)
Extra active (very hard exercise/sports & physical job)
Weight Loss
Maintenance
Muscle Gain
Understanding Your Keto Macros
The ketogenic diet, often called "keto," is a very low-carbohydrate, high-fat diet. The primary goal is to shift your body's primary fuel source from glucose (from carbohydrates) to ketones (from fat). This metabolic state is known as ketosis. To achieve and maintain ketosis, it's crucial to track your macronutrient intake – protein, fat, and carbohydrates. This calculator helps you determine personalized daily macro targets based on your individual characteristics and goals.
How the Calculation Works
Our keto macro calculator uses a common approach that involves several steps:
Basal Metabolic Rate (BMR): First, we estimate your BMR, which is the number of calories your body needs to perform basic life-sustaining functions at rest. We use the Mifflin-St Jeor equation, which is considered more accurate for most individuals:
For men: BMR = (10 × weight in kg) + (6.25 × height in cm) – (5 × age in years) + 5
For women: BMR = (10 × weight in kg) + (6.25 × height in cm) – (5 × age in years) – 161
Total Daily Energy Expenditure (TDEE): Next, we adjust your BMR based on your activity level to estimate your TDEE. This represents the total number of calories you burn in a day, including all physical activities. The multiplier for activity level is:
Sedentary: BMR × 1.2
Lightly active: BMR × 1.375
Moderately active: BMR × 1.55
Very active: BMR × 1.725
Extra active: BMR × 1.9
Calorie Target based on Goal: Your TDEE is then adjusted based on your specific keto goal:
Weight Loss: A deficit of 20-30% is typically applied to the TDEE. For example, TDEE × 0.75.
Maintenance: Your TDEE is used as your calorie target.
Muscle Gain: A surplus of 10-15% is usually added to the TDEE. For example, TDEE × 1.15.
Macronutrient Breakdown: Finally, the calorie target is converted into grams of macronutrients. On a ketogenic diet, the macro split is generally:
Carbohydrates: Typically 5-10% of total calories. We use 5% as a standard target for strict ketosis. (1 gram of carbohydrate = 4 calories)
Protein: Usually set between 20-30% of total calories, often calculated based on lean body mass to preserve muscle. For simplicity, we use 25% as a common target. (1 gram of protein = 4 calories)
Fat: Makes up the remainder of the calories, typically 65-75%. (1 gram of fat = 9 calories)
So, the target macros would be approximately: 20g Carbs, 101g Protein, 126g Fat.
Why These Macros Matter
Sticking to your calculated macros is key to success on the keto diet.
Carbohydrates: Keeping carbs low (typically under 20-50g net carbs per day) is essential to induce and maintain ketosis.
Protein: Adequate protein intake is vital for preserving muscle mass, especially during weight loss, and supports satiety.
Fat: Fat becomes your primary energy source. Consuming enough healthy fats helps provide energy, support hormone production, and keep you feeling full.
This calculator provides a starting point. Individual needs may vary, and it's always recommended to consult with a healthcare professional or registered dietitian for personalized advice, especially if you have underlying health conditions.
function calculateMacros() {
var weight = parseFloat(document.getElementById("weight").value);
var height = parseFloat(document.getElementById("height").value);
var age = parseFloat(document.getElementById("age").value);
var gender = document.getElementById("gender").value;
var activityLevel = document.getElementById("activityLevel").value;
var ketoGoal = document.getElementById("ketoGoal").value;
var bmr = 0;
// Validate inputs
if (isNaN(weight) || weight <= 0 ||
isNaN(height) || height <= 0 ||
isNaN(age) || age <= 0) {
document.getElementById("result").innerHTML = '
Error
Please enter valid positive numbers for weight, height, and age.';
return;
}
// Calculate BMR using Mifflin-St Jeor Equation
if (gender === "male") {
bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5;
} else { // female
bmr = (10 * weight) + (6.25 * height) – (5 * age) – 161;
}
var tdee = 0;
var activityMultiplier = 1;
switch (activityLevel) {
case "sedentary":
activityMultiplier = 1.2;
break;
case "light":
activityMultiplier = 1.375;
break;
case "moderate":
activityMultiplier = 1.55;
break;
case "very_active":
activityMultiplier = 1.725;
break;
case "extra_active":
activityMultiplier = 1.9;
break;
}
tdee = bmr * activityMultiplier;
var calorieTarget = 0;
var carbPercentage = 0.05; // 5% for strict keto
var proteinPercentage = 0.25; // 25% as a general target
var fatPercentage = 0;
switch (ketoGoal) {
case "weight_loss":
calorieTarget = tdee * 0.75; // 25% deficit
break;
case "maintenance":
calorieTarget = tdee;
break;
case "muscle_gain":
calorieTarget = tdee * 1.15; // 15% surplus
break;
}
// Ensure calorie target is not too low
if (calorieTarget < 1200) {
calorieTarget = 1200; // Minimum reasonable target
}
// Calculate macro grams
var carbGrams = (calorieTarget * carbPercentage) / 4;
fatPercentage = 1 – carbPercentage – proteinPercentage; // Remaining percentage for fat
var proteinGrams = (calorieTarget * proteinPercentage) / 4;
var fatGrams = (calorieTarget * fatPercentage) / 9;
// Display results
var resultHtml = '