← Advanced & General /

Geometric Mean Calculator

Find the geometric mean of two numbers or apply the geometric mean to altitude and leg theorems in right triangles.

Reviewed by Geometry Calculator, Geometry Calculator Developer & Online Math Educator Last updated April 24, 2026

Geometric Mean Calculator

Formulas Used in Geometric Mean Calculator

Geometric mean = √(a × b)
Altitude theorem: h² = p × q

In-Depth Tutorial: Geometric Mean Calculator

The geometric mean of two positive numbers a and b is √(a × b) — the square root of their product. It is the "multiplicative average" of two values, in contrast to the arithmetic mean (sum / count). The geometric mean appears in three important places: multiplicative growth problems (compound interest, scale factors), the right triangle altitude theorem (the altitude to the hypotenuse is the geometric mean of the two hypotenuse segments), and as the middle term of a 3-term geometric sequence. This tutorial covers all three.

The definition

For two positive numbers a and b:

Geometric mean = √(a × b)

Note: a and b must both be positive (or both negative — but the result of √(negative × negative) is the same as positive ones). Geometric mean of mixed-sign numbers is undefined for real values.

Arithmetic mean vs geometric mean

For two positive numbers, the geometric mean is always less than or equal to the arithmetic mean (the AM-GM inequality):

√(a × b) ≤ (a + b) / 2, with equality only when a = b.

This is one of the foundational inequalities in mathematics. Equality only when the two numbers are equal (e.g. both = 5: GM = √25 = 5, AM = (5+5)/2 = 5).

Worked example 1 — basic GM

Geometric mean of 4 and 9: GM = √(4 × 9) = √36 = 6.

Compare arithmetic mean: AM = (4 + 9) / 2 = 6.5. GM < AM, as expected.

Notice 4, 6, 9 form a 3-term geometric sequence with common ratio 6/4 = 1.5 and 9/6 = 1.5. The geometric mean of the first and last term is the middle term.

The right triangle altitude theorem

This is where the geometric mean shines in geometry. In a right triangle with the right angle at vertex C, draw the altitude from C to the hypotenuse. This altitude divides the hypotenuse into two segments — call them p (adjacent to one leg) and q (adjacent to the other).

Then three Geometric Mean relationships hold simultaneously:

  1. Altitude: h = √(p × q). The altitude is the geometric mean of the two hypotenuse segments.
  2. Leg 1 (length a): a = √(p × c), where c = p + q is the full hypotenuse. The leg is the geometric mean of its adjacent segment and the whole hypotenuse.
  3. Leg 2 (length b): b = √(q × c). Same as above for the other leg.

These three relationships are the right triangle altitude theorem, sometimes called the "geometric mean theorem" or "Euclid's theorem" (Proposition II.14 of his Elements).

Worked example 2 — altitude theorem

Right triangle ABC with right angle at C. The altitude from C to hypotenuse AB meets AB at point D, dividing AB into segments AD = 4 and DB = 9.

Altitude CD = √(4 × 9) = √36 = 6.

Leg AC = √(4 × 13) = √52 ≈ 7.21. (Here c = 4 + 9 = 13.)

Leg BC = √(9 × 13) = √117 ≈ 10.82.

Verify with Pythagorean: AC² + BC² = 52 + 117 = 169 = 13² = c². ✓

Why does the altitude theorem work?

The altitude from the right angle creates three similar triangles: the original right triangle, and two smaller right triangles formed inside it. All three are similar by AA (each shares the right angle plus another angle from the original).

Corresponding sides of similar triangles are proportional. The altitude theorem expresses these proportionalities in geometric-mean form.

Worked example 3 — geometric sequence middle term

What number, when inserted between 8 and 50, forms a 3-term geometric sequence?

The middle term is the geometric mean: GM = √(8 × 50) = √400 = 20.

Verify: 8, 20, 50 has ratio 20/8 = 2.5 and 50/20 = 2.5. ✓ Geometric sequence with common ratio 2.5.

The geometric mean of n numbers

The two-number case generalizes. For n positive numbers x₁, x₂, ..., xₙ:

GM = (x₁ × x₂ × ... × xₙ)^(1/n) — the nth root of the product.

For 3 numbers: GM = ∛(x₁ × x₂ × x₃). For 4 numbers: GM = ⁴√(x₁ × x₂ × x₃ × x₄). And so on.

The geometric mean has units the same as the values (not units²), unlike the geometric mean from the altitude theorem.

Real-world applications

  • Compound annual growth rate (CAGR). When growth rates differ year to year, the "average annual growth rate" is the geometric mean, not the arithmetic mean. A stock that grows 20% one year and 10% the next has an average growth of √(1.2 × 1.1) ≈ 14.89%, not (20 + 10)/2 = 15%.
  • Photography. The "average" of two f-stops (which are multiplicative) uses geometric mean. f/2.0 and f/8.0 have a geometric average of √(2 × 8) = f/4.0.
  • Aspect ratios. Standard photographic and screen aspect ratios are often geometric means of common ratios (e.g. ISO 216 paper sizes use √2 as the consistent length-to-width ratio).
  • Engineering — load testing. Endurance test cycles use geometric means to characterize fatigue ratings.

When to use GM vs AM

Use AM when...Use GM when...
Quantities add linearlyQuantities multiply / compound
Averaging measurementsAveraging ratios or rates
Test scores, temperatures, agesGrowth rates, scale factors, ratios
Linear physical quantitiesMultiplicative physical quantities

Common mistakes

  • Using AM where GM is needed. For multiplicative quantities (interest rates, growth factors), arithmetic averaging gives the wrong "average". GM is correct.
  • Computing geometric mean of negatives. GM = √(a × b) requires a × b > 0. With mixed signs, the result is imaginary and meaningless in real-world contexts.
  • Confusing the altitude theorem variants. Three different geometric means apply (altitude, leg 1, leg 2). Make sure you use the right one for the value you want: h uses both segments; a leg uses one segment and the full hypotenuse.
  • Forgetting GM ≤ AM. This is a useful sanity check — if your GM exceeds your AM, you computed something wrong.

Frequently Asked Questions – Geometric Mean Calculator

The geometric mean of two numbers a and b is √(a × b). It represents the multiplicative middle value, unlike the arithmetic mean (a + b) / 2.

By the Geometric Mean Altitude Theorem, the altitude to the hypotenuse h satisfies h² = p × q, where p and q are the two segments the altitude creates on the hypotenuse.

For ratios, proportions, and multiplicative growth — such as scale factors, similarity ratios, and compound interest.

Yes — free and unlimited.

Why it's called the "geometric" mean

The name traces directly to a compass-and-straightedge construction known since antiquity. Given two segments of lengths a and b, the geometric mean √(a·b) isn't just an algebraic expression — it's a length you can physically draw.

The construction: place the two segments end-to-end on a horizontal line, total length a + b. Construct a semicircle whose diameter is this combined segment. Now draw a vertical line at the join between a and b; extend it upward until it meets the semicircle. The vertical's length, from the diameter to the semicircle, is exactly √(a·b). Three classical Euclidean tools (compass, straightedge, perpendicular) and you have the geometric mean as a concrete drawable length.

The proof uses similar triangles. The vertical chord and the two diameter pieces form three right triangles, all similar to each other (because every triangle inscribed in a semicircle with the diameter as hypotenuse is a right triangle — Thales's theorem). From the proportionality of corresponding sides: a / vertical = vertical / b, so vertical² = a·b, giving vertical = √(a·b). The geometric mean's name records this property: it's the mean defined by a geometric proportion, not by addition.

The construction matters in pre-calculator history because it gave artisans, surveyors, and astronomers a way to compute square roots and proportional means without arithmetic. Renaissance mathematicians like Cardano used variations of this construction to extract square roots geometrically before decimal arithmetic became standard.

The two right-triangle theorems built on the geometric mean

The geometric mean shows up twice in right-triangle geometry, each as a named theorem.

The Geometric Mean Altitude Theorem. When you drop an altitude from the right-angle vertex of a right triangle to the hypotenuse, the altitude divides the hypotenuse into two segments. The altitude's length is the geometric mean of those two segments. If the segments have lengths p and q, the altitude h satisfies h² = p · q, so h = √(p · q). This is exactly the semicircle construction redrawn inside a right triangle.

The Geometric Mean Leg Theorem. Each leg of the right triangle is the geometric mean of the hypotenuse and the hypotenuse segment adjacent to that leg. If leg a sits next to hypotenuse segment p, then a² = c · p, where c is the full hypotenuse. Same for the other leg: b² = c · q. Adding these gives a² + b² = c(p + q) = c² — which is the Pythagorean theorem in disguise. The geometric mean theorems are an alternative derivation of Pythagoras.

Both theorems are direct consequences of the three similar triangles created when an altitude is dropped from the right angle. The configuration is sometimes called "Euclid's three-similar-triangles picture" because it appears prominently in Book VI of the Elements. Worked example: a right triangle with hypotenuse 13 and an altitude that divides the hypotenuse into segments of 4 and 9. The altitude is √(4 · 9) = √36 = 6. The legs are √(13 · 4) = √52 ≈ 7.21 and √(13 · 9) = √117 ≈ 10.82. Verify with Pythagoras: 7.21² + 10.82² ≈ 52 + 117 = 169 = 13². The numbers all match.

The geometric mean beyond geometry

What's the AM-GM inequality and why is it important?

For any two positive numbers a and b, the arithmetic mean is always at least as large as the geometric mean: (a + b)/2 ≥ √(a · b), with equality only when a = b. This is the AM-GM inequality, one of the most-used inequalities in all of mathematics. It generalizes to any number of positive values: the arithmetic mean of any positive list is always at least the geometric mean, with equality only when all values are equal. Concrete example: for a = 4, b = 9: arithmetic mean is 6.5, geometric mean is 6. The inequality says arithmetic ≥ geometric always, and the gap (here 0.5) measures how "spread out" the values are. AM-GM appears constantly in optimization problems, economics, information theory, and proofs of more advanced inequalities.

When does the financial world use the geometric mean instead of the arithmetic mean?

Whenever growth rates are compounded over time. If an investment grows by 50% one year and loses 50% the next, the arithmetic mean of the two returns is 0% — but the investment actually ends at 1.5 × 0.5 = 0.75, or 25% below where it started. The geometric mean of the growth factors (√(1.5 × 0.5) = √0.75 ≈ 0.866) gives an annualized return of −13.4%, which correctly captures the actual outcome. The Compound Annual Growth Rate (CAGR) is exactly the geometric mean of the per-period growth factors, minus 1. The calculator on this page is set up for two-value geometric means; for multi-period CAGR work, you'd extend to the n-th root of the product of n growth factors.

Can the geometric mean be defined for negative numbers?

Not directly, and trying produces ambiguity. √(−4 · −9) = √36 = 6 looks fine, but the geometric mean of −4 and 9 would need √(−36), which is not a real number. For data sets that include negative values, the geometric mean simply isn't applicable — you'd instead use the arithmetic mean, the median, or transform the data first (e.g., add a constant to make everything positive, take the geometric mean, then subtract the constant from the result). The calculator returns an error for non-positive inputs because there's no consistent real-valued geometric mean for negative or zero values.

For more than two numbers, what's the formula?

The geometric mean of n positive numbers x₁, x₂, ..., xₙ is the n-th root of their product: (x₁ · x₂ · ... · xₙ)^(1/n). For three numbers 2, 4, 8: geometric mean = (2 · 4 · 8)^(1/3) = 64^(1/3) = 4. For four numbers, take the fourth root, and so on. In practice, geometric means of long lists are computed by taking the logarithm of each value, averaging the logs (arithmetic mean), and exponentiating the result — this avoids the numerical overflow that direct multiplication can cause when the product gets very large. The two-value version on this page uses the simpler √(a · b) form because no special numerical handling is needed for just two inputs.