Calculate your ideal daily keto macros for weight loss, maintenance, or muscle gain.
Male
Female
Sedentary (little to no exercise)
Lightly Active (light exercise 1-3 days/week)
Moderately Active (moderate exercise 3-5 days/week)
Very Active (hard exercise 6-7 days/week)
Extra Active (very hard exercise & physical job)
Lose Weight
Maintain Weight
Gain Muscle
Understanding Keto Macronutrient Ratios
The ketogenic diet, often referred to as "keto," is a very low-carbohydrate, high-fat diet that forces the body into a metabolic state called ketosis. In ketosis, your body becomes efficient at burning fat for energy, leading to potential benefits like weight loss, improved blood sugar control, and increased mental clarity.
To achieve and maintain ketosis, it's crucial to understand and adhere to specific macronutrient ratios. Macronutrients are the nutrients your body needs in large amounts: carbohydrates, protein, and fats. On a ketogenic diet, these are typically distributed as follows:
Fat: 70-80% of daily calories
Protein: 20-25% of daily calories
Carbohydrates: 5-10% of daily calories (often limited to 20-50g net carbs per day)
How the Calculator Works
This calculator estimates your daily caloric needs and then breaks them down into macronutrient targets based on standard ketogenic ratios. The process involves several steps:
Basal Metabolic Rate (BMR): This is the number of calories your body needs at rest. We use the Mifflin-St Jeor equation, which is considered one of the most accurate for estimating BMR:
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): This is your BMR multiplied by an activity factor. It represents the total calories you burn in a day, including physical activity.
Sedentary: BMR x 1.2
Lightly Active: BMR x 1.375
Moderately Active: BMR x 1.55
Very Active: BMR x 1.725
Extra Active: BMR x 1.9
Calorie Adjustment for Goal: Your TDEE is then adjusted based on your goal:
Lose Weight: Subtract 500 calories from TDEE (aiming for ~1 lb loss per week).
Maintain Weight: Use TDEE as is.
Gain Muscle: Add 250-500 calories to TDEE (a moderate surplus). For simplicity, this calculator adds 300 calories.
Macronutrient Calculation: The adjusted calorie target is then divided into keto-specific ratios:
Fat: 75% of total calories. Since fat has 9 calories per gram, Fat (g) = (Total Calories * 0.75) / 9.
Protein: 20% of total calories. Since protein has 4 calories per gram, Protein (g) = (Total Calories * 0.20) / 4.
Carbohydrates: 5% of total calories. Since carbs have 4 calories per gram, Carbs (g) = (Total Calories * 0.05) / 4.
Why These Ratios Matter
Sticking to these macro targets is essential for triggering and sustaining ketosis. Insufficient fat intake can lead to hunger and make it harder to stay in ketosis. Too much protein can be converted into glucose through a process called gluconeogenesis, potentially hindering ketosis. Keeping net carbohydrates extremely low is the primary driver for entering ketosis.
Important Note: This calculator provides estimations. Individual metabolic rates and responses to the keto diet can vary. It's always recommended to consult with a healthcare professional or a registered dietitian before making significant dietary changes.
function calculateMacros() {
var currentWeight = parseFloat(document.getElementById("currentWeight").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 goal = document.getElementById("goal").value;
var resultDiv = document.getElementById("result");
resultDiv.style.display = "block";
if (isNaN(currentWeight) || isNaN(height) || isNaN(age) || currentWeight <= 0 || height <= 0 || age <= 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for weight, height, and age.";
resultDiv.style.backgroundColor = "#dc3545"; // Red for error
return;
}
var bmr = 0;
if (gender === "male") {
bmr = (10 * currentWeight) + (6.25 * height) – (5 * age) + 5;
} else { // female
bmr = (10 * currentWeight) + (6.25 * height) – (5 * age) – 161;
}
var activityMultiplier = 1;
switch (activityLevel) {
case "sedentary":
activityMultiplier = 1.2;
break;
case "lightly_active":
activityMultiplier = 1.375;
break;
case "moderately_active":
activityMultiplier = 1.55;
break;
case "very_active":
activityMultiplier = 1.725;
break;
case "extra_active":
activityMultiplier = 1.9;
break;
}
var tdee = bmr * activityMultiplier;
var targetCalories = tdee;
if (goal === "lose") {
targetCalories = tdee – 500;
} else if (goal === "gain") {
targetCalories = tdee + 300; // Moderate surplus for muscle gain
}
// Ensure target calories don't go too low for weight loss
if (targetCalories < 1200) {
targetCalories = 1200;
}
var fatCalories = targetCalories * 0.75;
var proteinCalories = targetCalories * 0.20;
var carbCalories = targetCalories * 0.05;
var fatGrams = fatCalories / 9;
var proteinGrams = proteinCalories / 4;
var carbGrams = carbCalories / 4;
// Rounding to one decimal place for better readability
fatGrams = Math.round(fatGrams * 10) / 10;
proteinGrams = Math.round(proteinGrams * 10) / 10;
carbGrams = Math.round(carbGrams * 10) / 10;
targetCalories = Math.round(targetCalories);
resultDiv.innerHTML =
"
Your Daily Keto Macros:
" +
"
Calories: " + targetCalories + " kcal
" +
"
Fat: " + fatGrams + "g (75%)
" +
"
Protein: " + proteinGrams + "g (20%)
" +
"
Carbohydrates: " + carbGrams + "g (5%)
";
resultDiv.style.backgroundColor = "var(–success-green)"; // Reset to green
}