Sedentary (little to no exercise)
Lightly Active (exercise 1-3 days/week)
Moderately Active (exercise 3-5 days/week)
Very Active (exercise 6-7 days/week)
Extra Active (very intense exercise daily or physical job)
Maintain Weight
Lose Weight
Gain Muscle
Your Keto Macros Breakdown
Your Estimated Daily Calorie Needs: kcal
Protein Target: g (%)
Fat Target: g (%)
Carbohydrate Target: g (%)
Understanding Keto Diet Macros
The ketogenic (keto) diet is a very low-carbohydrate, high-fat diet that has gained popularity for its potential weight loss and health benefits. The core principle of keto is to shift your body's primary energy source from glucose (derived from carbohydrates) to ketones (produced from fat).
To achieve ketosis, you need to meticulously track your macronutrient intake, which refers to the three main nutrients your body needs: carbohydrates, proteins, and fats. This calculator helps you estimate your ideal daily macro targets based on your personal data and goals.
How the Calculation Works
The calculation involves several steps:
Basal Metabolic Rate (BMR): This is the number of calories your body burns at rest to maintain basic functions. We use the Mifflin-St Jeor equation, which is widely considered one of the most accurate for BMR estimation:
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 to estimate the total calories you burn per day.
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 Adjustment for Goals:
Maintain Weight: Your TDEE is your target calorie intake.
Lose Weight: A deficit of 500-1000 calories per day is typically recommended for a loss of 1-2 pounds per week. We use a default of 500 calories for a 0.5 kg/week loss, adjustable via the 'Weight Change Rate' input (approximately 500-700 kcal deficit per kg of desired loss per week).
Gain Muscle: A surplus of 250-500 calories per day is generally recommended. We use a default of 300 calories for muscle gain.
Macro Macronutrient Ratios for Keto:
Carbohydrates: Typically 5-10% of total calories. We use a strict 5% for this calculator. (1 gram of carbohydrate = 4 calories)
Protein: Typically 20-30% of total calories. We use 25%. (1 gram of protein = 4 calories)
Fat: The remainder, typically 65-75% of total calories. We calculate this after carb and protein are determined. (1 gram of fat = 9 calories)
Using the Calculator
To get your personalized keto macro targets:
Select your Gender.
Enter your Age in years.
Enter your current Weight in kilograms.
Enter your Height in centimeters.
Choose your Activity Level that best describes your lifestyle.
Select your Keto Goal (Maintain, Lose Weight, or Gain Muscle).
If your goal is to Lose Weight or Gain Muscle, you can optionally adjust the Weight Change Rate (in kg per week). The calculator will adjust your calorie target accordingly.
Click "Calculate My Macros".
The results will show your estimated daily calorie needs and the breakdown into grams and percentages for carbohydrates, protein, and fat.
Important Considerations
This calculator provides estimations. Individual needs can vary based on genetics, specific health conditions, and metabolic responses. It's always recommended to consult with a healthcare professional or a registered dietitian before starting any new diet plan, especially the ketogenic diet.
function calculateMacros() {
var gender = document.getElementById("gender").value;
var age = parseFloat(document.getElementById("age").value);
var weight = parseFloat(document.getElementById("weight").value);
var height_cm = parseFloat(document.getElementById("height_cm").value);
var activityLevel = document.getElementById("activityLevel").value;
var ketoGoal = document.getElementById("ketoGoal").value;
var weightChangeRate = parseFloat(document.getElementById("weightChangeRate").value);
var bmr = 0;
if (isNaN(age) || isNaN(weight) || isNaN(height_cm)) {
alert("Please enter valid numbers for Age, Weight, and Height.");
return;
}
// Calculate BMR using Mifflin-St Jeor equation
if (gender === "male") {
bmr = (10 * weight) + (6.25 * height_cm) – (5 * age) + 5;
} else { // female
bmr = (10 * weight) + (6.25 * height_cm) – (5 * age) – 161;
}
var activityMultiplier = 0;
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;
default:
activityMultiplier = 1.2; // Default to sedentary if no valid option
}
var tdee = bmr * activityMultiplier;
var targetCalories = tdee;
// Adjust calories based on goal
if (ketoGoal === "lose") {
if (isNaN(weightChangeRate)) weightChangeRate = 0.5; // Default if invalid
var calorieDeficit = weightChangeRate * 1100; // Approx 1100 kcal deficit for 1kg fat loss per week
targetCalories = tdee – calorieDeficit;
if (targetCalories < bmr) targetCalories = bmr + 200; // Ensure not too low
} else if (ketoGoal === "gain") {
var calorieSurplus = 300; // Default surplus for muscle gain
targetCalories = tdee + calorieSurplus;
}
// Ensure target calories are not unreasonably low
if (targetCalories < 1200) {
targetCalories = 1200;
}
var carbPercentage = 0.05; // 5%
var proteinPercentage = 0.25; // 25%
var fatPercentage = 1 – carbPercentage – proteinPercentage; // Remaining %
var carbCalories = targetCalories * carbPercentage;
var proteinCalories = targetCalories * proteinPercentage;
var fatCalories = targetCalories * fatPercentage;
var carbGrams = carbCalories / 4;
var proteinGrams = proteinCalories / 4;
var fatGrams = fatCalories / 9;
// Display results
document.getElementById("dailyCalories").innerText = Math.round(targetCalories);
document.getElementById("proteinGrams").innerText = Math.round(proteinGrams);
document.getElementById("proteinPercent").innerText = Math.round(proteinPercentage * 100);
document.getElementById("fatGrams").innerText = Math.round(fatGrams);
document.getElementById("fatPercent").innerText = Math.round(fatPercentage * 100);
document.getElementById("carbGrams").innerText = Math.round(carbGrams);
document.getElementById("carbPercent").innerText = Math.round(carbPercentage * 100);
document.getElementById("result").style.display = "block";
}