Harmonic Mean Calculator
Calculate the harmonic mean for rates, ratios, and averages of reciprocals. Common in physics and finance.
Harmonic Mean Calculator
Background.
The harmonic mean is the reciprocal average, designed for data that express rates, ratios, or fractions where the denominator of the rate is constant. It answers questions such as: "If I drive 60 miles per hour to a destination and 30 miles per hour back over the same distance, what is my average speed?" The arithmetic mean of 60 and 30 is 45, but the correct answer is 40 miles per hour. The harmonic mean produces this result because it weights the slower speed more heavily: you spend twice as much time traveling at 30 mph as at 60 mph, so the slower speed must exert greater influence on the average.
Students search for harmonic mean calculators when solving physics problems involving average velocity, average acceleration, and equivalent resistance in parallel electrical circuits. Financial analysts use it to average price-earnings ratios and cost-per-unit metrics where the number of shares or units differs across firms. In hydrology, the harmonic mean estimates the effective hydraulic conductivity of layered soils when flow is perpendicular to the layers. In demography, it appears in the calculation of the total fertility rate and in indices that average rates across populations of unequal size.
The harmonic mean is one of the three classical Pythagorean means, alongside the arithmetic and geometric means. For any set of positive numbers that are not all identical, the harmonic mean is strictly less than the geometric mean, which is in turn strictly less than the arithmetic mean. This hierarchy—AM ≥ GM ≥ HM—is a foundational result in analysis with applications in optimization, information theory, and thermodynamics. The inequality is strict unless all values are equal. In the average speed example, the geometric mean is approximately 42.4 mph and the arithmetic mean is 45 mph, with the true harmonic mean of 40 mph sitting at the bottom of the ordering.
The mathematical reason the harmonic mean dominates rate averaging lies in the structure of the reciprocal. When a rate r = d/t is inverted, it becomes t/d, a measure of time per unit distance. Averaging these inverted rates and then inverting the result yields a time-weighted average speed. This is precisely what the harmonic mean computes. Any attempt to average rates directly without respecting the reciprocal structure commits a category error that produces biased results. Textbooks in physics and engineering universally prescribe the harmonic mean for average speed over equal distances and for equivalent conductance in parallel resistors.
Historically, the harmonic mean appeared in Greek mathematics as the mean associated with musical harmony. The name derives from its role in the theory of musical intervals: the harmonic mean of two frequencies corresponds to a pitch that creates consonant overtones with both. While this acoustic origin is largely forgotten, the statistical properties of the harmonic mean remain essential in any field where rates must be averaged correctly. Mastering the harmonic mean is therefore essential for anyone working with rates, ratios, or reciprocal quantities in science, engineering, or finance. Its proper use prevents costly analytical errors that simpler averages cannot detect.
What is harmonic mean calculator?
The harmonic mean of n positive real numbers is the reciprocal of the arithmetic mean of their reciprocals. The formula is HM = n / (Σ 1/x_i). It is defined only for positive inputs because the reciprocal of zero is undefined and the reciprocal of a negative number, while mathematically valid, destroys the rate-averaging interpretation that motivates the harmonic mean in practice. The harmonic mean is the smallest of the three Pythagorean means. It is the appropriate average when the data represent rates with a fixed numerator or denominator, such as speed over equal distances or workload completion times. In electrical engineering, the harmonic mean of resistances gives the equivalent resistance of parallel resistors. In finance, it averages ratios such as price-earnings multiples when the dollar amount invested is held constant across positions. The harmonic mean shares the same units as the input data—miles per hour, ohms, dollars per share—but its value is always less than or equal to the arithmetic mean of the same data. Unlike the arithmetic mean, the harmonic mean is highly sensitive to small values, which can pull the average downward dramatically. This sensitivity makes it the most conservative of the three Pythagorean means and the only choice when rates must be averaged over equal distances or equal work units.
How to use this calculator.
- Enter your data values as comma-separated positive numbers in the text area.
- Ensure every value is greater than zero; the reciprocal is undefined at zero.
- Include at least two values to compute a meaningful harmonic mean.
- Click calculate to display the harmonic mean.
- Review the count of parsed values shown as secondary output.
- Use the result for average speed, rate averaging, or equivalent resistance calculations.
The formula.
The harmonic mean formula HM = n / (Σ 1/x_i) can be derived from the requirement to average rates correctly. Consider a traveler who covers distance d at speed v_1 and returns the same distance at speed v_2. The total distance is 2d. The time for the first leg is d/v_1; the time for the second is d/v_2. The average speed is total distance divided by total time: v_avg = 2d / (d/v_1 + d/v_2) = 2 / (1/v_1 + 1/v_2). This is exactly the harmonic mean of v_1 and v_2. The arithmetic mean fails because it does not account for the fact that more time is spent at the slower speed. The harmonic mean automatically applies the correct time weighting through the reciprocal structure. For n rates r_i = D / t_i with constant D, the total time is Σ t_i = Σ D/r_i = D Σ 1/r_i. The total distance is nD. The average rate is nD / (D Σ 1/r_i) = n / Σ 1/r_i, which generalizes the two-rate case. This derivation confirms that the harmonic mean is not an arbitrary definition but the natural consequence of averaging rates with a fixed numerator or denominator. The relationship HM ≤ GM ≤ AM follows from Jensen's inequality applied to the convex function f(x) = 1/x. Because 1/x is convex for x > 0, the arithmetic mean of the reciprocals is at least the reciprocal of the arithmetic mean: average(1/x_i) ≥ 1/AM. Taking reciprocals reverses the inequality, yielding HM ≤ AM. The geometric mean sits between them by a separate application of the AM-GM inequality to the logarithms. These ordering relationships are universal for positive data and provide quick sanity checks on calculations. Dimensional analysis confirms consistency. Each x_i has units of rate—distance per time, currency per share, charge per volt. The reciprocal has units of time per distance, shares per currency, volts per charge. Summing n reciprocals and dividing n by that sum inverts the units back to the original rate units. The result is dimensionally homogeneous with the inputs, unlike some improper averaging schemes that mix units incoherently.
A worked example.
A motorist drives 120 miles to a destination at 60 miles per hour and returns 120 miles at 30 miles per hour. The total distance is 240 miles. The time for the outbound leg is 120 / 60 = 2 hours. The time for the return leg is 120 / 30 = 4 hours. The total travel time is 6 hours. The average speed is total distance divided by total time: 240 / 6 = 40 miles per hour. This is exactly the harmonic mean of 60 and 30: HM = 2 / (1/60 + 1/30) = 2 / (0.016667 + 0.033333) = 2 / 0.05 = 40. The arithmetic mean of 60 and 30 is 45, which overstates the true average speed by 12.5 percent because it ignores the fact that the motorist spends twice as long traveling at the slower speed. The harmonic mean correctly weights each speed by the time spent at that speed, producing the only average that satisfies the fundamental definition of average speed as total distance divided by total time.
Frequently asked questions.
When should I use harmonic mean instead of arithmetic mean?
Can harmonic mean handle zero values?
How is harmonic mean used in average speed problems?
What is the relationship between HM, GM, and AM?
Is harmonic mean used in finance?
What is the weighted harmonic mean?
Why is HM smaller than the arithmetic mean?
Can HM be used for rates with different denominators?
What are computational pitfalls when calculating HM?
How does HM relate to electrical resistance?
References& sources.
- [1]NIST/SEMATECH (2012). e-Handbook of Statistical Methods. https://www.itl.nist.gov/div898/handbook/
- [2]Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. New York: John Wiley & Sons.
- [3]Bullen, P.S. (2003). Handbook of Means and Their Inequalities. Dordrecht: Kluwer Academic Publishers.
- [4]Kendall, M.G., Stuart, A. (1977). The Advanced Theory of Statistics, Vol. 1: Distribution Theory, 4th ed. London: Charles Griffin.
- [5]NIST SP 811 (2008). Guide for the Use of the International System of Units (SI). https://www.nist.gov/pml/special-publication-811
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled