Ketogenic Macronutrient Calculator

.keto-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e0e0e0; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); color: #333; } .keto-calc-header { text-align: center; margin-bottom: 30px; } .keto-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .keto-input-group { margin-bottom: 15px; } .keto-input-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; } .keto-input-group input, .keto-input-group select { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 16px; } .keto-calc-btn { grid-column: span 2; background-color: #4CAF50; color: white; padding: 15px; border: none; border-radius: 6px; font-size: 18px; font-weight: bold; cursor: pointer; transition: background-color 0.3s; margin-top: 10px; } .keto-calc-btn:hover { background-color: #45a049; } .keto-results { margin-top: 30px; padding: 20px; background-color: #f9f9f9; border-radius: 8px; display: none; } .keto-results h3 { margin-top: 0; color: #2e7d32; text-align: center; } .macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; margin-top: 20px; } .macro-box { padding: 15px; border-radius: 8px; color: white; } .box-calories { background-color: #333; } .box-fats { background-color: #f39c12; } .box-protein { background-color: #e74c3c; } .box-carbs { background-color: #3498db; } .macro-value { font-size: 24px; font-weight: bold; display: block; } .macro-label { font-size: 12px; text-transform: uppercase; } .keto-article { margin-top: 40px; line-height: 1.6; } .keto-article h2 { color: #2e7d32; margin-top: 30px; } .keto-article p { margin-bottom: 15px; } @media (max-width: 600px) { .keto-calc-grid { grid-template-columns: 1fr; } .keto-calc-btn { grid-column: span 1; } .macro-grid { grid-template-columns: 1fr 1fr; } }

Ketogenic Macronutrient Calculator

Calculate your daily calories and macros to reach nutritional ketosis.

Male Female
Sedentary (Office job) Lightly Active (1-2 days/week) Moderately Active (3-5 days/week) Very Active (6-7 days/week) Extra Active (Physical labor)
Weight Loss (20% Deficit) Maintenance Muscle Gain (10% Surplus)

Your Daily Targets

0 Calories
0 Fats (g)
0 Protein (g)
25 Net Carbs (g)

Ratio: ~70% Fats | ~25% Protein | ~5% Net Carbs

How to Use the Keto Macro Calculator

Transitioning into ketosis requires a precise balance of macronutrients. Unlike a standard diet where carbohydrates are the primary energy source, a ketogenic diet shifts your metabolism to burn fat (ketones) for fuel. This calculator uses the Mifflin-St Jeor equation to determine your Basal Metabolic Rate (BMR) and adjusts it based on your activity level and body goals.

The Standard Keto Ratio

While everyone is different, the "Standard Ketogenic Diet" (SKD) generally follows these guidelines:

  • Low Carbohydrates: Usually 20g to 50g of net carbs per day to keep insulin levels low.
  • Moderate Protein: Roughly 1.6g to 2.2g of protein per kilogram of lean body mass to maintain muscle.
  • High Fat: The remainder of your calories come from healthy fats to provide energy and satiety.

Understanding the Results

Net Carbs: We set a default of 25g net carbs. Net carbs are calculated by subtracting fiber and sugar alcohols from total carbohydrates. Staying under this limit is the most critical factor for entering ketosis.

Protein: This is a goal. You should aim to hit this number daily to prevent muscle wastage, especially if you are in a calorie deficit for weight loss.

Fats: Fat is a lever. If you are hungry, eat more fat. If you are full and trying to lose weight, you don't necessarily need to "hit" your fat target, as your body will use its own stored fat for fuel.

Example Keto Macro Calculation

For a 30-year-old male, 180cm tall, weighing 90kg with a sedentary lifestyle looking to lose weight:

  • TDEE: ~2,200 calories.
  • Weight Loss Target (20% deficit): ~1,760 calories.
  • Protein (1.8g/kg): 162g (648 kcal).
  • Net Carbs: 25g (100 kcal).
  • Fats (Remainder): 112g (1012 kcal).
function calculateKeto() { var gender = document.getElementById("ketoGender").value; var age = parseFloat(document.getElementById("ketoAge").value); var weight = parseFloat(document.getElementById("ketoWeight").value); var height = parseFloat(document.getElementById("ketoHeight").value); var activity = parseFloat(document.getElementById("ketoActivity").value); var goalModifier = parseFloat(document.getElementById("ketoGoal").value); if (isNaN(age) || isNaN(weight) || isNaN(height)) { alert("Please enter valid numbers for age, weight, and height."); return; } // BMR Calculation (Mifflin-St Jeor) var bmr; if (gender === "male") { bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5; } else { bmr = (10 * weight) + (6.25 * height) – (5 * age) – 161; } // TDEE and Goal Adjustment var tdee = bmr * activity; var targetCalories = Math.round(tdee * goalModifier); // Macro Calculation // 1. Carbs: Fixed at 25g for standard keto var carbsGrams = 25; var carbsCalories = carbsGrams * 4; // 2. Protein: 1.8g per kg of weight (Moderate/High for muscle preservation) var proteinGrams = Math.round(weight * 1.8); var proteinCalories = proteinGrams * 4; // 3. Fats: Remainder of calories var remainingCalories = targetCalories – carbsCalories – proteinCalories; // Safety check: if calories are too low, ensure protein/carbs don't exceed target if (remainingCalories < 0) { remainingCalories = 0; } var fatsGrams = Math.round(remainingCalories / 9); // Display Results document.getElementById("resCalories").innerText = targetCalories; document.getElementById("resFats").innerText = fatsGrams; document.getElementById("resProtein").innerText = proteinGrams; document.getElementById("resCarbs").innerText = carbsGrams; document.getElementById("ketoResults").style.display = "block"; // Smooth scroll to results document.getElementById("ketoResults").scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }

Leave a Comment