ForHosting KIT · Math

Circle diameter calculator

Get a circle's diameter from whichever measurement you have: a radius of 5 gives 10, and a tape wrapped around the edge that reads 31.4159 also gives 10 across. You can start from the area as well. 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
Radius
5
You get
Diameter
10
Given
radius

The circle diameter calculator takes any single measurement of a circle — its radius, its circumference or its area — and returns the diameter, the longest straight line that fits inside the circle and passes through its center. It is the kind of conversion that comes up constantly in machining, plumbing, design and schoolwork: the part you measured is rarely the dimension the drawing, the catalogue or the formula actually asks for. One call, one deterministic result, nothing stored.

Why the diameter is the dimension everyone asks for

Specifications, drill charts, pipe schedules and product listings almost always quote a circle by its diameter, because the diameter is what a caliper reads when you close it on a round object. Yet the measurement you actually have in hand is often something else. You wrapped a tape around a tank and got its circumference.

You computed a floor area from a floor plan. You know the radius because a compass or a CAD sketch gave you half the width. In every one of those cases the missing number is the same: twice the radius.

The circle diameter calculator exists to close that gap without a scratch calculation, a calculator app or a formula you half remember. You send exactly one of the three measurements — radius, circumference or area — and you receive the diameter, rounded to the number of decimal places you ask for.

How the three conversions work

All three paths reduce to the same constant, pi. From a radius, the diameter is simply the radius multiplied by two, the definition itself. From a circumference, the diameter is the circumference divided by pi, since a circle's perimeter is pi times its width; a 31.4159 unit tape measure reading comes back as ten units across.

From an area, the diameter is twice the square root of the area divided by pi, because the area of a circle is pi times the radius squared — a 78.5398 unit surface comes back as the same ten units across. Each input must be a positive finite number: zero, negative values, NaN and infinities are rejected with a clear error and are never charged.

The result is rounded half-up to the requested number of decimals, six by default, so the answer is stable and identical on every machine and in the free browser version on this page, which runs the very same code.

Where a diameter lookup earns its keep

A fabrication script that receives a coil circumference from a supplier feed can convert it to the diameter the cutting plan expects, inline, without shipping a geometry library. A homework-checking tool can verify a student's radius-to-diameter step with a trusted reference instead of reimplementing it. A data-cleaning job can normalize a column of mixed circular measurements into one diameter column before joining tables.

Convert a tape-measure circumference

You measured around a pipe or tank with a tape; send the circumference and get the diameter the fitting catalogue quotes.

Recover the diameter from a known area

A floor plan or a land record gives you the area of a circular surface; convert it to the width you need to plan around.

Which inputs does it accept?

Exactly one of radius, circumference or area, as a positive finite number. Sending more than one, or none, returns an error and is not charged.

What happens with zero or a negative value?

Only positive finite numbers are valid measurements of a circle.

How accurate is the result?

The conversion uses double-precision pi and rounds half-up to the decimals you request — six by default, up to twelve.

Does it handle units like inches or millimetres?

The calculation is unit-agnostic: the diameter comes back in the same unit as the radius, circumference or area you sent.

Why can't I enter two measurements at once?

Because two numbers that disagree would force the calculator to pick one silently, and that is how wrong parts get ordered. Enter only the radius, the circumference or the area, whichever you actually measured.

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/math/circle-diameter

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/math/circle-diameter \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"radius":5}'
{
  "radius": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.circle_diameter",
  "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.

Why the diameter is the dimension everyone asks for

The endpoint refuses ambiguous requests that carry more than one measurement, because silently picking one of two conflicting numbers is how wrong parts get ordered.

Where a diameter lookup earns its keep

The endpoint is deliberately small, and that is what makes it useful inside larger flows. Because it is deterministic and stateless, it caches perfectly and costs $0.002 per call with nothing else attached — no units field, no locale quirks, no hidden state.

Normalize mixed circle data in a pipeline

A feed carries radius for some records and circumference for others; call the endpoint per record and store one uniform diameter column.

What does it cost?

$0.002 per request. It is also free to run in your browser on this page.

Is anything stored?

No. The request is processed in memory and discarded; only the diameter is returned.

Read the full KIT documentation →