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
Run — free
Worked example
- Radius
- 5
- 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.
What you can do with it
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.
FAQ
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.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/circle-diameter \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"radius":5}'const res = await fetch("https://api.kit.forhosting.com/math/circle-diameter", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"radius": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/circle-diameter",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"radius": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/circle-diameter", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"radius":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"radius":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/circle-diameter", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"radius": 5
}Example response
{
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
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.
Integration use cases
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.
Technical questions
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.