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 or 2x training)
Understanding Keto Macros and Your Daily Needs
The ketogenic diet, often called "keto," is a low-carbohydrate, high-fat eating plan designed to shift your body into a metabolic state called ketosis. In ketosis, your body becomes efficient at burning fat for energy instead of carbohydrates. To achieve and maintain ketosis, it's crucial to track your macronutrient intake, commonly referred to as "macros." The standard keto macro breakdown is typically:
Fat: 70-75% of daily calories
Protein: 20-25% of daily calories
Carbohydrates: 5-10% of daily calories (usually under 20-50g net carbs per day)
How This Calculator Works
This calculator helps you determine your personalized keto macronutrient targets based on your individual characteristics and activity level. Here's the process:
Basal Metabolic Rate (BMR): First, we estimate your BMR using the Mifflin-St Jeor equation, which is considered one of the most accurate formulas for calculating the number of calories your body needs at rest.
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): Your TDEE is your BMR multiplied by an activity factor. This represents the total calories you burn in a day, considering your physical activity. The activity factors are standard multipliers corresponding to different activity levels.
Calorie Deficit/Surplus (Optional but Recommended): For weight loss, a slight calorie deficit is often recommended (e.g., 10-20% less than TDEE). For weight maintenance, you'd aim for your TDEE. This calculator assumes you are aiming for maintenance or a slight deficit by default, but you can adjust your keto fat percentage to indirectly influence this. For simplicity, this calculation directly uses TDEE for macro breakdown.
Macro Breakdown: Once your target daily calories (based on TDEE) are established, the calculator breaks them down into fat, protein, and carbohydrate grams using the specified keto percentages.
Fat Calories: TDEE * (Keto Fat Percentage / 100)
Protein Calories: TDEE * (Protein Percentage / 100) (Protein is typically set around 25%)
Carbohydrate Calories: TDEE * (Carb Percentage / 100) (Carbs are typically set around 5%)
Conversions:
1 gram of Fat = 9 calories
1 gram of Protein = 4 calories
1 gram of Carbohydrates = 4 calories
Macro Grams: (Calories from Macro / Calories per Gram)
Why Track Macros on Keto?
Strictly adhering to macro targets is essential for staying in ketosis. If your carbohydrate intake is too high, your body may not enter or remain in ketosis, negating the primary goal of the diet. Protein intake needs to be sufficient to preserve muscle mass, while fat intake provides the majority of your energy. This calculator provides a starting point to help you fine-tune your keto journey.
Disclaimer: This calculator is for informational purposes only and does not constitute medical advice. Consult with a healthcare professional or registered dietitian before making any significant changes to your diet, especially when starting a ketogenic diet.
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 = parseFloat(document.getElementById("activityLevel").value);
var ketoPercentage = parseFloat(document.getElementById("ketoPercentage").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = "; // Clear previous results
// Input validation
if (isNaN(weight) || weight <= 0 ||
isNaN(height) || height <= 0 ||
isNaN(age) || age <= 0 ||
isNaN(ketoPercentage) || ketoPercentage 100) {
resultDiv.innerHTML = 'Please enter valid positive numbers for all inputs.';
return;
}
var bmr;
if (gender === "male") {
bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5;
} else {
bmr = (10 * weight) + (6.25 * height) – (5 * age) – 161;
}
var tdee = bmr * activityLevel;
// Standard Keto Macros: 70% Fat, 25% Protein, 5% Carbs (can be adjusted by ketoPercentage input)
var fatPercentage = ketoPercentage;
var carbPercentage = 100 – fatPercentage – 25; // var carbs be the remainder after fat and a fixed protein
if (carbPercentage < 5) carbPercentage = 5; // Ensure carbs are at least 5%
var proteinPercentage = 100 – fatPercentage – carbPercentage; // Adjust protein to fill the rest
var fatCalories = tdee * (fatPercentage / 100);
var proteinCalories = tdee * (proteinPercentage / 100);
var carbCalories = tdee * (carbPercentage / 100);
var fatGrams = fatCalories / 9;
var proteinGrams = proteinCalories / 4;
var carbGrams = carbCalories / 4;
// Ensure non-negative grams
fatGrams = Math.max(0, fatGrams);
proteinGrams = Math.max(0, proteinGrams);
carbGrams = Math.max(0, carbGrams);
resultDiv.innerHTML = `
Your Estimated Daily Macros:
Fat: ${fatGrams.toFixed(1)}g
Protein: ${proteinGrams.toFixed(1)}g
Carbohydrates: ${carbGrams.toFixed(1)}g
(Based on TDEE of approx. ${tdee.toFixed(0)} kcal)
`;
}