Calculate your running pace based on distance and time.
Kilometers (km)
Miles (mi)
Enter distance and time to see your pace
Understanding Running Pace
Running pace is a fundamental metric for runners of all levels, indicating how fast you are covering a certain distance. It's typically expressed as time per unit of distance, such as minutes per kilometer (min/km) or minutes per mile (min/mi). A faster pace means a lower number (e.g., 4:30 min/km is faster than 5:00 min/km).
Calculating your pace is crucial for training, race planning, and tracking progress. For example, if you're training for a 10k race, knowing your target pace will help you structure your workouts. If you've just completed a race, calculating your average pace provides a clear benchmark of your performance.
The Math Behind Pace Calculation
The formula for calculating pace is straightforward:
Pace = Total Time / Total Distance
Before you can apply this formula, you need to ensure your units are consistent. The calculator first converts your input time into a total number of minutes.
Total Time in Minutes = (Hours * 60) + Minutes + (Seconds / 60)
Once you have the total time in minutes and the distance in your chosen unit (km or miles), you divide the total time by the distance to get your pace in minutes per unit of distance.
For instance, if you run 5 kilometers in 25 minutes and 30 seconds:
Total Time in Minutes = 0 hours + 25 minutes + (30 seconds / 60) = 25.5 minutes
Distance = 5 km
Pace = 25.5 minutes / 5 km = 5.1 minutes per kilometer
To express this in minutes and seconds per kilometer:
Whole minutes = floor(5.1) = 5 minutes
Fractional part of a minute = 5.1 - 5 = 0.1 minutes
Seconds = 0.1 * 60 = 6 seconds
So, the pace is 5 minutes and 6 seconds per kilometer (5:06 min/km).
Use Cases for Pace Calculation
Race Planning: Estimate your finish time for longer races based on your current training pace.
Training Adaptation: Adjust your workout intensity to hit specific target paces for different training zones (e.g., easy, tempo, interval).
Performance Tracking: Monitor improvements over time by comparing your pace on similar runs or distances.
Pacing Strategies: Develop a strategy for race day to avoid starting too fast or too slow.
function calculatePace() {
var distance = parseFloat(document.getElementById("distance").value);
var distanceUnit = document.getElementById("distanceUnit").value;
var timeHours = parseFloat(document.getElementById("timeHours").value);
var timeMinutes = parseFloat(document.getElementById("timeMinutes").value);
var timeSeconds = parseFloat(document.getElementById("timeSeconds").value);
var resultDiv = document.getElementById("result");
if (isNaN(distance) || distance <= 0 ||
isNaN(timeHours) || timeHours < 0 ||
isNaN(timeMinutes) || timeMinutes = 60 ||
isNaN(timeSeconds) || timeSeconds = 60) {
resultDiv.innerHTML = "Please enter valid numbers for distance and time.";
return;
}
var totalMinutes = (timeHours * 60) + timeMinutes + (timeSeconds / 60);
var pace = totalMinutes / distance;
var paceMinutes = Math.floor(pace);
var paceSeconds = Math.round((pace – paceMinutes) * 60);
// Handle cases where rounding seconds might push it to 60
if (paceSeconds === 60) {
paceMinutes += 1;
paceSeconds = 0;
}
var unitLabel = distanceUnit === "km" ? "min/km" : "min/mi";
resultDiv.innerHTML = paceMinutes + ":" + (paceSeconds < 10 ? "0" : "") + paceSeconds + " " + unitLabel + "";
}