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 & physical job)
Lose Weight (Moderate deficit)
Maintain Weight
Gain Muscle (Moderate surplus)
Your Keto Macros
Fat
— g
Protein
— g
Carbohydrates
— g
Estimated Daily Calorie Needs: — kcal
Understanding Your Keto Macros
The ketogenic diet is a very low-carbohydrate, high-fat diet that has gained popularity for its potential health benefits, including weight management, improved blood sugar control, and increased energy levels. To successfully follow a keto diet, it's crucial to understand and calculate your macronutrient targets, often referred to as "macros."
What are Macronutrients?
Macronutrients are the nutrients your body needs in large amounts to provide energy. They include carbohydrates, proteins, and fats. The proportions of these macros are what define a specific diet, like the ketogenic diet.
The Keto Diet Philosophy
A standard ketogenic diet typically aims for:
Fat: 70-80% of daily calories
Protein: 20-25% of daily calories
Carbohydrates: 5-10% of daily calories
This high-fat, moderate-protein, and very low-carbohydrate intake encourages your body to enter a metabolic state called ketosis, where it burns fat for fuel instead of glucose (from carbohydrates).
How the Keto Macro Calculator Works
This calculator uses a two-step process:
Basal Metabolic Rate (BMR) Calculation: We first estimate your BMR, which is the number of calories your body burns at rest. The Mifflin-St Jeor equation is a widely accepted formula for this:
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) Calculation: Your BMR is then multiplied by an activity factor to estimate your TDEE, the total calories you burn per day, including physical activity. The activity factors used are standard multipliers:
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: Based on your weight goal (lose, maintain, gain), a calorie adjustment is applied to your TDEE to set your target daily calorie intake. A moderate deficit for weight loss is assumed to be 500 kcal/day, and a moderate surplus for muscle gain is 250 kcal/day.
Macronutrient Calculation: Finally, your target daily calories are distributed according to your chosen percentages for carbohydrates and protein. Fat intake is the remaining percentage. The grams for each macro are calculated as follows:
Protein (grams): (Target Calories × Protein Percentage) / 4 kcal/g
Note that carbohydrates and protein provide 4 calories per gram, while fat provides 9 calories per gram.
Why These Macros Matter
Fat: The primary energy source on a keto diet.
Protein: Essential for maintaining muscle mass, hormone production, and other bodily functions. It's important not to consume too much protein, as excess can be converted to glucose (gluconeogenesis), potentially hindering ketosis.
Carbohydrates: Kept very low (typically under 50g, often under 20g net carbs per day) to force the body into ketosis.
Use this calculator as a starting point. Individual needs can vary, so monitor your progress and adjust your macros as necessary. Consulting with a healthcare professional or a registered dietitian is always recommended when 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 = parseFloat(document.getElementById("activityLevel").value);
var goalAdjustment = parseFloat(document.getElementById("goal").value);
var carbPercentage = parseFloat(document.getElementById("carbPercentage").value);
var proteinPercentage = parseFloat(document.getElementById("proteinPercentage").value);
// Input validation
if (isNaN(weight) || isNaN(height) || isNaN(age) || isNaN(activityLevel) || isNaN(goalAdjustment) || isNaN(carbPercentage) || isNaN(proteinPercentage) || weight <= 0 || height <= 0 || age <= 0 || carbPercentage < 0 || proteinPercentage = 100) {
alert("Carbohydrate and Protein percentages combined must be less than 100%.");
return;
}
// 1. Calculate BMR using Mifflin-St Jeor Equation
var bmr = 0;
if (gender === "male") {
bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5;
} else { // female
bmr = (10 * weight) + (6.25 * height) – (5 * age) – 161;
}
// 2. Calculate TDEE
var tdee = bmr * activityLevel;
// 3. Adjust TDEE for goal
var targetCalories = tdee + goalAdjustment;
// Ensure target calories are not excessively low or negative
if (targetCalories < 1200) {
targetCalories = 1200; // Set a minimum floor for calories
}
// 4. Calculate Macro grams
var fatPercentage = 100 – carbPercentage – proteinPercentage;
var proteinGrams = (targetCalories * (proteinPercentage / 100)) / 4;
var carbGrams = (targetCalories * (carbPercentage / 100)) / 4;
var fatGrams = (targetCalories * (fatPercentage / 100)) / 9;
// Display results
document.getElementById("fatGrams").innerText = fatGrams.toFixed(1);
document.getElementById("proteinGrams").innerText = proteinGrams.toFixed(1);
document.getElementById("carbGrams").innerText = carbGrams.toFixed(1);
document.getElementById("calories").innerText = targetCalories.toFixed(0);
document.getElementById("result").style.display = "block";
}