Marathon Pace Calculator Formula
Understand the math behind the marathon pace calculator. Each variable explained with a worked example.
Formulas Used
Pace (min/mile)
pace_min_part = floor(pace_per_mile)Pace (sec remainder)
pace_sec_part = round((pace_per_mile - floor(pace_per_mile)) * 60)Pace (min/km)
pace_per_km = round(total_minutes / 42.195 * 100) / 100Half Marathon Split
half_split = round(total_minutes / 2 * 100) / 100Variables
| Variable | Description | Default |
|---|---|---|
target_hours | Target Hours(hr) | 4 |
target_minutes | Target Minutes(min) | 0 |
total_minutes | Derived value= target_hours * 60 + target_minutes | calculated |
pace_per_mile | Derived value= total_minutes / 26.2 | calculated |
How It Works
How Marathon Pace Is Calculated
A marathon is 26.2 miles (42.195 km). To find the pace needed for a target finish time, simply divide.
Formula
Pace (min/mile) = Total Time (minutes) / 26.2
Pacing Strategy
Most coaches recommend even splits or a slight negative split (running the second half slightly faster). Going out too fast leads to significant slowdowns after mile 20.
Worked Example
You want to finish a marathon in 4 hours.
target_hours = 4target_minutes = 0
- 01Total time = 4 * 60 + 0 = 240 minutes
- 02Pace = 240 / 26.2 = 9.16 min/mile
- 03That is 9 minutes and 10 seconds per mile
- 04Half marathon split = 240 / 2 = 120 minutes (2:00:00)
Ready to run the numbers?
Open Marathon Pace Calculator