Skip to main content
math

Harmonic Mean Calculator

Calculate the harmonic mean of a set of positive numbers. The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals, ideal for averaging rates.

Reviewed by Chase FloiedUpdated

This free online harmonic mean calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.

Enter positive numbers separated by commas

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Harmonic Mean Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.

2

Review your inputs

Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Harmonic Mean Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

Formula Reference

Harmonic Mean Calculator Formula

See calculator inputs for the governing equation

Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.

When to Use This Calculator

  • Use the Harmonic Mean Calculator when you need a quick mathematical result without writing out all the steps manually, saving time on repetitive calculations.
  • Use it to verify hand calculations on tests or assignments and catch arithmetic mistakes.
  • Use it when teaching or explaining mathematical concepts to others, demonstrating how changing inputs affects the result.
  • Use it to explore the behavior of mathematical functions across a range of inputs.

About This Calculator

The Harmonic Mean Calculator is a free mathematical calculation tool for students, educators, and professionals who need quick, reliable results. Calculate the harmonic mean of a set of positive numbers. The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals, ideal for averaging rates. The underlying algorithms implement well-established mathematical formulas and numerical methods. Results are computed instantly in the browser. This tool is useful for learning, verification of hand calculations, and rapid exploration of mathematical relationships. All computation happens locally — no data is sent to a server.

About Harmonic Mean Calculator

The harmonic mean is defined as the reciprocal of the arithmetic mean of the reciprocals. For n positive numbers x₁, x₂, ..., xₙ, the harmonic mean H = n / (1/x₁ + 1/x₂ + ... + 1/xₙ). The harmonic mean is the correct average to use when the data values are rates or ratios defined with the same numerator unit. The classic example involves average speed: if you drive 60 km at 40 km/h and 60 km at 60 km/h, the average speed is the harmonic mean of 40 and 60, which is 48 km/h — not the arithmetic mean of 50 km/h. The harmonic mean is always the smallest of the three Pythagorean means: HM ≤ GM ≤ AM, with equality when all values are equal. It appears in physics (parallel resistances, lens optics), finance (price-earnings ratios), ecology (population density), and machine learning (the F1 score is the harmonic mean of precision and recall).

The Math Behind It

The relationship HM ≤ GM ≤ AM is one of the most elegant inequalities in mathematics. For two positive numbers a and b: HM = 2ab/(a+b), GM = √(ab), AM = (a+b)/2, and these satisfy HM × AM = GM². The harmonic mean is appropriate whenever the quantities being averaged are inverses of some other quantity. For parallel electrical resistors R₁ and R₂, the combined resistance is R = R₁R₂/(R₁+R₂) = HM(R₁,R₂)/2. In optics, the thin lens equation 1/f = 1/u + 1/v relates object distance, image distance, and focal length in a harmonic relationship. The harmonic series 1 + 1/2 + 1/3 + ... diverges, growing approximately as ln(n) + γ (Euler-Mascheroni constant). The F1 score in machine learning, defined as 2 × precision × recall / (precision + recall), is the harmonic mean of precision and recall, penalizing models with extreme imbalance between the two metrics.

Formula Reference

Harmonic Mean

HM = n / (1/x₁ + 1/x₂ + ... + 1/xₙ)

Variables: x₁...xₙ = positive values, n = count

Worked Examples

Example 1: Average Speed Problem

A car travels 100 km at 40 km/h and returns 100 km at 60 km/h. Find the average speed.

Step 1:Sum of reciprocals: 1/40 + 1/60 = 3/120 + 2/120 = 5/120
Step 2:HM = 2 / (5/120) = 2 × 120/5 = 48 km/h
Step 3:Verify: Time going = 100/40 = 2.5 h, time returning = 100/60 ≈ 1.667 h
Step 4:Total distance = 200 km, total time ≈ 4.167 h, speed = 200/4.167 ≈ 48 km/h ✓

Average speed = 48 km/h (harmonic mean)

Common Mistakes & Tips

  • !Using arithmetic mean for speed when equal distances are traveled — use harmonic mean.
  • !Including zero values — the harmonic mean is undefined if any value is zero.
  • !Not recognizing when the harmonic mean is appropriate versus arithmetic or geometric.
  • !Confusing harmonic mean with simple average of reciprocals.

Related Concepts

Used in These Calculators

Calculators that build on or apply the concepts from this page:

Frequently Asked Questions

When should I use harmonic mean?

Use harmonic mean when averaging rates or ratios with the same numerator. Classic examples: average speed over equal distances, combining parallel resistances, the F1 score (harmonic mean of precision and recall).

Why is the harmonic mean always the smallest?

The HM ≤ GM ≤ AM inequality holds because taking reciprocals reverses the relative spread of values, causing the average to be pulled toward the smaller values more strongly.