Skip to content
CalculatorAtlas

Harmonic Mean Calculator

Tested

Harmonic mean of a data set.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The harmonic mean is n ÷ Σ(1/x) for positive values. For 1, 4 and 4 it is 3 ÷ 1.5 = 2.

Enter positive data values. The calculator returns the harmonic mean.

Related tools: Mean Calculator: Mean of a data set. Geometric Mean Calculator: Geometric mean of a data set. Mean Median Mode Calculator: Mean, median and mode of a data set.

How to use the Harmonic Mean Calculator

  1. Type data set, for example 4, 8, 15, 16, 23, 42.
  2. Press Calculate to see the result, and use Reset to start again.
Inputs of the Harmonic Mean Calculator
InputWhat to enterAllowed values
Data setText, such as 4, 8, 15, 16, 23, 42—

Formula and method

Formula

n ÷ Σ(1/x) (positive values only)

IEEE-754 double precision; shown to at most 6 decimal places.

Computed directly from the sorted or raw values.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Data set = 1, 4, 4.

Results of example 1
ResultValue
Harmonic mean2

Example 2

Inputs: Data set = 40 60.

Results of example 2
ResultValue
Harmonic mean48

The first line is the headline result (harmonic mean). IEEE-754 double precision; shown to at most 6 decimal places.

When to use it

Use it for averaging rates over equal distances. Driving 60 km/h out and 40 km/h back averages 2 ÷ (1/60 + 1/40) = 48 km/h, not 50. It is the right mean for ratios like price-to-earnings.

Ordering

For positive numbers harmonic ≤ geometric ≤ arithmetic mean: for 1, 4, 4 these are 2, 2.52 and 3. Values must be positive, with at least one.

Average speed over equal distances

Driving a route at 60 mph and returning at 40 mph does not average 50 mph. For equal distances the correct average is the harmonic mean, 2 ÷ (1/60 + 1/40) = 48 mph.

For positive values that are not all equal, harmonic ≤ geometric ≤ arithmetic. For 2 and 8 they are 3.2, 4 and 5 respectively.

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Data set: left empty shows "Enter data set." beside that field and no result.

Choosing between the Harmonic Mean Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Harmonic Mean Calculator and similar calculators
CalculatorYou enterIt returns
[Mean Calculator](/statistics/mean/)data setMean
[Geometric Mean Calculator](/statistics/geometric-mean-calculator/)data setGeometric mean
[Mean Median Mode Calculator](/statistics/mean-median-mode-calculator/)data setMean
[Mean Absolute Deviation Calculator](/statistics/mean-absolute-deviation-calculator/)data setMean absolute deviation
[Mean Median Mode Range Calculator](/statistics/mean-median-mode-range-calculator/)data setMean

Background: descriptive statistics

Population statistics divide by n and sample statistics divide by n − 1 (Bessel's correction), because a sample tends to understate variability. Use the population version when your data is every value in the group, and the sample version when it is a subset.

Defaults differ between tools, and so do quartile conventions, which can give slightly different values for small data sets; this page states the method it uses.

Assumptions and limitations

  • At least one value

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for data set to confirm this.

Frequently asked questions

What is the harmonic mean of 2 and 6?

The harmonic mean of 2 and 6 is 2 ÷ (1/2 + 1/6) = 3.

Why not the arithmetic mean?

It would overstate average speed.

Is it the smallest mean?

Yes: for positive values the harmonic mean ≤ geometric mean ≤ arithmetic mean, e.g. 2, 2.52 and 3 for 1, 4, 4.

When should I use the harmonic mean?

Use it to average rates over equal amounts of the quantity in the denominator, such as speeds over equal distances.

Is the harmonic mean always the smallest mean?

For positive numbers it never exceeds the geometric or arithmetic mean, and it equals them only when all values are the same.

What does the Harmonic Mean Calculator calculate?

Harmonic mean of a data set. It returns Harmonic mean.

What formula does the Harmonic Mean Calculator use?

n ÷ Σ(1/x) (positive values only). Computed directly from the sorted or raw values.

What is an example of a harmonic Mean result?

With data set 1, 4, 4, the harmonic mean is 2.

Where does the method come from?

The method follows: OpenStax, Introductory Statistics 2e (Rice University): measures of center and spread, correlation and regression.

Sources

  • OpenStax, Introductory Statistics 2e (Rice University): measures of center and spread, correlation and regression

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.