Circumference and area of a circle
One radius gives you both numbers a round object needs: a radius of 5 has a circumference of 31.415927 and an area of 78.539816. Useful for fencing a circular paddock, estimating its seed or sizing a wheel. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Radius
- 5
- Circumference
- 31.415927
- Area
- 78.539816
- Pi
- 3.1415926536
Both values come back rounded half-up to a configurable number of decimals, together with the π constant used, so the response is deterministic and can be compared byte for byte. It is the classic geometry pair computed in one deterministic call instead of two separate lookups, with no unit ambiguity: whatever unit the radius is in, the circumference is in that same unit and the area is in that unit squared.
Two formulas, one radius
A circle is fully described by a single measurement. Once you know the radius, everything else follows: the circumference — the length of the boundary — is 2·π·r, and the area — the surface enclosed by that boundary — is π·r². There is no diameter input, no unit conversion and no hidden state — the same radius always yields the same circumference and area, which is exactly what you want from a primitive that other systems build on.
If you only have the diameter, divide it by two first; if you only have the circumference, divide by 2π. Keeping the contract to one required field means every client — a spreadsheet script, a microcontroller, a web form — can satisfy it without special cases.
How the numbers are produced
Determinism is a feature here, not an accident. The computation uses the full double-precision value of π (3.141592653589793), evaluates 2·π·r and π·r², and then rounds each result half-up to the requested number of decimals. Validation is strict on purpose.
If a radius is so large that the area overflows double precision, that too is reported as an input error instead of silently returning Infinity, so a response you receive is always a real, usable number.
Where the pair shows up in practice
The circumference–area pair appears anywhere something round is designed, priced or manufactured. A fencing quote needs the circumference of a circular paddock to total the metres of wire, and the area to estimate seed; a pizza box printer needs the area of the base and the circumference that determines the strip of cardboard wrapping it; a wheel engineer converts radius into circumference to know how far the vehicle travels per revolution, and into area for load and pressure calculations.
Because the capability is a pure function, it also works well as a teaching and testing primitive: students can check homework against it, and engineers can use it as a known-answer step inside a larger pipeline. For circles defined by something other than a radius, or for other shapes entirely, the catalogue holds companion capabilities; this one stays deliberately single-purpose.
What you can do with it
Quote fencing for a circular paddock
Total the metres of wire from the circumference and estimate grass seed from the area, both from one measured radius.
Size packaging for round products
Get the base area and the wrap-around strip length of a circular tin or pizza in a single deterministic call.
Check homework or a pipeline step
Use a known-answer, byte-stable response to verify student work or a geometry stage inside a larger computation.
FAQ
What input does it take?
A radius that must be a positive finite number, plus an optional decimals field (0–12, default 6) controlling rounding. Zero, negatives, NaN and Infinity are rejected as invalid input.
Which formulas are used?
Both results are rounded half-up to the requested number of decimals.
Can I pass a diameter or a circumference instead?
No — the contract is radius only, deliberately. Divide a diameter by two, or a circumference by 2π, before calling.
Are my requests stored?
No. The radius is processed and discarded; only the computed values are returned.
What unit is the area of a circle in?
The area comes out in the unit of the radius squared, while the circumference keeps the unit of the radius. A radius in metres gives the boundary in metres and the area in square metres.
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/circumference-area-circle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"radius":5}'const res = await fetch("https://api.kit.forhosting.com/math/circumference-area-circle", {
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/circumference-area-circle",
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/circumference-area-circle", 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/circumference-area-circle", 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.circumference_area_circle",
"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 circumference and area of a circle API takes a single number — the radius — and returns the two quantities almost everyone actually needs: the distance around the circle, 2·π·r, and the surface it encloses, π·r². It runs free in your browser on this page, and costs $0.002 per request when you call it through the API.
Two formulas, one radius
This endpoint applies both formulas to the same radius and returns the pair in one response, so a caller never has to compute one value and then wonder whether the other was derived with a different rounding of π or a different precision. The request is deliberately small: a <code>radius</code> field that must be a positive finite number, and an optional <code>decimals</code> field between 0 and 12 that controls rounding, defaulting to 6. That is the whole contract.
How the numbers are produced
Zero, negative numbers, NaN and Infinity are rejected with an <code>invalid_input</code> error, as are non-numeric radii and out-of-range decimals. Rejected requests are never billed — the error code is what decides whether a call costs anything, and input errors are always the caller's side.
Where the pair shows up in practice
It runs on our global edge with nothing stored after the call, and the very same code runs free in your browser on this page, so you can verify a value by hand and only pay — $0.002 per request — when 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 — the same code produces both results.
Do I get billed when my input is rejected?
Never. Input validation errors carry the invalid_input code, which means the call is not charged.