Circle measurements
One radius, three answers: a circle with a radius of 5 has a diameter of 10, a circumference of 31.415927 and an area of 78.539816. Useful for quoting tabletops, lawns or round panels without three separate formulas. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Radius
- 5
- Area
- 78.539816
- Circumference
- 31.415927
- Diameter
- 10
area, circumference and diameter from radius
From one radius to three measurements
Every circle is fully described by a single number, its radius, and every other measurement of the circle is a fixed multiple of it. The diameter is simply the radius doubled. The circumference — the distance you would walk to go around the circle once — is two times pi times the radius.
The area — the surface the circle encloses — is pi times the radius squared. Because the three values come from the same input in the same pass, they are always mutually consistent: the diameter is exactly twice your radius, and the circumference and area follow from it exactly, with no intermediate rounding between the formulas. You can also control how many decimal places each result is rounded to, from zero up to twelve, using the optional decimals parameter.
Validation, rounding and determinism
The radius must be a number, it must be finite, and it must be greater than zero. The same strictness applies to the optional decimals parameter, which must be an integer between zero and twelve. Rounding uses round-half-up at the requested number of decimal places rather than the platform's default float formatting, which matters more than it sounds: raw floating-point results like 0.1 + 0.2 differ in their last digits depending on how they are displayed, and an unstabilised output would make automated comparisons flaky.
With deterministic half-up rounding, the same radius always produces byte-identical output, on any machine, at any time, which is what makes the result safe to store, diff and cache.
Where it fits in real work
Circles appear in more places than geometry homework. A workshop cutting circular tabletops needs the area to estimate material and the circumference to order edge banding. A landscaper pricing a circular lawn needs the area for turf and the perimeter for fencing.
An engineer sizing a pipe or a shaft converts between radius, diameter and cross-sectional area constantly.
What you can do with it
Quote materials for circular parts
Get the area of a circular tabletop, panel or disc from its radius to estimate material, and the circumference to price edging or trim in the same call.
Validate dimensions in a configurator
Check a user-entered radius before accepting an order, rejecting zero, negative or non-numeric values with a clear error instead of a broken downstream calculation.
Teach the three circle formulas
Show students how diameter, circumference and area change together as the radius changes, with results that round identically on every machine.
FAQ
What input does it need?
Just the radius of the circle, as a positive finite number. Optionally, a decimals parameter (0 to 12) controlling the rounding of the results.
What exactly is returned?
An object with three fields: area, circumference and diameter, each rounded half-up to the requested number of decimal places.
Which value of pi is used?
The double-precision value of pi provided by the runtime (Math.PI), so results match standard scientific and engineering calculations.
Can I choose how many decimals I get?
Yes, anywhere from zero to twelve. Each result is rounded half-up to that number of places, so the same radius always gives exactly the same figures on any device.
Why do the three results always agree with each other?
Because all three come from the same radius in one pass, with no rounding between the formulas. The diameter is exactly twice the radius, and the circumference and area follow from it.
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-measurements \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"radius":5}'const res = await fetch("https://api.kit.forhosting.com/math/circle-measurements", {
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-measurements",
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-measurements", 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-measurements", 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_measurements",
"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
The circle measurements API takes a single number — the radius of a circle — and returns the three measurements every geometry task eventually asks for: the area enclosed by the circle, the circumference around it, and the diameter across it. One call replaces three separate formula lookups, each result is rounded to a configurable number of decimal places, and the computation is exact arithmetic on double-precision numbers, so the answer you get in the browser is the same answer your automated pipeline gets from the API.
From one radius to three measurements
This endpoint applies those three formulas to the radius you send and returns all three results together in one object, so a caller never has to remember which formula squares the radius and which one doubles it.
Validation, rounding and determinism
The endpoint is deliberately strict about its input. A zero or negative radius does not describe a circle, and a non-numeric value describes nothing at all, so both are rejected with a clear invalid_input error that tells you exactly which rule was broken — and rejected requests are never billed.
Where it fits in real work
In software, the endpoint works well as a small deterministic step inside a larger pipeline: a quoting tool that prices round parts, a configurator that validates dimensions before an order is accepted, or a teaching application that shows students how the three formulas move together when the radius changes. It runs on the edge with nothing stored after the call, the same code runs free in the browser on this page, and the API costs $0.002 per request, so you can prototype by hand and only pay once you automate the call.
Technical questions
What does it cost?
$0.002 per request. It is also free to run in your browser on this page.
What happens if the radius is zero, negative or not a number?
The request is rejected with an invalid_input error explaining the rule that was broken. Rejected requests are not billed.
Is anything stored after the call?
No. The computation is done in memory and only the three measurements are returned.