Calculate your average pace per mile based on distance and total time.
Miles
Kilometers
Hours
Minutes
Seconds
Understanding Your Mile Time
Mile time is the universal metric for measuring running performance. Whether you are training for your first 5K or a marathon, knowing your pace per mile helps you set realistic goals and monitor your cardiovascular improvement over time.
The Formula for Mile Pace
To calculate your mile time manually, you convert your total time into seconds, divide it by the total distance covered (in miles), and then convert that result back into minutes and seconds. If you track your distance in kilometers, you first multiply the distance by 0.621371 to convert it to miles.
Example Calculation:
If you run 5 kilometers (3.106 miles) in 25 minutes:
1. Total Seconds = 25 × 60 = 1,500 seconds.
2. 1,500 ÷ 3.106 miles = 482.9 seconds per mile.
3. 482.9 seconds = 8 minutes and 3 seconds per mile.
Why Track Your Pace?
Consistency: Maintaining a steady mile time prevents early burnout during long races.
Progression: Seeing your mile time drop is a clear indicator of increased aerobic capacity.
Race Prediction: Use your mile pace to estimate finish times for 10Ks, Half Marathons, or full Marathons.
Note: A "good" mile time varies greatly by age and fitness level. For beginners, a 10-12 minute mile is common, while elite runners often maintain sub-5 minute paces for several miles.
function calculatePace() {
var distInput = document.getElementById('runDistance').value;
var unit = document.getElementById('distanceUnit').value;
var hours = parseInt(document.getElementById('runHours').value) || 0;
var mins = parseInt(document.getElementById('runMinutes').value) || 0;
var secs = parseInt(document.getElementById('runSeconds').value) || 0;
var resultDiv = document.getElementById('paceResult');
var paceOut = document.getElementById('paceOutput');
var speedOut = document.getElementById('speedOutput');
if (!distInput || parseFloat(distInput) <= 0) {
alert("Please enter a valid distance.");
return;
}
var totalDistance = parseFloat(distInput);
if (unit === 'km') {
totalDistance = totalDistance * 0.621371; // Convert KM to Miles
}
var totalSeconds = (hours * 3600) + (mins * 60) + secs;
if (totalSeconds <= 0) {
alert("Please enter a valid time.");
return;
}
// Seconds per mile
var secondsPerMile = totalSeconds / totalDistance;
// Formatting the pace
var paceMinutes = Math.floor(secondsPerMile / 60);
var paceSeconds = Math.round(secondsPerMile % 60);
if (paceSeconds === 60) {
paceMinutes += 1;
paceSeconds = 0;
}
// Leading zero for seconds
var formattedSeconds = paceSeconds < 10 ? '0' + paceSeconds : paceSeconds;
// Calculate MPH
var milesPerHour = (totalDistance / (totalSeconds / 3600)).toFixed(2);
resultDiv.style.display = 'block';
resultDiv.style.backgroundColor = '#f1fcf4';
resultDiv.style.border = '1px solid #27ae60';
paceOut.innerHTML = 'Your Mile Pace: ' + paceMinutes + ':' + formattedSeconds + ' / mile';
speedOut.innerHTML = 'Average Speed: ' + milesPerHour + ' mph';
}