Math calculator

Harmonic Mean Calculator

The average for rates, where the slow values weigh more.

The average for rates

Slow values weigh more.

Speeds, prices per unit, work rates. All the same sign, none of them zero.

2 rates

48

The arithmetic mean would say 50 — higher, and wrong for a fixed distance.

Harmonic mean

48

the honest average for rates

Arithmetic mean

50

right only if the TIME is fixed

The gap

2

not rounding — the slow legs take longer

Slowest carries

60.0%

the rate 40

Why, on a 120-unit journey each way

The two legs of a fixed-distance journey with the time each takes
Out at 602.000 units of time
Back at 403.000 units of time
240 units in5.000
So the average speed is48.000000

Total distance over total time — which is what average speed means. It comes out as the harmonic mean, and the slower leg dominates because it takes longer.

Reciprocals, which is where the weighting comes from

Each rate with its reciprocal and the share of the total that reciprocal represents
Rate1 ÷ rateShare of the weight
600.01666740.00%
400.02500060.00%

A small rate has a large reciprocal, so it takes a bigger share. That is the mechanism, and it is exactly right — a slow leg really does occupy more of the journey.

  • The harmonic mean is 48; the arithmetic mean is 50. The 2 gap is not rounding: it is the slower values getting more weight, because they take longer over the same distance.
  • 40 carries 60% of the weight against 60's 40%. The harmonic mean always leans towards the smallest value, which is exactly why it is the honest average for rates.
  • The test for which average to use is what is held FIXED. Same distance at different speeds: harmonic. Same time at different speeds: arithmetic. Ask that first and the choice stops being a matter of taste.
  • For two values there is a shortcut: 2ab/(a+b). Here that is 2 × 60 × 40 ÷ 100 = 48.

For a pair the journey above is computed independently and lands on the same number.

What this tool shows

Sixty miles an hour there and forty back is 48, not 50 — you spend longer at forty, because the slow leg takes more time for the same distance. That extra time is the weight, and the harmonic mean is what applies it.

  • The harmonic mean of any set of rates
  • The fixed-distance journey that explains it
  • Each rate’s share of the total weight
  • The arithmetic mean, and why it is wrong here
  • The two-value shortcut, 2ab/(a+b)
  • Why a zero or a mixed sign has no answer
Slow values weigh more The journey simulated Reciprocal weighting shown Arithmetic mean beside it

Exact; the journey is simulated independently.

Updated 7 September 2026 · Works in any browser, no installation

Divide the count by the sum of the reciprocals. For 60 and 40 that is 2 ÷ (1/60 + 1/40) = 48. The reason it is not 50 is that the slow leg takes longer: at 60 the first 120 miles take two hours, at 40 the return takes three, so 240 miles take five hours — and 240 ÷ 5 is 48. The harmonic mean is what that calculation always comes to.

At a glance

Formula shown
HM = n \u00f7 \u03a3(1/x\u1d62). For two values it simplifies to 2ab/(a+b). It is the arithmetic mean of the reciprocals, inverted \u2014 which is why small values dominate.
Scenario support
Average speed over a there-and-back journey; average price per unit across purchases of equal spend; combined rate when two people work on the same job.
Educational estimate
Planning support from the values you enter — not professional advice.

Sixty there, forty back

Drive 120 miles at 60 mph: two hours. Drive back at 40 mph: three hours. Total 240 miles in five hours, which is 48 mph.

Not 50. The arithmetic mean treats the two speeds as equally important, and they are not — you spent three hours at the slower one and two at the faster. The slow leg gets more weight because it occupies more of the journey.

The page works that journey through for any pair you enter, computing it from the legs rather than from the formula. That the two agree is the demonstration, and the suite checks it across two thousand generated pairs.

Which average, and how to decide

The question to ask is what is held FIXED.

Fixed distance, varying speed: harmonic. Each leg is the same length, so the slow ones take longer and count more.

Fixed time, varying speed: arithmetic. Drive an hour at 60 and an hour at 40 and you really did average 50, because each speed applied for equally long.

Same two numbers, two different correct answers, decided entirely by the setup. That is why the choice of mean is a modelling decision rather than a preference.

Where the weighting comes from

The harmonic mean is the arithmetic mean of the reciprocals, inverted. A small rate has a large reciprocal, so it takes a larger share of the total.

For 60 and 40 the reciprocals are 0.0167 and 0.025, and the shares are 40% and 60%. That 60% is exactly the fraction of the journey spent going slowly — the weighting is not a device, it is the time.

It also explains the harmonic mean’s character: it leans towards the smallest value, hard. With 1 and 100 it is 1.98, barely above the smaller one, because a leg at speed 1 dominates everything.

The F1 score is one of these

In machine learning, the F1 score is the harmonic mean of precision and recall. It is chosen deliberately, not for elegance.

A model with precision 1.0 and recall 0.0 has an arithmetic mean of 0.5, which sounds acceptable and describes a model that finds nothing. The harmonic mean is 0, which is the honest summary.

That is the general property: the harmonic mean punishes a bad component in a way the arithmetic mean does not. Wherever both numbers must be decent for the whole to be decent, it is the right average.

Why zero has no answer

Zero has no reciprocal, so a set containing one has no harmonic mean. The page refuses rather than returning something small.

In the journey reading that is exactly right: a leg travelled at zero speed never finishes, so the average speed over the whole trip is undefined rather than low.

Mixed signs are refused for a related reason. Reciprocals of opposite signs can cancel, producing an average larger than every input or a sign belonging to neither — a number with no interpretation. For data that changes sign, the arithmetic mean is the one that applies.

Other places it turns up

Average price per unit. Spend the same amount at two different prices and your average price paid is their harmonic mean, not their arithmetic one. Dollar-cost averaging works for exactly this reason: fixed spend buys more units when the price is low.

Combined work rates. Two people who each take a different time on the same job combine harmonically, which is why the classic “how long together” puzzle has the answer it does.

Parallel resistance. Resistors in parallel combine as the harmonic mean divided by the count — the same reciprocal sum, for the same structural reason.

Sources and methodology

The harmonic mean is standard; these are the references for the places it is required.

Method. The mean is n divided by the sum of the reciprocals. For a pair the page also simulates a fixed-distance journey — computing each leg’s time from its speed, summing them, and dividing total distance by total time — and the suite asserts the two agree across two thousand generated pairs. The arithmetic mean is computed alongside for contrast. That engine is verified on every change against 61 hand-written assertions, including that the harmonic mean equals total distance over total time in two thousand independently simulated journeys. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Geometric MeanThe average for things that compound. Growth of +50% then -50% averages to zero arithmetically and to a real 13.4% loss geometrically, which is what actually happened.
Weighted AverageEach value carries the weight you give it, with every item's share of the total shown as a percentage so you can see what is actually driving the answer.
Root Mean SquareFor values whose sign must not cancel. Mains voltage averages zero and still boils a kettle; squaring, averaging and rooting gives the number that describes the work.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
PercentageSolve X% of Y, what percent X is of Y, reverse percentage, increase/decrease, discounts, and tax, tip, or commission.
FractionAdd, subtract, multiply and divide fractions and mixed numbers exactly, with the least common denominator chosen, the cross-cancelling done first, and the true repeating decimal beside the answer.

More in Math, or browse all calculators.

Read the guide

For quantities that multiply rather than divide — growth rates, ratios — the Geometric Mean Calculator applies. If the items simply count differently, the Weighted Average Calculator is the one.

Educational use disclaimer

This is an educational tool. The arithmetic is exact; whether the harmonic mean is the right average depends on what is held fixed in your problem, and the page says how to decide.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 7 September 2026

  1. Published the harmonic mean page with the there-and-back journey simulated independently from the legs, so the 48 mph answer is demonstrated rather than asserted.
  2. Each rate's share of the total weight is shown, which is what makes the slow-leg dominance legible instead of surprising.
  3. A zero rate has no reciprocal and the page refuses rather than returning something small, matching the reading that a leg travelled at zero speed never finishes.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.