keepcalculator

06 Numbers and Powers

Pipes in Command Line: Basics and Usage

Card No. 06·68498 · Updated · Standard formula, shown below

Average pace (min/km) 0.50 min/km
Average speed (km/h)
120.00 km/h
Result
Time (minutes)
5 min
You entered
Distance (km)
10 km
You entered
You enter
Time (minutes), Distance (km)
You get
Average pace (min/km), Average speed (km/h)
Rounding
2 dp

Pipes in the command line let you take the output of one command and feed it directly into another command as input, creating a data flow between programs. You use the pipe symbol (|) between two commands, like command1 | command2, and the shell connects them so that what command1 prints becomes what command2 reads. This simple mechanism is one of the most powerful ideas in Unix-like systems (Linux, macOS, BSD) and is also available in Windows PowerShell and modern Windows CMD.

Formula

The calculator above computes two related running metrics from the time and distance you enter. The formulas are:

  • Average pace (minutes per kilometer) = time (in minutes) ÷ distance (in kilometers)
  • Average speed (kilometers per hour) = distance (in kilometers) ÷ (time (in minutes) ÷ 60)

Where:

  • t = total time in minutes (input)
  • d = distance in kilometers (input)

Both outputs are derived from the same two inputs, so you only need to measure your total time and the distance you covered.

Worked Example

Using the default values from the calculator block: time = 5 minutes, distance = 10 km.

  1. Average pace = 5 min ÷ 10 km = 0.5 min/km
  2. Average speed = 10 km ÷ (5 min ÷ 60) = 10 km ÷ 0.08333 h = 120 km/h

The calculator shows 0.50 min/km and 120.00 km/h for the defaults. That is an unrealistic running pace (you would be sprinting at 120 km/h), but the math is correct. The defaults are deliberately simple to make the example easy to follow.

When to Use This Calculator

Use this tool when you have a recorded time and distance from a run, walk, bike ride, or any other activity where you want to know your average pace (how long it takes to cover one kilometer) or your average speed (how many kilometers you cover in one hour). It is especially handy for training plans that specify paces (e.g., “run at 5:30 per kilometer”) or for comparing efforts across different distances.

Note that this calculator gives you the average pace and speed over the whole distance. It does not account for elevation changes, stops, or variations in effort. For interval training, you would need to calculate each segment separately.

How to Read the Results

The average pace is shown in minutes per kilometer (min/km). A lower number means faster running. For example, 4:00 min/km is faster than 6:00 min/km. The average speed is shown in kilometers per hour (km/h); a higher number means faster movement. These two values are reciprocals of each other (with the 60-minute conversion), so if you know one, you can compute the other.

If you run in miles, you can still use this calculator by converting your distance to kilometers (1 mile = 1.60934 km) or by using the pace in min/mile (which is not directly shown here). The formula works the same with any distance unit as long as you are consistent.

Common Mistakes and Pitfalls

  • Mixing units: If you enter time in hours and distance in kilometers, the pace will be wrong. Always convert time to minutes or hours consistently. Here, time is in minutes and distance in kilometers.
  • Confusing pace and speed: Pace is time per distance (min/km), speed is distance per time (km/h). They are not the same; a common error is to read one as the other.
  • Rounding too early: If you round the pace to 0.5 min/km and then compute speed from that rounded value, you get 120 km/h, which is fine here, but in real cases rounding can cause small errors. Use the full precision until the final step.
  • Forgetting that time must be in minutes: If you have 1 hour 30 minutes, enter 90 minutes, not 1.5 hours (unless you adjust the formula).

Limitations of the Formula

This is a simple average calculation. It does not reflect the effort profile of your run (e.g., negative splits, hills, wind). For training, you may need more detailed metrics like heart rate, cadence, or power, which this calculator does not provide. Also, GPS distance errors can affect accuracy; a certified course or a calibrated wheel is more precise.

For very short distances (like 100 meters), the pace in min/km can be misleading because it extrapolates a sprint pace over a kilometer. The formula is mathematically correct but practically less meaningful for distances under about 400 meters.

Frequently Asked Questions

How do I convert min/km to min/mile?

Multiply the pace in min/km by 1.60934 to get pace in min/mile. For example, 5:00 min/km is about 8:03 min/mile. To convert speed, divide km/h by 1.60934 to get mph.

What is a good running pace for a beginner?

There is no single answer; it depends on age, fitness, and experience. A comfortable conversational pace for a beginner might be 7:00–9:00 min/km (11–13 min/mile). For most recreational runners, 5:00–6:30 min/km is common. Always consult a coach or doctor for personalized advice.

How do I calculate pace if I run on a treadmill?

Most treadmills show speed in km/h or mph. To get pace, divide 60 by the speed in km/h. For example, 10 km/h gives 6 min/km. If the treadmill shows pace, it is usually already in min/km or min/mile.

Why does my GPS watch show a different pace than this calculator?

GPS watches often use moving time (excluding pauses) and smoothed speed data. This calculator uses total time and total distance as you enter them. If you include stops, the average pace will be slower. Also, GPS distance may be slightly off due to signal issues.

Can I use this for cycling or walking?

Yes, the formula works for any activity where you measure time and distance. For cycling, speeds are higher, so the pace in min/km will be much lower (e.g., 2 min/km for 30 km/h). For walking, a typical pace is 10–12 min/km.

What is the difference between average pace and instantaneous pace?

Average pace is total time divided by total distance over the whole workout. Instantaneous pace is your pace at a specific moment, which can vary due to terrain and effort. This calculator gives average pace only.

Related

Formula used
in t | Time (minutes) | min | 5 | 0
in d | Distance (km) | km | 10 | 0 | 100000
out pace | Average pace (min/km) | min/km | t / d | 2
out speed | Average speed (km/h) | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →