Harmonic Mean Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What is the harmonic mean?

The harmonic mean is one of the three classical means, alongside the arithmetic mean and geometric mean. It is especially useful when you want to average rates, speeds, or other quantities that behave like “value per unit” (for example, km/h, items per hour, cost per unit).

Given a set of positive numbers that represent such rates, the harmonic mean gives more weight to smaller values than to larger ones. This reflects the idea that spending time at a very low speed or rate can drag down your overall performance much more than short bursts at a higher speed can improve it.

Common situations where the harmonic mean is appropriate include:

This calculator automates the harmonic mean computation, so you can quickly enter your data, get the result, and then interpret what it means for your specific problem.

Harmonic mean formula

Suppose you have n positive numbers:

x1, x2, …, xn

The harmonic mean H is defined as:

H = n / (1/x1 + 1/x2 + … + 1/xn)

In words, you:

  1. Take the reciprocal of each value (for example, turn 40 into 1/40).
  2. Add all those reciprocals together.
  3. Divide the number of values, n, by that sum.

That definition is equivalent to the following more formal mathematical expression:

H = n i = 1 n 1 x i

Here:

How to use this harmonic mean calculator

To compute a harmonic mean with this tool:

  1. Enter your positive numbers into the input box, separated by commas. For example:
    40, 60, 80
  2. Use a dot for decimal values, such as 10.5 or 3.25.
  3. Do not include thousands separators; instead of 1,000, enter 1000.
  4. Click the button to compute the harmonic mean.
  5. Read the result, which is shown as a single number. You can copy this value for use in other tools or documents.

The calculator is designed for strictly positive inputs. If you include a zero, a negative number, or something that is not a valid number, the tool will not be able to compute a meaningful harmonic mean and may show an error message.

Worked example: average speed over a round trip

A classic example where the harmonic mean is the correct type of average is average speed when traveling equal distances at different speeds.

Imagine you drive:

Many people might think the average speed is just the arithmetic mean:

(40 + 60) / 2 = 50 km/h

However, this is incorrect for average speed when distances are the same but speeds differ, because you spend more time traveling at the lower speed. The correct measure is the harmonic mean:

H = 2 / (1/40 + 1/60)

Compute the reciprocals and sum:

Now divide n = 2 by this sum:

H = 2 / 0.0416667 ≈ 48 km/h

So your true average speed over the whole trip is 48 km/h, not 50 km/h. The harmonic mean correctly captures the longer time spent at the lower speed.

Interpreting the result

Once you compute the harmonic mean for your data, it helps to understand how it compares to the arithmetic and geometric means for the same numbers. For any set of positive numbers that are not all equal, you have the ordering:

harmonic mean ≤ geometric mean ≤ arithmetic mean

This inequality has practical meaning:

For rates and ratios, the harmonic mean often tells you “how the system actually behaved over time or over repeated trials,” while the arithmetic mean might give an overly optimistic impression by weighting all levels equally, regardless of how long they lasted.

Comparison of harmonic, geometric, and arithmetic means

The table below summarizes the differences between the three main means for positive data. This can help you decide which one is most appropriate for your situation.

Type of mean Formula (for x1, …, xn > 0) Best suited for Effect of small values
Harmonic mean H = n / (1/x1 + … + 1/xn) Averaging rates, speeds, and ratios when the underlying quantity (like distance or quantity purchased) is held equal. Small values have a strong effect and pull the mean down sharply.
Geometric mean G = (x1 × x2 × … × xn)^(1/n) Averaging growth factors, returns, or multiplicative effects (e.g., investment returns over time). Small values influence the mean, but less strongly than with the harmonic mean.
Arithmetic mean A = (x1 + x2 + … + xn) / n Simple averages of quantities that add directly, like test scores or total amounts. Each value contributes linearly; small values do not receive any extra weight.

Another related measure is the root mean square (RMS), also known as the quadratic mean. It is always greater than or equal to the arithmetic mean and is used when you care about the magnitude of fluctuations, such as in electrical engineering (RMS voltage) or in statistics for measuring errors. While RMS is not the same as the harmonic mean, thinking about all four measures together helps you understand how different ways of averaging highlight different aspects of your data.

Assumptions and limitations

The harmonic mean is powerful in the right context, but it is not universally applicable. Keep the following assumptions and limitations in mind when you use this calculator:

Before relying on the result, check that your data fit these assumptions. If your situation does not involve rates, ratios, or equal-weight scenarios, consider whether the arithmetic or geometric mean might better answer your question.

Practical tips for using the result

When you use the harmonic mean from this calculator in your own work:

Used appropriately, the harmonic mean can provide a more realistic summary of rates and ratios than the arithmetic mean, particularly in contexts where time, distance, or quantity is shared equally across the different levels you are averaging.

Enter numbers separated by commas.

Embed this calculator

Copy and paste the HTML below to add the Harmonic Mean Calculator - Average Rates Accurately to your website.