ForHosting KIT · Math

Geometric mean of two numbers

Get the multiplicative middle of two positive numbers: the geometric mean of 4 and 9 is 6, the square root of their product 36. It always lies between the smaller and the larger value. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
A
4
B
9
You get
Product
36
Geometric mean
6

The geometric mean of two positive numbers is the square root of their product: for values a and b it is exactly the length that turns a and b into a geometric proportion, and it always sits between the smaller and the larger of the two when both are positive. Algebra courses introduce it next to the arithmetic mean so students can see why growth factors, similar-triangle side ratios, and constant-proportion problems prefer a multiplicative center rather than a plain average. This geometric mean of two numbers calculator accepts two strictly positive finite inputs, multiplies them, takes the principal square root, and returns the cleaned geometric mean together with the product and a short formula string.

What the geometric mean of two numbers means

Given two strictly positive real numbers a and b, their geometric mean is defined as the square root of the product a times b. Geometrically, if you draw a right triangle with altitude to the hypotenuse that splits the hypotenuse into segments of lengths a and b, the altitude length is exactly the geometric mean of those segments—a classical Euclidean theorem that still appears in secondary-school geometry.

Algebraically the same quantity is the unique positive m such that a over m equals m over b, so m squared equals a b and m equals the principal square root of a b. That proportion view explains why textbooks pair the two-number geometric mean with similar triangles, constant-ratio scaling, and successive growth factors.

Unlike the arithmetic mean (a plus b) over two, the geometric mean is scale-fair on a multiplicative axis: if you double both numbers the geometric mean doubles, and if one factor is a growth rate like 1.05 and the other is 1.20 the geometric mean recovers the constant per-step factor that compounds to the same product.

When a equals b the geometric and arithmetic means coincide; when a and b differ, the geometric mean is strictly smaller than the arithmetic mean by the AM-GM inequality, with equality only in the equal case. This calculator implements exactly that two-argument definition and does not accept a free-length list—students searching for the geometric mean of two numbers get a focused contract with fields a and b rather than a statistics-style array of arbitrary length.

Where a two-number geometric mean calculator earns its keep

Exam-prep generators and LMS plugins need a fixed two-field contract so item templates map directly onto a and b without parsing comma lists. Finance notebooks sometimes compare two-period compound factors and want the constant geometric growth rate as a single square-root step before moving to longer multiperiod lists. Curriculum authors ranking for geometric mean of two numbers calculator benefit from a dedicated landing whose free browser path matches the paid automation path on the same pure module.

Content sites that already host a general n-value geometric mean tool still win a distinct long-tail query when learners type the textbook phrase for exactly two numbers and expect fields labeled a and b rather than an open data array.

Exam keys and LMS auto-grading

Mark two-number geometric mean items with a deterministic oracle that rejects zero and negatives instead of returning NaN.

Two-period growth factors

Recover the constant compound factor between two positive relative growth multipliers as a single square-root geometric mean step.

How do I compute the geometric mean of two numbers?

Send two strictly positive finite numbers a and b.

What happens if a or b is negative?

The real geometric mean is defined only for positive factors; negative inputs are rejected and not billed.

How is this different from a general geometric mean of n numbers?

This capability is fixed to exactly two inputs and the square-root formula √(a×b). A general n-value geometric mean uses the n-th root of a product list and is a separate search intent and landing.

Why is the geometric mean of 4 and 9 equal to 6?

Their product is 36 and its square root is 6. It also forms a proportion: 4 is to 6 as 6 is to 9, which is what makes 6 the geometric middle.

How is it different from the ordinary average?

The ordinary average adds the two numbers and halves the sum. The geometric mean multiplies them and takes the square root, which suits growth factors and problems built on constant proportions.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/geometric-mean-two-numbers

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/geometric-mean-two-numbers \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":4,"b":9}'
{
  "a": 4,
  "b": 9
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.geometric_mean_two_numbers",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Zero and negative values are rejected with a clear invalid_input error instead of NaN or a complex root.

Input contract, response shape, and validation rules

The rejection of non-positive inputs matches the real square-root domain: a negative product would leave the real line, and a zero factor would force a zero mean that silently hides bad data in growth and ratio problems. POST a JSON object with two required fields named a and b. Each must be a finite number strictly greater than zero; JSON numbers and numeric strings are both accepted. Missing fields, empty strings, non-numeric tokens, NaN, Infinity, zero, and any negative value fail with invalid_input and are not billed. On success the response echoes cleaned a and b, the product a times b when that product remains finite in float64 (or null if the linear product overflows), the scalar geometric_mean as the principal square root of the product, and a short formula string GM(a,b)=√(a·b). Successful API calls cost the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where a two-number geometric mean calculator earns its keep

Algebra and geometry classrooms constantly assign drills that ask for the geometric mean of two positive lengths, growth factors, or similar-triangle segments; a deterministic oracle that returns cleaned JSON speeds grading and live demos without pulling a full computer-algebra system. Keep a and b positive and finite, pin the rounded geometric_mean in tests, and you get reproducible roots for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.

Algebra homework and geometric-mean drills

Let students submit positive a and b and verify that √(a×b) matches the textbook geometric mean, including equal-value and classic 4-and-9 fixtures.

Is zero allowed?

No. Zero is not greater than zero, so a or b equal to zero is rejected with invalid_input rather than returning a zero mean that hides bad data.

What does the geometric mean of two numbers calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →