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/physical job)
Maintain Weight
Lose Weight
Gain Muscle
Your Keto Macros
Enter your details to get started.
Understanding Your Keto Macros
The Ketogenic (Keto) diet is a high-fat, moderate-protein, and very low-carbohydrate diet. The primary goal is to shift 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 track your macronutrient intake – specifically carbohydrates, protein, and fat. This calculator helps you estimate your personalized daily macro targets based on your individual characteristics and goals.
How Your Macros Are Calculated
The calculation involves several steps:
1. Basal Metabolic Rate (BMR) Estimation:
Your BMR 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 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
2. Total Daily Energy Expenditure (TDEE):
Your TDEE is the total number of calories you burn in a day, including your BMR and activity level. We multiply your BMR by an activity factor:
Your daily calorie target is adjusted based on your specific keto goal:
Maintain Weight: Your target is your TDEE.
Lose Weight: We create a calorie deficit. A common deficit is 500 calories per day for approximately 0.5 kg (1 lb) of weight loss per week. The calculator adjusts based on your desired weekly loss rate.
Gain Muscle: We create a calorie surplus. A surplus of 250-500 calories per day is typical for lean muscle gain. The calculator adjusts based on your desired weekly gain rate.
Calorie Target = TDEE – (Weekly Deficit/Surplus in kg * 1100)
*(Approximately 1100 calories per 0.5 kg of body weight change)*
4. Macronutrient Distribution on Keto:
The hallmark of a keto diet is its macronutrient ratio:
Carbohydrates: Typically 5-10% of total calories, often capped at 20-50g net carbs per day. We aim for 5%.
Protein: Crucial for muscle maintenance and repair. Typically 20-30% of total calories. We aim for 25%.
Fat: The primary energy source, making up the remainder, typically 70-75% of total calories. We aim for 70%.
*(Note: Carbohydrates and protein have 4 calories per gram, while fat has 9 calories per gram.)*
Using the Calculator
To get your personalized keto macro targets:
Enter your current weight in kilograms (kg).
Enter your height in centimeters (cm).
Enter your age in years.
Select your gender.
Choose your typical activity level.
Select your primary goal on the keto diet (Maintain, Lose Weight, or Gain Muscle).
If you selected "Lose Weight" or "Gain Muscle", specify your desired weekly rate in kilograms.
Click "Calculate My Macros".
The calculator will then display your estimated daily calorie target and the breakdown of your macronutrient goals in grams.
Important Considerations:
This calculator provides an estimate. Individual needs can vary significantly based on genetics, metabolism, body composition, and specific health conditions.
It's highly recommended to consult with a healthcare professional or a registered dietitian before starting any new diet, especially the ketogenic diet, to ensure it's appropriate and safe for you.
Net carbs (Total Carbs – Fiber) are typically what keto dieters focus on. While this calculator gives total carb targets, keeping net carbs low is key.
Adjust your intake based on how your body responds. Monitor your energy levels, hunger, and progress towards your goals.
function getSelectedOptionValue(selectId) {
var selectElement = document.getElementById(selectId);
return selectElement.options[selectElement.selectedIndex].value;
}
function calculateMacros() {
var weightKg = parseFloat(document.getElementById('weightKg').value);
var heightCm = parseFloat(document.getElementById('heightCm').value);
var age = parseFloat(document.getElementById('age').value);
var gender = getSelectedOptionValue('gender');
var activityLevel = getSelectedOptionValue('activityLevel');
var ketoGoal = getSelectedOptionValue('ketoGoal');
var weightLossRate = parseFloat(document.getElementById('weightLossRate').value);
var muscleGainRate = parseFloat(document.getElementById('muscleGainRate').value);
var resultDiv = document.getElementById('result');
resultDiv.innerHTML = "; // Clear previous results
// Input validation
if (isNaN(weightKg) || weightKg <= 0 ||
isNaN(heightCm) || heightCm <= 0 ||
isNaN(age) || age <= 0) {
resultDiv.innerHTML = 'Please enter valid positive numbers for weight, height, and age.';
return;
}
var bmr;
if (gender === 'male') {
bmr = (10 * weightKg) + (6.25 * heightCm) – (5 * age) + 5;
} else { // female
bmr = (10 * weightKg) + (6.25 * heightCm) – (5 * age) – 161;
}
var activityFactor;
switch (activityLevel) {
case 'sedentary':
activityFactor = 1.2;
break;
case 'light':
activityFactor = 1.375;
break;
case 'moderate':
activityFactor = 1.55;
break;
case 'very_active':
activityFactor = 1.725;
break;
case 'extra_active':
activityFactor = 1.9;
break;
default:
activityFactor = 1.2; // Default to sedentary if something goes wrong
}
var tdee = bmr * activityFactor;
var calorieTarget;
if (ketoGoal === 'weight_loss') {
if (isNaN(weightLossRate) || weightLossRate <= 0) {
resultDiv.innerHTML = 'Please enter a valid weekly weight loss rate (e.g., 0.5 kg).';
return;
}
// Approx 1100 kcal deficit per 0.5 kg of body weight change
var dailyCalorieAdjustment = (weightLossRate * 1100) / 7;
calorieTarget = tdee – dailyCalorieAdjustment;
} else if (ketoGoal === 'muscle_gain') {
if (isNaN(muscleGainRate) || muscleGainRate <= 0) {
resultDiv.innerHTML = 'Please enter a valid weekly muscle gain rate (e.g., 0.25 kg).';
return;
}
var dailyCalorieAdjustment = (muscleGainRate * 1100) / 7;
calorieTarget = tdee + dailyCalorieAdjustment;
} else { // maintenance
calorieTarget = tdee;
}
// Ensure calorie target doesn't go unrealistically low for weight loss
if (ketoGoal === 'weight_loss' && calorieTarget 3500) {
calorieTarget = 3500;
}
calorieTarget = Math.round(calorieTarget);
var carbGrams = Math.round((calorieTarget * 0.05) / 4);
var proteinGrams = Math.round((calorieTarget * 0.25) / 4);
var fatGrams = Math.round((calorieTarget * 0.70) / 9);
// Ensure minimum sensible macros for very low calorie targets
if (calorieTarget < 1500) {
if (carbGrams < 20) carbGrams = 20;
if (proteinGrams < 80) proteinGrams = 80;
if (fatGrams < 100) fatGrams = 100;
// Recalculate calories based on minimum grams to ensure ratios are met if adjusted
calorieTarget = (carbGrams * 4) + (proteinGrams * 4) + (fatGrams * 9);
calorieTarget = Math.round(calorieTarget);
}
resultDiv.innerHTML = `
Your estimated daily calories: ${calorieTarget} kcal
Carbohydrates: ${carbGrams}g
Protein: ${proteinGrams}g
Fat: ${fatGrams}g
`;
}
// Show/hide goal-specific input groups
function toggleGoalInputs() {
var ketoGoal = getSelectedOptionValue('ketoGoal');
var weightLossGroup = document.getElementById('weightLossRateGroup');
var muscleGainGroup = document.getElementById('muscleGainRateGroup');
if (ketoGoal === 'weight_loss') {
weightLossGroup.style.display = 'flex';
muscleGainGroup.style.display = 'none';
document.getElementById('weightLossRate').value = "; // Clear value
} else if (ketoGoal === 'muscle_gain') {
weightLossGroup.style.display = 'none';
muscleGainGroup.style.display = 'flex';
document.getElementById('muscleGainRate').value = "; // Clear value
} else {
weightLossGroup.style.display = 'none';
muscleGainGroup.style.display = 'none';
}
}
// Add event listeners to goal select to trigger toggle
document.getElementById('ketoGoal').addEventListener('change', toggleGoalInputs);
// Initial check on page load
toggleGoalInputs();