Calculate your personalized ketogenic macronutrient targets.
Male
Female
Sedentary (little to 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
Maintain Weight
Muscle Gain
Typically 5% for strict keto
Adjust based on activity and muscle goals
The remainder after carbs and protein
Your Keto Macros
Enter your details to see your results.
Understanding Keto Macros and Your Calculator
The ketogenic diet is a very low-carbohydrate, high-fat diet that shifts your body's primary energy source from glucose (from carbohydrates) to ketones (produced from fat). This metabolic state is known as ketosis.
To achieve and maintain ketosis, it's crucial to adhere to specific macronutrient ratios. Our Keto Macro Calculator helps you determine personalized targets for carbohydrates, protein, and fat based on your individual metrics and goals.
How the Calculator Works
The calculator uses a standard approach to estimate your Basal Metabolic Rate (BMR) and Total Daily Energy Expenditure (TDEE), and then allocates calories to your target macros.
1. Basal Metabolic Rate (BMR) Calculation:
We use the Mifflin-St Jeor equation, which is widely considered one of the most accurate BMR formulas:
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
Your BMR represents the number of calories your body burns at rest to maintain basic functions.
2. Total Daily Energy Expenditure (TDEE) Calculation:
Your TDEE is your BMR multiplied by an activity factor:
TDEE = BMR × Activity Multiplier
The activity multipliers used are approximate:
Sedentary: 1.2
Lightly Active: 1.375
Moderately Active: 1.55
Very Active: 1.725
Extra Active: 1.9
Your TDEE is the estimated number of calories you burn per day, including your activity.
3. Calorie Adjustment for Goals:
Depending on your goal, your target daily calorie intake is adjusted:
Weight Loss: A deficit of approximately 500 calories per day is typically subtracted from TDEE to promote a loss of about 1 pound per week.
Maintain Weight: Target calories will be close to your TDEE.
Muscle Gain: A surplus of approximately 250-500 calories per day is typically added to TDEE to support muscle growth.
The calculator applies a moderate adjustment: 300 calories deficit for loss, 300 calories surplus for gain, and TDEE for maintenance.
4. Macronutrient Distribution:
Once your target daily calorie intake is determined, the calories are distributed according to your chosen macronutrient percentages:
Carbohydrates: The calculator defaults to a strict keto range (e.g., 5%). Fat provides 4 calories per gram.
Protein: Set by user (e.g., 25%). Protein provides 4 calories per gram.
Fat: The remainder of the calories (e.g., 70%). Fat provides 9 calories per gram.
The calculator converts these percentages into grams per day:
Initiating Keto: Newcomers can use this to establish appropriate starting macro targets.
Optimizing Macros: Individuals already on keto can refine their intake to improve results, whether for fat loss, maintenance, or muscle gain.
Activity Adjustments: Athletes or those with highly active lifestyles can adjust their protein and fat intake based on energy expenditure.
Understanding Nutritional Needs: Provides a clearer picture of daily intake requirements for a ketogenic diet.
Remember, these are estimates. Listen to your body, monitor your progress, and adjust your intake as needed. Consulting with a healthcare professional or a registered dietitian is always recommended before making significant dietary changes.
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 goal = document.getElementById("goal").value;
var carbPercentage = parseFloat(document.getElementById("carbPercentage").value);
var proteinPercentage = parseFloat(document.getElementById("proteinPercentage").value);
var fatPercentage = parseFloat(document.getElementById("fatPercentage").value);
var resultDiv = document.getElementById("macroOutput");
resultDiv.innerHTML = "; // Clear previous results
// Validate inputs
if (isNaN(weight) || weight <= 0 ||
isNaN(height) || height <= 0 ||
isNaN(age) || age <= 0 ||
isNaN(carbPercentage) || carbPercentage 100 ||
isNaN(proteinPercentage) || proteinPercentage 100 ||
isNaN(fatPercentage) || fatPercentage 100) {
resultDiv.innerHTML = 'Please enter valid positive numbers for all fields.';
return;
}
if (carbPercentage + proteinPercentage + fatPercentage !== 100) {
resultDiv.innerHTML = 'Macro percentages must add up to 100%.';
return;
}
// Calculate BMR (Mifflin-St Jeor Equation)
var bmr;
if (gender === "male") {
bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5;
} else {
bmr = (10 * weight) + (6.25 * height) – (5 * age) – 161;
}
// Calculate TDEE
var activityMultiplier;
switch (activityLevel) {
case "sedentary":
activityMultiplier = 1.2;
break;
case "light":
activityMultiplier = 1.375;
break;
case "moderate":
activityMultiplier = 1.55;
break;
case "very":
activityMultiplier = 1.725;
break;
case "extra":
activityMultiplier = 1.9;
break;
default:
activityMultiplier = 1.2; // Default to sedentary
}
var tdee = bmr * activityMultiplier;
// Calculate Target Calories based on goal
var targetCalories;
if (goal === "lose") {
targetCalories = tdee – 300; // Moderate deficit for weight loss
} else if (goal === "gain") {
targetCalories = tdee + 300; // Moderate surplus for muscle gain
} else {
targetCalories = tdee; // Maintain weight
}
// Calculate Macronutrient Grams
var carbCalories = targetCalories * (carbPercentage / 100);
var proteinCalories = targetCalories * (proteinPercentage / 100);
var fatCalories = targetCalories * (fatPercentage / 100);
var carbGrams = carbCalories / 4;
var proteinGrams = proteinCalories / 4;
var fatGrams = fatCalories / 9;
// Display Results
resultDiv.innerHTML = `
Your Estimated Daily Calories: ${Math.round(targetCalories)} kcal
Carbohydrates: ${Math.round(carbGrams)} g (${carbPercentage}%)
Protein: ${Math.round(proteinGrams)} g (${proteinPercentage}%)
Fat: ${Math.round(fatGrams)} g (${fatPercentage}%)