Harmonic Mean Calculator

Calculate the harmonic mean for rates, ratios, speeds, and price multiples with Pythagorean comparison.

📐 Math ➗ Math & Statistics ⚡ Instant Analysis

Pythagorean Means Comparison

Harmonic Mean (H)
60.76
Geometric Mean (G)
66.27
Arithmetic Mean (A)
70.00
Item (i) Value (xᵢ) Reciprocal (1 / xᵢ)
Quick Overview & Direct Answer

Harmonic Mean Calculator — Calculate Pythagorean Means & Rates: Free harmonic mean calculator. Compute the harmonic mean, geometric mean, and arithmetic mean for speeds, rates, P/E ratios, and finance datasets.

Primary Use Mathematical computation, algebra, geometry, statistical calculations
Input Formats Numeric formulas, equations, data sets
Output Format Exact numerical results, step-by-step solutions, charts
Processing Mode 100% Client-Side In-Browser Math Engine
Access Tier Free, unlimited, no sign-up needed

The Harmonic Mean: Definition, Usage & Mathematical Properties

The harmonic mean is one of the three classic Pythagorean means (alongside the arithmetic mean and geometric mean). Formally defined as the reciprocal of the arithmetic mean of the reciprocals of a given set of positive observations, the harmonic mean is the mathematically rigorous measure of central tendency for rates, ratios, speeds, densities, and price-to-earnings multiples.

A classic mathematical error in physics, engineering, and finance is using the standard arithmetic average to calculate the average rate of travel over equal distances or the average multiple of an equity portfolio. Whenever quantities are expressed as ratios (e.g. kilometers per hour, gallons per mile, price per dollar of earnings), the arithmetic mean overweights larger numbers and introduces an upward bias. The harmonic mean gives proper equal weighting to each equal sub-unit of distance or investment capital.

1

Input Rate Data

Enter positive numeric values separated by commas or whitespace (e.g., speeds, P/E ratios).

2

Reciprocal Calculation

The engine computes the individual reciprocal ($1 / x_i$) for every observation in the series.

3

Sum & Inversion

Total data point count ($n$) is divided by the sum of reciprocals to find the exact harmonic mean.

4

Compare Pythagorean Means

Review the harmonic, geometric, and arithmetic means side-by-side to verify the inequality.

Mathematical Formula

Harmonic Mean (H) = n / ( ∑ (1 / xᵢ) ) = n / ( 1/x₁ + 1/x₂ + ... + 1/xₙ )

The Fundamental Pythagorean Inequality: For any non-identical positive numbers, the relationship strictly holds:

Harmonic Mean (H) ≤ Geometric Mean (G) ≤ Arithmetic Mean (A)

Classic Worked Example: Average Speed Over Equal Distance

A delivery vehicle drives a 60-mile route from City A to City B at an average speed of 60 mph, and returns along the exact same 60-mile route at 30 mph due to heavy rush hour traffic:

  • The Common Mistake (Arithmetic Mean): (60 + 30) / 2 = 45 mph. This is incorrect!
  • Trip Time Analysis: Outbound trip takes 60 miles / 60 mph = 1.0 hour. Return trip takes 60 miles / 30 mph = 2.0 hours. Total travel time = 3.0 hours. Total round-trip distance = 120 miles.
  • True Average Speed: 120 miles / 3.0 hours = 40.0 mph
  • Harmonic Mean Verification: $H = 2 / (1/60 + 1/30) = 2 / (0.01667 + 0.03333) = 2 / 0.050 = mathbf{40.0 ext{ mph}}$

Harmonic Mean in Financial Analysis & Data Science

In quantitative portfolio management, equity valuation multiples—most notably the Price-to-Earnings (P/E) ratio—are universally quoted with stock price in the numerator and earnings per share in the denominator ($P/E = P / E$). A severe statistical pitfall occurs when an equity analyst attempts to compute the average valuation multiple of an investment fund by taking the simple arithmetic mean of the portfolio's component P/E ratios.

Because the arithmetic mean averages price per dollar of earnings rather than earnings per dollar of price, it severely overweights high-multiple growth stocks and underweights low-multiple value companies. Academically and professionally, the CFA Institute and institutional index providers mandate calculating the harmonic mean of component P/E ratios to ensure mathematical consistency with the aggregate portfolio's true underlying earnings yield.

Detailed Worked Example: Financial Portfolio P/E Ratio

Consider a portfolio invested equally across two stocks: Stock Alpha trading at a P/E multiple of 10, and Stock Beta trading at an extreme growth multiple of 100:

  • The Flawed Arithmetic Mean: $(10 + 100) / 2 = mathbf{55.0}$. This implies an aggregate portfolio earnings yield of only $1 / 55 = 1.82%$.
  • The True Economic Reality: For every $1,000 invested ($500 in Alpha, $500 in Beta): Alpha generates $500 / 10 = $50 in earnings; Beta generates $500 / 100 = $5 in earnings. Total portfolio earnings = $55 on $1,000 invested, delivering an actual earnings yield of $55 / $1,000 = 5.50%.
  • The Harmonic Mean Calculation: $H = 2 / (1/10 + 1/100) = 2 / (0.10 + 0.01) = 2 / 0.11 = mathbf{18.18}$. An aggregate P/E of 18.18 corresponds exactly to the true 5.50% earnings yield ($1 / 18.18 = 0.055$). The arithmetic mean overstated the portfolio multiple by more than 300%!

Cross-Disciplinary Applications of the Harmonic Mean

  • Electronics & Circuit Theory: When electrical resistors are connected in parallel, the total equivalent resistance ($R_{ ext{eq}}$) is equal to the harmonic mean of the individual resistor values divided by the number of resistors.
  • Fluid Dynamics & Porosity: Geologists calculate the effective hydraulic conductivity of layered geological strata perpendicular to fluid flow using harmonic averages.
  • Information Retrieval & Natural Language Processing: The $F_eta$ and $F_1$ evaluation metrics in machine learning balance Precision and Recall using harmonic formulation to prevent models with zero precision from scoring favorably.

Frequently Asked Questions

Because the formula involves calculating $1/x$, a value of zero results in division by zero (undefined). Negative values can lead to negative or infinite results that destroy the mathematical validity of a central tendency measure.

In machine learning classification, the widely used $F_1$ Score is the harmonic mean of Precision and Recall. It penalizes extreme imbalances between false positives and false negatives.