function calculateCalories() {
var weight = parseFloat(document.getElementById('weightInput').value);
var weightUnit = document.getElementById('weightUnit').value;
var distance = parseFloat(document.getElementById('distanceInput').value);
var distanceUnit = document.getElementById('distanceUnit').value;
var hours = parseInt(document.getElementById('durationHours').value) || 0;
var minutes = parseInt(document.getElementById('durationMinutes').value) || 0;
if (isNaN(weight) || isNaN(distance) || (hours === 0 && minutes === 0) || weight <= 0 || distance <= 0) {
alert("Please enter valid positive values for weight, distance, and time.");
return;
}
// Standardize Weight to kg
var weightKg = (weightUnit === 'lb') ? weight * 0.453592 : weight;
// Standardize Distance to km
var distanceKm = (distanceUnit === 'mi') ? distance * 1.60934 : distance;
// Total Time in hours
var totalHours = hours + (minutes / 60);
// Speed in km/h
var speedKmh = distanceKm / totalHours;
var speedMph = speedKmh * 0.621371;
// Determine MET (Metabolic Equivalent of Task) based on speed
// Running speeds in mph to MET values
var met = 0;
if (speedMph < 4) met = 6.0; // Slow jog
else if (speedMph < 5) met = 8.3;
else if (speedMph < 6) met = 9.8;
else if (speedMph < 7) met = 11.0;
else if (speedMph < 8) met = 11.8;
else if (speedMph < 9) met = 12.8;
else if (speedMph < 10) met = 14.5;
else if (speedMph < 11) met = 16.0;
else if (speedMph < 12) met = 19.0;
else met = 23.0; // Very fast sprinting
// Formula: Calories = MET * weight_kg * time_hours
var totalCalories = met * weightKg * totalHours;
// Pace calculation (min/km or min/mile)
var totalMinutes = (hours * 60) + minutes;
var paceRaw = totalMinutes / distance;
var paceMins = Math.floor(paceRaw);
var paceSecs = Math.round((paceRaw – paceMins) * 60);
if (paceSecs === 60) { paceMins++; paceSecs = 0; }
var formattedPace = paceMins + ":" + (paceSecs < 10 ? "0" + paceSecs : paceSecs) + " /" + distanceUnit;
// Display results
document.getElementById('calorieResult').innerText = Math.round(totalCalories).toLocaleString();
document.getElementById('paceResult').innerText = formattedPace;
document.getElementById('speedResult').innerText = (distanceUnit === 'mi' ? speedMph.toFixed(1) + " mph" : speedKmh.toFixed(1) + " km/h");
document.getElementById('resultArea').style.display = 'block';
}
Understanding Calories Burned While Running
Running is one of the most efficient ways to burn calories and improve cardiovascular health. However, the exact number of calories you burn depends on several variables including your body weight, the speed at which you run, and the total duration of your session.
The Science of METs
Our calculator uses the Metabolic Equivalent of Task (MET) formula. One MET is defined as the energy cost of sitting quietly. Running significantly increases this demand:
Slow Jogging (5 mph): 8.3 METs
Moderate Running (7 mph): 11.0 METs
Fast Running (10 mph): 14.5 METs
Key Factors Influencing Your Burn
Body Weight: Heavier individuals require more energy to move their body through space, resulting in a higher caloric burn for the same distance.
Intensity (Speed): Higher speeds increase your heart rate and oxygen consumption, leading to a higher MET value.
Distance: Naturally, the further you run, the more total energy you expend.
Incline: Running uphill can increase calorie burn by 25-50% compared to flat ground.
Calculation Examples
Example 1: A 155 lb (70 kg) person running 5 miles in 45 minutes (approx 6.7 mph) will burn roughly 580 calories.
Example 2: A 200 lb (90 kg) person running 10 kilometers in 60 minutes (10 km/h) will burn approximately 930 calories.
How to Use These Results
If your goal is weight loss, remember that a deficit of approximately 3,500 calories is generally required to lose one pound of body fat. Using this calculator can help you plan your weekly mileage to reach your fitness milestones safely. Always combine your running routine with a balanced diet and proper hydration for the best results.