Harmonic Mean Calculator

Calculate the harmonic mean of any set of numbers, compare with arithmetic and geometric means, and verify the AM-GM-HM inequality.

About the Harmonic Mean Calculator

The harmonic mean is one of the three classical Pythagorean means alongside the arithmetic and geometric means. It is defined as the reciprocal of the arithmetic mean of the reciprocals — or equivalently, n divided by the sum of the reciprocals of n values. The harmonic mean is always the smallest of the three Pythagorean means (for positive values), obeying the famous inequality HM ≤ GM ≤ AM.

This calculator computes the harmonic mean for any set of positive numbers, compares it with the arithmetic and geometric means, and visually demonstrates the AM-GM-HM inequality. It provides a detailed breakdown showing each value, its reciprocal, and its contribution to the total.

The harmonic mean is especially useful when averaging rates or ratios. For example, if you drive 60 km/h for one leg of a trip and 40 km/h for the return leg (same distance), the correct average speed is the harmonic mean: 2/(1/60 + 1/40) = 48 km/h — not the arithmetic mean of 50. Similarly, the harmonic mean appears in electrical circuits (parallel resistors), finance (price-earnings ratios), and physics (lens equations). Understanding when to use each type of mean is a critical skill in statistics and applied mathematics.

Why Use This Harmonic Mean Calculator?

The harmonic mean involves summing reciprocals — a step where arithmetic mistakes are common, especially with more than two values or when comparing HM against arithmetic and geometric means. This calculator instantly computes all three Pythagorean means, verifies the AM-GM-HM inequality, and provides a visual bar chart comparison so you can see exactly how the means relate. It is essential for correctly averaging speeds over equal distances, computing equivalent parallel resistances, and understanding dollar-cost averaging in finance.

How to Use This Calculator

  1. Choose between entering a comma-separated list or using two-value mode.
  2. Enter your positive numbers in the input field.
  3. Adjust the decimal places for precision control.
  4. Use presets to explore common scenarios like speed averaging.
  5. Review the three means and their inequality relationship in the output cards.
  6. Check the visual comparison bars to see where each mean falls.
  7. Examine the table for individual value reciprocals and contributions.

Formula

HM = n / (1/x₁ + 1/x₂ + … + 1/xₙ) AM = (x₁ + x₂ + … + xₙ) / n GM = (x₁ · x₂ · … · xₙ)^(1/n)

Example Calculation

Result: HM = 48, AM = 50, GM ≈ 48.99

For values 60 and 40: HM = 2/(1/60 + 1/40) = 2/(0.0417) = 48. This is the correct average for round-trip speed calculations.

Tips & Best Practices

The Three Pythagorean Means

The arithmetic mean (AM), geometric mean (GM), and harmonic mean (HM) are the three classical Pythagorean means, each suited to different types of data. AM = (x₁+x₂+…+xₙ)/n is the everyday average. GM = (x₁·x₂·…·xₙ)^(1/n) is used for growth rates and ratios. HM = n/(1/x₁+1/x₂+…+1/xₙ) is used for rates and reciprocal quantities. For any set of positive, non-equal values, HM < GM < AM — this is the AM-GM-HM inequality, one of the most important inequalities in mathematics. Equality holds only when all values are identical.

When to Use the Harmonic Mean

Use the harmonic mean whenever you are averaging rates measured over equal quantities (not equal times). The classic example is average speed: if you drive 60 km/h for 100 km and 40 km/h for 100 km, the correct average speed is HM(60, 40) = 48 km/h, not 50. Similarly, averaging price-to-earnings ratios across equal-dollar investments, computing the equivalent resistance of parallel resistors (1/R = 1/R₁ + 1/R₂), and finding the average rate of work when workers contribute equal amounts all require the harmonic mean. Using the arithmetic mean in these contexts gives systematically biased results.

Harmonic Mean in Electrical Engineering

In circuit design, resistors in parallel combine by the reciprocal sum formula: 1/Rₜₒₜₐₗ = 1/R₁ + 1/R₂ + … + 1/Rₙ. For two resistors this simplifies to Rₜₒₜₐₗ = 2·HM(R₁, R₂)/n, or equivalently R₁R₂/(R₁+R₂). Capacitors in series follow the same pattern. Understanding the harmonic mean makes these calculations intuitive and helps engineers quickly estimate equivalent component values without lengthy algebra.

Frequently Asked Questions

When should I use the harmonic mean?

When averaging rates or ratios measured over equal amounts — like speeds over equal distances, or prices paid for equal-dollar investments. Use this as a practical reminder before finalizing the result.

Why is HM always less than AM?

By the AM-GM-HM inequality: for positive values, HM ≤ GM ≤ AM. Equality holds only when all values are the same.

Can I use harmonic mean with negative numbers?

The classical harmonic mean requires positive values. Negative or zero values make the reciprocal sum undefined or meaningless.

What is the formula for two values?

HM = 2ab/(a + b). This is the same formula used for parallel resistors: 1/R_total = 1/R₁ + 1/R₂.

How is harmonic mean used in finance?

For averaging P/E ratios, dollar-cost averaging analysis, and calculating average rates of return over equal investments. Keep this note short and outcome-focused for reuse.

What are the three Pythagorean means?

Arithmetic (AM = sum/n), Geometric (GM = nth root of product), and Harmonic (HM = n/sum of reciprocals). They always satisfy HM ≤ GM ≤ AM.

Related Pages