Harmonic Mean Calculator - Reciprocal Average for Rates

Use this harmonic mean calculator to find the reciprocal average of any list of positive values, then compare it with the arithmetic and geometric mean.

Updated: June 16, 2026 • Free Tool

Harmonic Mean Calculator

Enter 1 to 50 positive numbers separated by commas, spaces, or new lines. Use rates such as mph, ratios such as P/E, or any positive unitless value.

Number of decimal places to show in the result. The intermediate calculation keeps full float64 precision.

Results

Harmonic Mean
0value
Arithmetic Mean (Comparison) 0value
Geometric Mean (Comparison) 0value
Sum of Reciprocals 0value
Valid Values 0values
Skipped Values 0values

What Is Harmonic Mean Calculator?

A harmonic mean calculator finds the reciprocal average of a list of positive numbers. Use it when the values represent rates, ratios, or P/E figures and the small numbers should carry more weight. Common reasons to reach for this calculator include averaging speeds over equal distances, summarizing miles per gallon across equal-distance legs, blending precision and recall into an F1 score, and summarizing P/E ratios across a peer group.

  • Equal-distance average speed: 60 mph for 10 miles and 30 mph for 10 miles average to 40 mph, not 45 mph, because the slow leg takes more time on the road.
  • Peer group P/E ratio: Two companies with P/E of 10 and 20 give a peer harmonic average of 13.33, which the arithmetic mean overshoots at 15.
  • Machine learning F1 score: The F1 score is the harmonic mean of precision and recall, so this calculator answers the F1 for any pair of classification rates.
  • Fuel economy in miles per gallon: A car that returns 30 mpg for 100 miles and 20 mpg for the next 100 miles averages about 24 mpg, not 25 mpg, because the gas-thirsty leg burned more fuel.

The harmonic mean belongs to the Pythagorean family of means alongside the arithmetic and geometric mean. For any list of positive numbers, the inequality harmonic mean <= geometric mean <= arithmetic mean always holds, and the gap grows when the values are far apart.

This calculator keeps the result unitless unless you label the input. If you enter 60 and 30 to average speeds, the answer 40 has the same mph units as the inputs.

For a quick sum-and-divide comparison, the Average Calculator is the right place to start before switching to the harmonic mean for rate-style data.

How Harmonic Mean Calculator Works

The calculator parses the list, keeps only positive values, adds the reciprocals, and divides the count of kept values by that sum.

H = n / (1/x1 + 1/x2 + 1/x3 + ... + 1/xn); two-value form: H = 2xy / (x + y)
  • n: Count of valid positive numbers in the dataset.
  • xi: Each individual positive value such as a rate, ratio, P/E, or speed.
  • 1/xi: Reciprocal of each value; the harmonic mean uses the arithmetic mean of these reciprocals.
  • H: Resulting harmonic mean, always less than or equal to the arithmetic mean for positive data.

The two-value form 2xy / (x + y) is a quick shortcut for a pair of numbers. For example, 2 times 60 times 30 divided by 60 + 30 gives 3600 / 90 = 40, matching the reciprocals result.

Zero and negative inputs are filtered out and counted separately, because the reciprocal of zero is undefined and the reciprocal of a negative number would flip the sign. The calculator reports the skipped count so you know whether your list had unusable values.

Equal-distance speed of 60 mph and 30 mph

Values: 60, 30. Count n = 2.

Sum of reciprocals = 1/60 + 1/30 = 0.01667 + 0.03333 = 0.05. H = 2 / 0.05 = 40.

Harmonic mean = 40 mph. The arithmetic mean would give 45 mph, which overstates the trip.

This is the right answer for an equal-distance drive because the slow leg takes more time, and the harmonic mean weights each leg by its travel time.

Three distinct values 2, 4, and 8

Values: 2, 4, 8. Count n = 3.

Sum of reciprocals = 0.5 + 0.25 + 0.125 = 0.875. H = 3 / 0.875 = 3.4286.

Harmonic mean = 3.4286. Arithmetic mean = 4.6667 and geometric mean = 4, satisfying H <= G <= A.

The harmonic mean sits well below the arithmetic mean because 2 has a large reciprocal that pulls the average down.

According to Wikipedia, the harmonic mean of n positive numbers is the reciprocal of the arithmetic mean of their reciprocals, and it always satisfies harmonic mean <= geometric mean <= arithmetic mean.

When the rates come with explicit weights such as a per-leg distance, the Weighted Average Calculator accepts custom weights and returns the same answer in a different form.

Key Concepts Explained

These four ideas help you decide whether the harmonic mean is the right tool for the dataset in front of you.

Reciprocal weighting

The harmonic mean divides by the sum of 1/x, so a small x contributes a large reciprocal and pulls the average down, which is what makes the average correct for rates.

Pythagorean means

The harmonic mean is one of three classical Pythagorean means alongside the arithmetic and geometric mean. The ordering H <= G <= A always holds for positive inputs.

Equal-distance vs equal-time

Use the harmonic mean when each value applies to an equal amount of work, distance, or share. Use the arithmetic mean when each value applies to an equal time or count.

Sensitivity to small values

Outliers on the small side have an outsized effect. A single value of 1 next to 1000 makes the harmonic mean about 2, while the arithmetic mean sits near 500.

Think of the harmonic mean as the 'right' average when the values are rates per unit of something fixed such as distance, mass, share, or fuel burned, with the rate describing how fast that unit is processed.

A common search here is parallel resistance. The equivalent resistance of two parallel resistors is xy divided by x plus y, exactly half of the two-value harmonic mean 2xy divided by x plus y, so this calculator returns twice the actual resistance. For circuit work, use the Electrical Resistance Calculator instead.

The arithmetic mean is still the right choice for everyday totals such as average test score, average salary, or average temperature. The harmonic mean is a special-purpose tool for rate data, not a universal replacement for the standard average. To see the harmonic mean next to the median and mode of the same data, run the numbers through a central-tendency comparison tool for the full picture.

How to Use This Calculator

Type or paste a list of positive values, then read the harmonic mean next to the arithmetic and geometric mean.

  1. 1 Enter the values: Paste up to 50 positive numbers in the textarea. Use commas, spaces, semicolons, or new lines as separators.
  2. 2 Filter zero or negative tokens: If a value is zero, negative, or unparseable, the calculator skips it and adds to the Skipped Values counter.
  3. 3 Choose decimal places: Set the precision from 0 to 10. The default of 4 reads most rate-style results; raise it for ratio work where small differences matter.
  4. 4 Read the harmonic mean: Use the harmonic mean as your main answer. The arithmetic and geometric mean are shown for sanity checking, not as a recommendation.
  5. 5 Apply the result: Use the harmonic mean for equal-distance speed, equal-fuel-leg miles per gallon, or peer ratio work. Use the arithmetic mean for equal-time or equal-count averages.

Suppose you drove 10 miles at 60 mph and 10 miles at 30 mph. Paste 60, 30 in the values field. The calculator reports a harmonic mean of 40 mph, an arithmetic mean of 45 mph, and a geometric mean of about 42.4 mph. The harmonic mean of 40 mph is the correct average speed for the 20-mile trip because the slow leg took 20 minutes and the fast leg took 10 minutes.

Before pasting mixed-unit speeds, the Speed Converter lets you convert each leg to the same unit so the harmonic mean result is interpretable.

Benefits of Using This Calculator

The harmonic mean calculator is most useful when it gives a more honest central value than a standard average.

  • Right answer for equal-distance speed: Use it to combine speeds over equal distances and avoid the classic 60/30 mph overestimation of 45 mph.
  • Correct peer ratio averaging: Average P/E ratios, price-to-book, or any unitless ratio without letting one high outlier dominate the peer group.
  • F1 score and classification metrics: Compute the F1 score from precision and recall, or compare the harmonic mean with the arithmetic mean to show why a balanced classifier matters.
  • Fuel economy review: Average miles per gallon over equal-distance legs to get a single MPG figure that matches the actual gallons burned, not the simple average of the readings.
  • Defensive default for rates: When the inputs are clearly rates or ratios and the small values should dominate, the harmonic mean is the safer default than the arithmetic mean.

The benefit is not that the harmonic mean gives a 'smaller' number. It is that the harmonic mean is mathematically correct for the underlying scenario. A 40 mph harmonic mean and a 45 mph arithmetic mean are both real numbers, but only 40 mph matches the actual drive.

Pair this calculator with the time side of a rate review when you need the total time, and the result summarises a rate-style series without hiding small values.

The Time Calculator pairs the harmonic mean of speeds with the actual hours and minutes.

Factors That Affect Your Results

Four factors and two caveats shape how the harmonic mean calculator behaves on real data.

Value scale

Doubling every value also doubles the harmonic mean. Rescale the inputs (e.g., mph to m/s) only after running the calculation, not before.

Count of values

A very small value reduces the harmonic mean; a moderate value nudges it toward the geometric mean. The count is shown so you can see how many numbers actually contributed.

Skipped zero and negative tokens

Zero and negative values are filtered out and counted separately. A long list of zeros with one positive value gives a harmonic mean close to that single value.

Imbalance between values

When one value is much smaller than the others, the harmonic mean is pulled toward it. A 1 next to a 1000 gives a harmonic mean near 2, not 500.

  • The harmonic mean is undefined when any value is zero and is misleading for negative values, so the calculator removes them and reports a skipped count.
  • The geometric mean shown for comparison uses the natural log and exp, so it is the limit form for very small or very large values. If your inputs span more than 30 orders of magnitude, pre-scale them first.

For a quick sanity check, the harmonic mean is always less than or equal to the geometric mean, and the geometric mean is always less than or equal to the arithmetic mean. If the displayed numbers break that ordering on positive inputs, re-check for stray characters or unit conversions.

When the inputs are mixed units (e.g., mph and m/s), convert to one unit before pasting. The harmonic mean does not handle unit mixing, and a mixed-unit result is not interpretable as a rate.

According to NIST/SEMATECH e-Handbook of Statistical Methods, the harmonic mean is the right average for rates that travel equal distances because it weights each leg by its travel time.

According to MathWorld, the harmonic mean of a set of positive numbers is the reciprocal of the arithmetic mean of their reciprocals and equals 2xy / (x + y) for two numbers.

For non-reciprocal ratio work such as aspect ratios or batch proportions, the Ratio Calculator handles the standard ratio without the reciprocal step.

harmonic mean calculator showing the reciprocal average alongside the arithmetic and geometric mean with worked speed and P/E examples
harmonic mean calculator showing the reciprocal average alongside the arithmetic and geometric mean with worked speed and P/E examples

Frequently Asked Questions

Q: What is the harmonic mean and when should I use it?

A: The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals. It is the right average for rate-style data such as speeds over equal distances, miles per gallon across equal-distance legs, P/E ratios in a peer group, and precision and recall in machine learning.

Q: How do I calculate the harmonic mean of two numbers?

A: Use the shortcut H = 2xy / (x + y). For x = 60 and y = 30, that is 2 times 60 times 30 divided by 90, which equals 40. The textarea version of this calculator handles that case without the formula.

Q: What is the difference between the harmonic mean and the arithmetic mean?

A: The arithmetic mean adds the values and divides by the count. The harmonic mean divides the count by the sum of 1 divided by each value. For positive data, the harmonic mean is always less than or equal to the arithmetic mean, and the gap widens as the values get further apart.

Q: Why does the harmonic mean give the right answer for average speed?

A: On an equal-distance trip, the slow leg takes more time. The harmonic mean weights each leg by its actual travel time, so 60 mph and 30 mph over equal distances average to 40 mph, not 45 mph. The arithmetic mean would overcount the fast leg.

Q: Can the harmonic mean handle negative or zero values?

A: The harmonic mean is undefined at zero and gives a misleading sign flip for negative values. This calculator filters those inputs out and reports them in a Skipped Values counter so you still get a result from the positive entries.

Q: How is the harmonic mean used in finance and machine learning?

A: In finance, the harmonic mean averages P/E ratios and other unitless peer metrics so a single high-ratio company does not dominate the peer average. In machine learning, the F1 score is the harmonic mean of precision and recall, which is why this calculator covers both use cases.