Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
Geometric Mean CalculatorRoot Mean Square CalculatorAverage CalculatorStatistics CalculatorDistance-Speed-Time Triangle CalculatorUltimate Frequency & Wavelength Converter
Home Page > Math > Statistics And Data Analysis

Harmonic Mean Calculator

Calculate the harmonic mean of a data set with step-by-step formulas, comparison with arithmetic and geometric means, interactive visualization, and practical examples for rates, speeds, and financial analysis.

Free to useNo sign-up requiredUpdated Jan 2026
Harmonic Mean CalculatorTry it now — free ▼
Note: Harmonic mean requires all positive, non-zero values. It's ideal for averaging rates, speeds, and financial ratios. For mixed data, use our Number Extractor.

Embed Harmonic Mean Calculator Widget

About Harmonic Mean Calculator

Welcome to the Harmonic Mean Calculator, a comprehensive tool for calculating the harmonic mean with step-by-step solutions, interactive visualizations, and comparisons with arithmetic and geometric means. The harmonic mean is essential for averaging rates, ratios, and speeds, and is widely used in physics, finance, and data science.

What is the Harmonic Mean?

The harmonic mean is a type of average calculated as the reciprocal of the arithmetic mean of reciprocals. For a dataset of n positive numbers x₁, x₂, ..., xₙ, the harmonic mean H is defined as:

Harmonic Mean Formula
$$H = \frac{n}{\frac{1}{x_1} + \frac{1}{x_2} + \cdots + \frac{1}{x_n}} = \frac{n}{\sum_{i=1}^{n} \frac{1}{x_i}}$$

The harmonic mean gives greater weight to smaller values in the dataset, making it particularly useful when dealing with rates, ratios, and situations where reciprocals are meaningful.

The AM-GM-HM Inequality

A fundamental relationship in mathematics connects the three Pythagorean means:

For any set of positive numbers:
H ≤ G ≤ A
Harmonic Mean ≤ Geometric Mean ≤ Arithmetic Mean
Equality holds if and only if all values are identical.

When to Use Harmonic Mean

The harmonic mean is the appropriate average when:

🚗
Average Speed
When traveling equal distances at different speeds, the average speed is the harmonic mean of the individual speeds.
📈
Financial Ratios
P/E ratios, price-to-book ratios, and other financial metrics are properly averaged using harmonic mean.
🤖
F1 Score
The F1 score in machine learning is the harmonic mean of precision and recall.
Parallel Circuits
The equivalent resistance of parallel resistors uses harmonic mean principles.

Average Speed Example

If you drive 100 km at 40 km/h and return 100 km at 60 km/h, your average speed is:

Average Speed Calculation
$$H = \frac{2}{\frac{1}{40} + \frac{1}{60}} = \frac{2}{\frac{3+2}{120}} = \frac{2 \times 120}{5} = 48 \text{ km/h}$$

Note: This is less than the arithmetic mean of 50 km/h because you spend more time at the slower speed.

How to Use This Calculator

  1. Enter your data: Input positive numbers separated by commas, spaces, or line breaks. Try the example buttons for quick testing.
  2. Set precision: Choose decimal places (2-15) based on your accuracy requirements.
  3. Calculate: Click the button to see the harmonic mean with step-by-step calculations.
  4. Compare means: Review the comparison of harmonic, geometric, and arithmetic means.
  5. Visualize: Examine the interactive charts to understand your data distribution.

Comparing the Three Means

Mean Type Formula Best Used For
Harmonic Mean n / Σ(1/xᵢ) Rates, ratios, speeds (equal distances)
Geometric Mean (∏xᵢ)^(1/n) Growth rates, percentages, ratios
Arithmetic Mean Σxᵢ / n Additive quantities (heights, weights)

Practical Applications

Finance and Investment

In financial analysis, the harmonic mean is used to average price ratios. When calculating the average P/E ratio of a portfolio or index, the harmonic mean provides a more accurate representation because it accounts for the relative sizes of investments at different P/E levels.

Machine Learning - F1 Score

The F1 score, a crucial metric for evaluating classification models, is defined as:

F1 Score Formula
$$F_1 = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} = \frac{2}{\frac{1}{\text{Precision}} + \frac{1}{\text{Recall}}}$$

Using harmonic mean ensures that both precision and recall must be reasonably high for a good F1 score.

Physics - Parallel Resistors

For n identical resistors R in parallel, the equivalent resistance is R/n. For different resistors, the formula uses harmonic relationships.

Limitations and Considerations

Frequently Asked Questions

What is the harmonic mean?

The harmonic mean is a type of average calculated as the reciprocal of the arithmetic mean of reciprocals. For a dataset of n positive numbers, the harmonic mean H = n / (1/x₁ + 1/x₂ + ... + 1/xₙ). It is particularly useful for averaging rates, ratios, and speeds, and always gives a value less than or equal to the geometric and arithmetic means.

When should I use harmonic mean instead of arithmetic mean?

Use harmonic mean when: (1) Averaging rates or ratios like speed, efficiency, or price-to-earnings ratios; (2) Equal amounts of time or resources are spent at different rates; (3) Calculating average speed for equal distances; (4) Finding the effective resistance of parallel resistors; (5) Working with F-scores in machine learning. Arithmetic mean is better for additive quantities like heights, weights, or scores.

What is the relationship between harmonic, geometric, and arithmetic means?

For any set of positive numbers, the three means satisfy the inequality: Harmonic Mean ≤ Geometric Mean ≤ Arithmetic Mean (H ≤ G ≤ A). Equality holds only when all values in the dataset are identical. This relationship is known as the AM-GM-HM inequality and is fundamental in mathematics and statistics.

Why can't harmonic mean be calculated with zero or negative numbers?

The harmonic mean requires calculating reciprocals (1/x) of each value. Division by zero is undefined, so zeros cannot be included. Negative numbers would make the sum of reciprocals potentially zero or negative, making the result undefined or meaningless. The harmonic mean is designed for positive ratio-scale data.

How do I calculate average speed using harmonic mean?

When traveling equal distances at different speeds, the average speed is the harmonic mean of the speeds. For example, if you drive 100 km at 40 km/h and return 100 km at 60 km/h, the average speed is H = 2 / (1/40 + 1/60) = 48 km/h, not the arithmetic mean of 50 km/h. This is because you spend more time traveling at the slower speed.

What is the F1 score and how does it relate to harmonic mean?

The F1 score in machine learning is the harmonic mean of precision and recall: F1 = 2 × (precision × recall) / (precision + recall). Using harmonic mean ensures that both metrics must be reasonably high for a good F1 score - having high precision but low recall (or vice versa) results in a low F1 score, making it a balanced measure of classifier performance.

Additional Resources

Reference this content, page, or tool as:

"Harmonic Mean Calculator" at https://MiniWebtool.com/harmonic-mean-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Jan 29, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Statistics And Data Analysis:

Top & Updated:

Arithmetic Mean CalculatorMean Median Mode CalculatorMean Absolute Deviation (MAD) CalculatorView all →
Home Page > Math > Statistics And Data Analysis > Harmonic Mean Calculator