ProMathTools
ProMathTools

Harmonic Mean Calculator – With Formula & Steps

Compute H = n / Σ(1/x) for positive rates, optional weights, and compare AM ≥ GM ≥ HM with clear steps.

e.g. 1, 2, 4 or 40 60 — commas, spaces, tabs, or semicolons

How it works

The harmonic mean is the right average for rates and ratios. It is the reciprocal of the arithmetic mean of the reciprocals: H = n / Σ(1/x). Because it uses 1/x, every value must be strictly positive — a zero makes a reciprocal undefined, and negatives are not meaningful as rate averages. This calculator also reports the arithmetic and geometric means so you can check the classic inequality AM ≥ GM ≥ HM.

Required Inputs & Typical Use Cases

Use the harmonic mean for average speed over equal distances, average price per unit when amounts differ in a reciprocal way, parallel electrical resistance patterns, or any homework problem that says “average of rates.” Turn on weights when segment sizes are unequal (for example different mileages at each speed).


The Formula

Unweighted: H = n / Σ(1/xᵢ)
Weighted: H = Σwᵢ / Σ(wᵢ/xᵢ)
For positive data: AM ≥ GM ≥ HM
  • n

    Count of values

  • xᵢ

    Each positive data value

  • wᵢ

    Optional positive weight for xᵢ


Worked Example

  1. Values 1, 2, 4

    H = 3 / (1/1 + 1/2 + 1/4) = 3 / 1.75 = 1.714286

  2. Average speed 40 mph & 60 mph (equal distance)

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

  3. Average-speed worked example

    10 miles at 30 mph then 10 miles at 60 mph: arithmetic mean (45) is wrong because more time is spent at the slower speed. Harmonic mean: 2 / (1/30 + 1/60) = 40 mph.


Tips, Assumptions & Limitations

  • Only positive numbers are allowed — zeros make 1/x undefined.
  • Use weights when segments have unequal size (e.g. different distances).
  • Compare AM, GM, and HM: for positive data, AM ≥ GM ≥ HM.
  • Common mistake: averaging speeds with the arithmetic mean over equal distances.
  • Common mistake: mixing zero or negative values into a rate average.

The harmonic mean is H = n / Σ(1/xᵢ). It gives more weight to smaller positive values and is the correct average for rates over equal amounts (like average speed over equal distances).

The harmonic mean uses reciprocals 1/x. Zero makes a reciprocal undefined, and mixing signs can cancel or produce values that are not meaningful as a rate average. This calculator requires strictly positive numbers.

With positive weights wᵢ, H = Σw / Σ(wᵢ/xᵢ). Use weights when segments have unequal size (for example, different distances when averaging speeds).

For any set of positive numbers, AM ≥ GM ≥ HM, with equality only when all values are equal. This calculator shows all three side by side.

The harmonic mean is undefined because 1/0 is undefined. The calculator shows a friendly error and asks for strictly positive numbers only.

Over equal distances you spend more time at the slower speed. The harmonic mean automatically weights the slower rate correctly; the arithmetic mean of the mph figures does not.

Related Calculators

Geometric Mean CalculatorMean CalculatorMean Median Mode CalculatorMedian CalculatorCorrelation CoefficientLinear RegressionSample Size CalculatorT-Test CalculatorMode CalculatorVariance CalculatorStandard DeviationMean absolute deviation

Related Guides


How this calculator works

When you think of 'average,' your mind probably jumps to the arithmetic mean – just adding numbers up and dividing. But in statistics, there are different types of averages, each suited for specific situations. The Harmonic Mean is one such powerful average, especially useful when you're dealing with rates, ratios, or speeds. It's not as commonly taught as the arithmetic mean, but it's crucial for getting accurate results in many real-world problems.

Explanation

The Harmonic Mean gives more weight to smaller values in a dataset. This makes it the go-to average when you're working with quantities expressed as 'per unit,' such as miles per hour, kilometers per liter, or cost per item. If you were to use a simple arithmetic mean in these cases, you'd often get a misleading result because it doesn't account for the inverse relationship inherent in rates. For instance, when averaging speeds over fixed distances, the slower speeds have a greater impact on the overall average time taken, and the harmonic mean correctly reflects this.

Formula

The formula for the Harmonic Mean (H) is: H = n / (1/x₁ + 1/x₂ +. + 1/xₙ) Where:
* `n` is the count of numbers in your dataset. * `x₁`, `x₂`,., `xₙ` are the individual numbers in the dataset.

Worked example

Let's revisit the classic example: You drive from city A to city B at 30 mph and immediately return from city B to city A at 60 mph. What's your average speed for the entire round trip? Many people might instinctively say 45 mph (the arithmetic mean of 30 and 60), but that's incorrect. Since the distance is fixed for both legs of the journey, you spend more time driving at the slower speed. The Harmonic Mean provides the correct average: H = 2 / (1/30 + 1/60) H = 2 / (0.033333. + 0.016667.) H = 2 / 0.05 H = 40 mph So, your average speed for the entire trip was 40 mph, not 45 mph. This example clearly shows why the Harmonic Mean is essential for averaging rates.

How to use this tool

Using our Harmonic Mean Calculator is straightforward. Simply enter your numbers into the input field, separating them with either commas or spaces. For example, if you want to find the harmonic mean of 10, 20, and 30, you can type '10, 20, 30' or '10 20 30'. The calculator will instantly process your input and display the count of numbers, the sum of their reciprocals, and the final harmonic mean. Remember to only input positive, finite numbers for an accurate result.

Frequently asked questions

What is the Harmonic Mean?
The Harmonic Mean is a specialized type of average that's particularly useful for datasets involving rates, ratios, or speeds. It's calculated by dividing the number of observations by the sum of the reciprocals of each observation. It tends to give more weight to smaller values compared to the arithmetic mean.
When should I use the Harmonic Mean?
You should use the Harmonic Mean when you need to average rates (like speed, miles per gallon, or cost per unit) or when dealing with quantities that are inversely proportional. For example, it's the correct average for speeds over fixed distances or for calculating average resistance in parallel circuits.
How is the Harmonic Mean different from the Arithmetic or Geometric Mean?
The Arithmetic Mean (simple average) is best for summing quantities. The Geometric Mean is ideal for averaging growth rates or values that are multiplied together. The Harmonic Mean, however, is specifically designed for averaging rates or ratios, giving more influence to smaller values. For any set of positive numbers, the Harmonic Mean is always less than or equal to the Geometric Mean, which is less than or equal to the Arithmetic Mean.

Read the full guide →

About UsBlogChrome ExtensionFAQsTerms and ConditionsPrivacy PolicySitemap
EmailLinkedInFacebook

© 2025-2026 PromathTools. All rights reserved.

Built by KruskalCode – SaaS & Automation Experts · EverydayDevTools