Harmonic Mean Calculator

Enter a set of positive numbers in the data input field (comma or space separated) and get the harmonic mean calculated instantly. Results include the harmonic mean (H), sum of reciprocals, and sample size (n) — perfect for averaging rates, speeds, and ratios.

Enter positive numbers separated by commas, spaces, or new lines. All values must be greater than zero.

Results

Harmonic Mean (H)

--

Sum of Reciprocals Σ(1/xᵢ)

--

Sample Size (n)

--

Arithmetic Mean

--

Geometric Mean

--

Minimum Value

--

Maximum Value

--

Comparison of Means

Results Table

Frequently Asked Questions

What is the harmonic mean?

The harmonic mean is a type of average (measure of central tendency) calculated by dividing the number of values by the sum of their reciprocals. It is one of the three classical Pythagorean means, alongside the arithmetic mean and geometric mean. All input values must be positive numbers.

What is the harmonic mean formula?

The harmonic mean H of n positive numbers x₁, x₂, ..., xₙ is: H = n / (1/x₁ + 1/x₂ + ... + 1/xₙ). In other words, you take the reciprocal of each value, sum them all up, and then divide the count n by that sum.

When should I use the harmonic mean?

Use the harmonic mean when averaging rates or ratios where the same quantity appears in the denominator. Common examples include averaging speeds over equal distances, price-to-earnings ratios in finance, and resistance values in parallel circuits. If your data represents 'units per time' (rates), the harmonic mean gives a more accurate average than the arithmetic mean.

How does the harmonic mean differ from the arithmetic mean?

The arithmetic mean sums all values and divides by the count, while the harmonic mean takes the reciprocal of the arithmetic mean of the reciprocals. For any set of positive numbers, the harmonic mean is always less than or equal to the arithmetic mean (H ≤ A), and less than or equal to the geometric mean (H ≤ G ≤ A). The difference becomes significant when data values vary widely.

Can the harmonic mean be used with negative numbers or zero?

No. The harmonic mean is undefined for zero (division by zero) and generally not meaningful for negative numbers. All values in your dataset must be strictly positive (greater than zero) for the harmonic mean to be mathematically valid.

What is a real-world example of the harmonic mean in finance?

In finance, the harmonic mean is used to average price-to-earnings (P/E) ratios across a portfolio of stocks. If you invest equal dollar amounts in multiple stocks, the harmonic mean of their P/E ratios gives you the correct portfolio-level P/E ratio, whereas the arithmetic mean would overweight high-P/E stocks.

How do you calculate the harmonic mean of two numbers?

For two numbers a and b, the harmonic mean is H = 2ab / (a + b). For example, the harmonic mean of 4 and 12 is H = 2×4×12 / (4+12) = 96/16 = 6. This formula also appears in physics and geometry, such as calculating the equivalent resistance of two parallel resistors.

What is the weighted harmonic mean?

The weighted harmonic mean assigns different weights to each value: H = (Σwᵢ) / Σ(wᵢ/xᵢ), where wᵢ is the weight of the i-th value xᵢ. This is useful when some data points represent larger groups or investments than others, such as computing a weighted average P/E ratio for a non-equal-weighted portfolio.

More Statistics Tools