Effortlessly determine your daily calorie targets to achieve your desired weight.
Weight Goal Calculator
Enter your current weight in pounds (lbs).
Enter your desired weight in pounds (lbs).
Lose 1 lb per week (-500 calories/day)
Lose 1.5 lbs per week (-750 calories/day)
Lose 2 lbs per week (-1000 calories/day)
Gain 0.5 lbs per week (+250 calories/day)
Gain 1 lb per week (+500 calories/day)
Gain 1.5 lbs per week (+750 calories/day)
Gain 2 lbs per week (+1000 calories/day)
Select your target rate of weight change.
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/week)
Extra Active (very hard exercise/sports & physical job)
Choose the option that best describes your daily activity.
The calorie to goal weight calculator is a crucial tool for anyone looking to manage their body composition effectively. It helps individuals understand the precise relationship between their daily caloric intake and their desired weight outcomes, whether that's losing excess pounds, gaining muscle mass, or maintaining a healthy physique. By inputting current weight, goal weight, desired rate of change, and activity level, this calculator estimates the daily calorie intake needed to achieve those goals. This isn't just about numbers; it's about understanding energy balance – the fundamental principle governing weight. Your body requires a certain amount of energy (calories) to function daily, known as Total Daily Energy Expenditure (TDEE). Adjusting your intake relative to this TDEE is how you influence your weight.
Who should use it? Anyone aiming for weight modification: individuals seeking to lose fat, athletes looking to gain lean muscle, or those wanting to maintain their current weight but needing to understand their caloric needs. It's particularly useful for those who have a specific weight target in mind and want a data-driven approach rather than guesswork.
Common misconceptions include believing that all calories are equal (they aren't in terms of satiety and nutrient density), that rapid weight loss is sustainable or healthy (it often isn't), or that activity level alone dictates calorie needs without considering basal metabolism. This calculator addresses these by factoring in TDEE and providing a structured approach to achieving goals.
Calorie to Goal Weight Calculator: Formula and Mathematical Explanation
The core of the calorie to goal weight calculator relies on the principle of energy balance, often simplified by the equation: Calories In vs. Calories Out. To calculate your target daily calorie intake for weight change, we first need to estimate your Total Daily Energy Expenditure (TDEE) and then adjust it based on your desired weight change.
Step 1: Calculate Basal Metabolic Rate (BMR)
BMR is the number of calories your body burns at rest to maintain basic functions like breathing, circulation, and cell production. A commonly used formula is the Mifflin-St Jeor equation, which is considered more accurate than the older Harris-Benedict equation for most people:
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
Note: For simplicity in this calculator, we'll use a generalized approach that doesn't require height/age, focusing on weight and activity. However, a more precise calculator would include these. A simplified BMR estimation can be approximated based on weight, or often implicitly included in TDEE formulas adjusted by activity. For this calculator's purpose, we'll focus on the TDEE calculation as the primary driver after BMR is conceptually considered.
Step 2: Calculate Total Daily Energy Expenditure (TDEE)
TDEE is your BMR multiplied by an activity factor. It represents the total calories you burn in a day, including physical activity.
TDEE = BMR × Activity Level Factor
(As this calculator omits direct BMR inputs like age/height, it uses the activity level factor as a multiplier on a base metabolic rate estimate derived from weight, or directly estimates TDEE.)
Step 3: Calculate Daily Calorie Adjustment for Weight Change
It's widely accepted that approximately 3,500 calories equate to one pound of body fat. To lose or gain weight at a specific rate, you need to create a consistent calorie deficit or surplus.
To lose 1 lb per week: Need a deficit of 3500 calories / 7 days = 500 calories per day.
To gain 1 lb per week: Need a surplus of 3500 calories / 7 days = 500 calories per day.
(Remember, if the adjustment is negative, adding it means subtracting calories from TDEE for loss, and if it's positive, adding it means increasing calories for gain).
Variables Table
Here's a breakdown of the key variables used:
Variable
Meaning
Unit
Typical Range / Notes
Current Weight
Your present body weight.
lbs
Generally 50 – 1000+ lbs
Goal Weight
Your desired body weight.
lbs
Generally 50 – 1000+ lbs
Desired Weekly Weight Change
The target rate of weight loss or gain.
lbs/week
-2 to +2 lbs/week is generally considered safe and sustainable.
Activity Level Factor
Multiplier representing daily physical activity.
Unitless
1.2 (Sedentary) to 1.9 (Extra Active)
BMR
Calories burned at rest.
kcal/day
Varies greatly based on sex, age, weight, height.
TDEE
Total calories burned daily including activity.
kcal/day
BMR * Activity Factor. Varies greatly.
Daily Calorie Adjustment
Calorie surplus or deficit needed per day.
kcal/day
Positive for surplus (gain), negative for deficit (loss).
Target Daily Calories
The calculated daily calorie intake for weight change.
kcal/day
TDEE + Daily Calorie Adjustment.
Calorie Equivalence
Approximate calories in one pound of body mass.
kcal/lb
~3500 kcal/lb
Practical Examples (Real-World Use Cases)
Example 1: Weight Loss Goal
Sarah wants to lose 15 lbs. She currently weighs 170 lbs and her goal weight is 155 lbs. She works a desk job but goes to the gym 3 times a week, classifying her as 'Moderately Active' (Activity Level Factor: 1.55). She aims to lose 1.5 lbs per week.
Current Weight: 170 lbs
Goal Weight: 155 lbs
Desired Weekly Weight Change: -1.5 lbs/week
Activity Level: Moderately Active (1.55)
Calculation Steps:
Assume a hypothetical BMR of 1500 kcal (based on Sarah's stats).
Result Interpretation: Sarah should aim to consume approximately 1575 calories per day to lose 1.5 lbs per week. This creates a deficit of 750 calories daily, contributing to her goal. Her estimated time to reach her goal would be 15 lbs / 1.5 lbs/week = 10 weeks.
Example 2: Weight Gain Goal
John wants to gain 10 lbs of muscle. He currently weighs 160 lbs and his goal weight is 170 lbs. He lifts weights intensely 5 days a week, making him 'Very Active' (Activity Level Factor: 1.725). He aims to gain 1 lb per week.
Result Interpretation: John should aim for approximately 3433 calories per day to gain 1 lb per week. This provides the necessary surplus for muscle growth. His estimated time to reach his goal is 10 lbs / 1 lb/week = 10 weeks. It's important for John to ensure a significant portion of this gain comes from protein and strength training to maximize muscle gain over fat gain.
How to Use This Calorie to Goal Weight Calculator
Using the calorie to goal weight calculator is straightforward. Follow these steps to get your personalized calorie targets:
Enter Current Weight: Input your current body weight in pounds (lbs).
Enter Goal Weight: Input the weight you aim to achieve, also in pounds (lbs).
Select Desired Weekly Change: Choose how quickly you want to lose or gain weight. For safety and sustainability, experts generally recommend a maximum of 1-2 lbs per week for loss and 0.5-1 lb per week for gain.
Select Activity Level: Accurately assess your daily physical activity. Choose from Sedentary, Lightly Active, Moderately Active, Very Active, or Extra Active based on your lifestyle and exercise habits.
Calculate: Click the "Calculate Target Calories" button.
How to read results:
The calculator will display:
Target Calories: This is your primary result – the daily calorie intake you should aim for.
Basal Metabolic Rate (BMR): The calories your body burns at rest.
Total Daily Energy Expenditure (TDEE): Your estimated total daily calorie burn, factoring in your activity level.
Calories Needed for Goal: The net daily calorie adjustment (surplus or deficit) required.
Decision-making guidance: Use these numbers as a guideline. If you're losing weight too quickly, slightly increase your calorie intake. If you're not seeing results, ensure your activity level assessment is accurate and consider a slight decrease in calories or increase in activity. For muscle gain, focus on protein intake and resistance training alongside the calorie surplus.
Key Factors That Affect Calorie to Goal Weight Results
While the calorie to goal weight calculator provides a solid estimate, several factors can influence your actual results. Understanding these helps in fine-tuning your approach:
Metabolic Adaptation: As you lose weight, your metabolism can slow down slightly. Your TDEE decreases, meaning you might need to adjust your calorie intake further to maintain the same rate of loss.
Body Composition Changes: Weight isn't just fat. Muscle is denser than fat. If you're gaining muscle while losing fat (body recomposition), the scale might not move as expected, even though you're achieving a healthier physique. This calculator primarily tracks scale weight.
Hormonal Fluctuations: Hormones related to stress (cortisol), thyroid function, and reproductive cycles can impact appetite, metabolism, and water retention, affecting weight trends.
Dietary Composition: While total calories matter, the macronutrient split (protein, carbs, fats) affects satiety, muscle repair, and overall health. High protein intake, for instance, can increase satiety and thermogenesis.
Sleep Quality and Quantity: Poor sleep can disrupt hormones that regulate appetite (ghrelin and leptin), leading to increased hunger and potential overeating. It also impacts recovery and metabolism.
Accuracy of Activity Level Input: Overestimating your activity level is a common mistake. Being honest about your daily movement and exercise intensity is crucial for accurate TDEE calculation.
Hydration Levels: Water plays a vital role in metabolism. Dehydration can temporarily slow metabolic processes and be mistaken for hunger.
Medications and Health Conditions: Certain medications (e.g., steroids, some antidepressants) and underlying health issues (like hypothyroidism) can significantly affect metabolism and weight management.
Frequently Asked Questions (FAQ)
Q1: How accurate is the calorie to goal weight calculator?
A: The calculator provides an excellent estimate based on established formulas. However, individual metabolism varies. It's a starting point, and you may need to adjust based on your body's response.
Q2: Is losing/gaining 2 lbs per week safe?
A: Losing 1-2 lbs per week is generally considered safe and sustainable for most individuals. Gaining 2 lbs per week is very aggressive and likely to result in significant fat gain rather than muscle. Consult a healthcare professional for personalized advice, especially for rapid changes.
Q3: What if my current weight and goal weight are the same?
A: If your current and goal weights are identical, the calculator will indicate that your target calories should match your TDEE, suggesting maintenance calories.
Q4: Does the calculator account for exercise calories burned?
A: Yes, the 'Activity Level' input factor inherently accounts for the calories burned during regular exercise and daily movement, contributing to the TDEE calculation.
Q5: How long will it take to reach my goal weight?
A: The calculator provides an estimated time based on your desired weekly change rate. For example, losing 1 lb/week to lose 10 lbs will take approximately 10 weeks.
Q6: Should I use this calculator if I have a medical condition?
A: If you have any underlying health conditions (e.g., diabetes, heart disease, thyroid issues), consult your doctor or a registered dietitian before making significant changes to your diet or exercise regimen. This calculator is for informational purposes.
Q7: What's the difference between BMR and TDEE?
A: BMR is the calories you burn at complete rest, while TDEE includes the calories burned through all daily activities, including exercise.
Q8: How often should I recalculate my targets?
A: It's advisable to recalculate every 10-15 lbs of weight lost or gained, or if your activity level changes significantly. As your weight changes, your TDEE also changes.
function getInputValue(id) {
var input = document.getElementById(id);
return input ? parseFloat(input.value) : NaN;
}
function getSelectValue(id) {
var select = document.getElementById(id);
return select ? parseFloat(select.value) : NaN;
}
function setErroMessage(id, message) {
var errorElement = document.getElementById(id);
if (errorElement) {
errorElement.textContent = message;
}
}
function clearErrorMessages() {
setErroMessage("currentWeightError", "");
setErroMessage("goalWeightError", "");
setErroMessage("weightChangePerWeekError", "");
setErroMessage("activityLevelError", "");
}
function isValidNumber(value) {
return !isNaN(value) && isFinite(value);
}
function calculateCalories() {
clearErrorMessages();
var resultDiv = document.getElementById('result');
resultDiv.style.display = 'none';
var currentWeight = getInputValue('currentWeight');
var goalWeight = getInputValue('goalWeight');
var weightChangePerWeek = getSelectValue('weightChangePerWeek');
var activityLevelFactor = getSelectValue('activityLevel');
var errors = false;
if (!isValidNumber(currentWeight) || currentWeight <= 0) {
setErroMessage("currentWeightError", "Please enter a valid current weight.");
errors = true;
}
if (!isValidNumber(goalWeight) || goalWeight <= 0) {
setErroMessage("goalWeightError", "Please enter a valid goal weight.");
errors = true;
}
if (!isValidNumber(weightChangePerWeek)) {
setErroMessage("weightChangePerWeekError", "Please select a desired weekly change.");
errors = true;
}
if (!isValidNumber(activityLevelFactor)) {
setErroMessage("activityLevelError", "Please select an activity level.");
errors = true;
}
if (errors) {
return;
}
// Simplified BMR/TDEE calculation for demonstration purposes.
// A full BMR calculation would require age and height.
// We'll use a common TDEE estimation formula: TDEE = Weight(kg) * Factor
// Or a simplified approach: TDEE = Base + (Weight * multiplier) * activityFactor
// For this calculator, let's assume a base metabolic rate is roughly proportional to weight,
// and then apply the activity factor. A simple approximation:
// Let's use a simplified weight-based TDEE estimate for this example.
// A rough baseline might assume ~22-25 kcal/kg for TDEE for moderate activity.
// We'll scale this by the activity factor provided.
// Let's establish a hypothetical "resting energy" component that scales with weight.
// A more standard approach uses BMR then multiplies by activity factor.
// Since we lack age/height for true BMR, let's use a simplified TDEE estimate formula directly:
// TDEE ≈ (Weight in kg * 22) * Activity Factor, or a weighted average.
// Let's use a formula that implicitly includes weight's role in metabolism.
// A common simplified estimate for TDEE (ignoring age/height directly):
// Let's assume a base metabolic rate of roughly 14 * weight_in_kg.
// Then TDEE = (14 * weight_in_kg) * activity_factor.
// Convert current weight to kg:
var currentWeightKg = currentWeight / 2.20462;
var estimatedBmr = currentWeightKg * 14; // Rough estimate
var tdee = estimatedBmr * activityLevelFactor;
var dailyCalorieAdjustment = (weightChangePerWeek * 3500) / 7;
var targetCalories = tdee + dailyCalorieAdjustment;
// Ensure targetCalories is not negative, especially for weight gain
if (targetCalories < 0) {
targetCalories = 0; // Should not happen with realistic inputs
}
document.getElementById('bmr').textContent = 'Basal Metabolic Rate (BMR): ' + estimatedBmr.toFixed(0) + ' kcal/day (Estimated)';
document.getElementById('tdee').textContent = 'Total Daily Energy Expenditure (TDEE): ' + tdee.toFixed(0) + ' kcal/day';
document.getElementById('caloriesForGoal').textContent = 'Target Daily Calories: ' + targetCalories.toFixed(0) + ' kcal/day';
document.getElementById('targetCalories').textContent = targetCalories.toFixed(0) + ' kcal';
resultDiv.style.display = 'block';
// Update table
document.getElementById('tableCurrentWeight').textContent = currentWeight.toFixed(1) + ' lbs';
document.getElementById('tableGoalWeight').textContent = goalWeight.toFixed(1) + ' lbs';
document.getElementById('tableWeeklyChange').textContent = weightChangePerWeek.toFixed(1) + ' lbs/week';
document.getElementById('tableDailyAdjustment').textContent = dailyCalorieAdjustment.toFixed(0) + ' kcal/day';
var timeToGoalWeeks = Math.abs(goalWeight – currentWeight) / Math.abs(weightChangePerWeek);
var timeToGoalMonths = timeToGoalWeeks / 4.345;
var timeToGoalText = "";
if (timeToGoalWeeks < 1) {
timeToGoalText = "Less than 1 week";
} else if (timeToGoalWeeks < 4) {
timeToGoalText = timeToGoalWeeks.toFixed(1) + " weeks";
} else {
timeToGoalText = timeToGoalMonths.toFixed(1) + " months";
}
if (!isFinite(timeToGoalWeeks) || timeToGoalWeeks <= 0) {
timeToGoalText = "N/A (Weights are equal or invalid)";
}
document.getElementById('tableTimeToGoal').textContent = timeToGoalText;
updateChart(tdee, targetCalories, dailyCalorieAdjustment);
}
function resetCalculator() {
document.getElementById('currentWeight').value = '180';
document.getElementById('goalWeight').value = '150';
document.getElementById('weightChangePerWeek').value = '1'; // Lose 1 lb/week
document.getElementById('activityLevel').value = '1.375'; // Lightly Active
clearErrorMessages();
document.getElementById('result').style.display = 'none';
document.getElementById('tableCurrentWeight').textContent = '–';
document.getElementById('tableGoalWeight').textContent = '–';
document.getElementById('tableWeeklyChange').textContent = '–';
document.getElementById('tableDailyAdjustment').textContent = '–';
document.getElementById('tableTimeToGoal').textContent = '–';
// Clear chart
var canvas = document.getElementById('calorieChart');
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
function copyResults() {
var mainResultElement = document.getElementById('targetCalories');
var bmrElement = document.getElementById('bmr');
var tdeeElement = document.getElementById('tdee');
var caloriesForGoalElement = document.getElementById('caloriesForGoal');
var tableCurrentWeight = document.getElementById('tableCurrentWeight').textContent;
var tableGoalWeight = document.getElementById('tableGoalWeight').textContent;
var tableWeeklyChange = document.getElementById('tableWeeklyChange').textContent;
var tableTimeToGoal = document.getElementById('tableTimeToGoal').textContent;
var textToCopy = "— Calorie to Goal Weight Results —\n\n";
if (mainResultElement && mainResultElement.textContent !== '–') {
textToCopy += "Target Daily Calories: " + mainResultElement.textContent + "\n";
textToCopy += bmrElement.textContent + "\n";
textToCopy += tdeeElement.textContent + "\n";
textToCopy += caloriesForGoalElement.textContent + "\n";
textToCopy += "\n— Key Assumptions —\n";
textToCopy += "Current Weight: " + tableCurrentWeight + "\n";
textToCopy += "Goal Weight: " + tableGoalWeight + "\n";
textToCopy += "Desired Weekly Change: " + tableWeeklyChange + "\n";
textToCopy += "Estimated Time to Goal: " + tableTimeToGoal + "\n";
textToCopy += "\nCalculator used: Calorie to Goal Weight Calculator";
} else {
textToCopy = "No results to copy yet. Please calculate first.";
}
var textArea = document.createElement("textarea");
textArea.value = textToCopy;
textArea.style.position = "fixed";
textArea.style.left = "-9999px";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'Results copied!' : 'Copy failed!';
console.log(msg);
// Optionally show a temporary message to the user
var tempMsg = document.createElement('div');
tempMsg.textContent = msg;
tempMsg.style.position = 'fixed';
tempMsg.style.bottom = '20px';
tempMsg.style.left = '50%';
tempMsg.style.transform = 'translateX(-50%)';
tempMsg.style.backgroundColor = '#28a745';
tempMsg.style.color = 'white';
tempMsg.style.padding = '10px 20px';
tempMsg.style.borderRadius = '5px';
tempMsg.style.zIndex = '1000';
document.body.appendChild(tempMsg);
setTimeout(function() { document.body.removeChild(tempMsg); }, 2000);
} catch (err) {
console.error('Fallback: Unable to copy', err);
}
document.body.removeChild(textArea);
}
function updateChart(tdee, targetCalories, dailyCalorieAdjustment) {
var canvas = document.getElementById('calorieChart');
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
var chartData = {
labels: ['TDEE (Maintenance)', 'Target Calories'],
datasets: [
{
label: 'Calorie Levels (kcal/day)',
backgroundColor: ['#004a99', '#28a745'],
borderColor: '#ffffff',
borderWidth: 2,
data: [tdee, targetCalories]
}
]
};
var maxVal = Math.max(tdee, targetCalories) * 1.1; // Add some padding
if (maxVal < 1000) maxVal = 1000; // Ensure a minimum scale
new Chart(ctx, {
type: 'bar',
data: chartData,
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
max: maxVal,
title: {
display: true,
text: 'Calories per Day (kcal)'
}
},
x: {
title: {
display: true,
text: 'Calorie Type'
}
}
},
plugins: {
title: {
display: true,
text: 'Comparison of Maintenance vs. Target Calories'
},
tooltip: {
callbacks: {
label: function(context) {
var label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += context.parsed.y.toFixed(0) + ' kcal';
}
return label;
}
}
}
}
}
});
}
// Chart.js library needs to be included for the chart to work.
// For a pure HTML/JS solution without external libraries, SVG or manual drawing on canvas would be needed.
// As per instructions, using native Canvas API for chart drawing.
// We need a simple Chart.js-like object or a custom drawing implementation.
// For simplicity and common usage, let's simulate a basic bar chart drawing on canvas if Chart.js isn't assumed.
// — Reimplementing basic chart drawing without Chart.js —
function drawBasicBarChart(canvasId, data, labels, title, yAxisLabel) {
var canvas = document.getElementById(canvasId);
if (!canvas) return;
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
var barWidth = (canvas.width * 0.8) / data.length * 0.7; // 70% of allocated space
var spacing = (canvas.width * 0.8) / data.length * 0.3; // Remaining 30% for spacing
var startX = canvas.width * 0.1;
var chartHeight = canvas.height * 0.8;
var bottomY = canvas.height * 0.9;
var maxValue = Math.max(…data) * 1.1 || 1000; // Ensure minimum scale
// Draw Title
ctx.fillStyle = '#004a99';
ctx.font = 'bold 16px Segoe UI, Tahoma, Geneva, Verdana, sans-serif';
ctx.textAlign = 'center';
ctx.fillText(title, canvas.width / 2, 30);
// Draw Y-axis Label
ctx.save();
ctx.translate(20, chartHeight / 2);
ctx.rotate(-90 * Math.PI / 180);
ctx.fillStyle = '#333';
ctx.font = '12px Segoe UI, Tahoma, Geneva, Verdana, sans-serif';
ctx.fillText(yAxisLabel, 0, 0);
ctx.restore();
// Draw X-axis labels and bars
ctx.font = '12px Segoe UI, Tahoma, Geneva, Verdana, sans-serif';
ctx.fillStyle = '#333';
ctx.textAlign = 'center';
for (var i = 0; i < data.length; i++) {
var barHeight = (data[i] / maxValue) * chartHeight;
var x = startX + i * (barWidth + spacing);
var y = bottomY – barHeight;
// Draw bar
ctx.fillStyle = data[i] === data[0] ? '#004a99' : '#28a745'; // TDEE color, Target color
ctx.fillRect(x, y, barWidth, barHeight);
// Draw label below bar
ctx.fillText(labels[i], x + barWidth / 2, bottomY + 20);
// Draw value above bar
ctx.fillStyle = '#333';
ctx.fillText(data[i].toFixed(0) + ' kcal', x + barWidth / 2, y – 5);
}
// Draw Y-axis line and ticks (simplified)
ctx.beginPath();
ctx.moveTo(startX, bottomY);
ctx.lineTo(startX, canvas.height * 0.1); // Top of axis line
ctx.strokeStyle = '#ccc';
ctx.lineWidth = 1;
ctx.stroke();
// Add some approximate tick marks and labels for Y-axis
var tickCount = 5;
for (var j = 0; j <= tickCount; j++) {
var tickY = bottomY – (chartHeight / tickCount) * j;
var tickValue = Math.round((maxValue / tickCount) * j);
ctx.beginPath();
ctx.moveTo(startX – 5, tickY);
ctx.lineTo(startX, tickY);
ctx.stroke();
ctx.fillStyle = '#666';
ctx.textAlign = 'right';
ctx.fillText(tickValue, startX – 10, tickY + 5);
}
}
// Replace the Chart.js call with our custom drawing function
function updateChart(tdee, targetCalories, dailyCalorieAdjustment) {
var labels = ['TDEE (Maintenance)', 'Target Calories'];
var data = [tdee, targetCalories];
var title = 'Comparison of Maintenance vs. Target Calories';
var yAxisLabel = 'Calories per Day (kcal)';
drawBasicBarChart('calorieChart', data, labels, title, yAxisLabel);
}
// Initial calculation on load with default values
window.onload = function() {
resetCalculator(); // Set defaults
calculateCalories(); // Perform initial calculation
};