Circumference calculator
The circumference calculator takes the diameter of a circle and returns the length of its boundary, using the exact relationship C = pi * d.
Run — free
You send one number, you get one number back, in the same unit you started with: give it millimetres and the answer is in millimetres, give it miles and the answer is in miles. There is no rounding policy to configure and no hidden approximation beyond the double-precision value of pi baked into every modern runtime, so the result is deterministic and reproducible anywhere. The same code that runs on our edge runs free in your browser, which means the free web tool and the paid API never disagree. Use it for parts, wheels, rings, pipes, tracks and anything else whose size you know across the middle and whose perimeter you need.
Why diameter and not radius
Most formulas you met at school write the circumference as two pi r, built on the radius. In the workshop and the field, though, almost nobody measures a radius directly: you measure across the circle with a caliper, a tape or a laser, because the diameter is the dimension you can actually touch. The circumference calculator is built around that reality. It accepts the diameter exactly as measured and multiplies it by pi, which is algebraically identical to the two pi r form but skips the division by two that introduces one more place to make a mistake. If you happen to hold a radius instead, double it before calling, or use a radius-based tool. If you hold the circumference and want the diameter back, that inverse problem belongs to a different capability. Keeping one input and one job makes the contract trivial to test: a positive finite number goes in, the boundary length comes out, and anything else — zero, a negative value, a missing field, a string that is not a number — is rejected as invalid input before any arithmetic happens.
How the number is computed
The computation is one multiplication: the diameter, validated as a positive finite number, times Math.PI, the double-precision constant available in every JavaScript engine. There is no series expansion, no lookup table and no iterative approximation, so the answer cannot drift between runs, between servers or between the browser and the API. The result is then rounded to six decimal places before it is returned. That rounding is a deliberate stability choice, not a precision claim: raw floating-point multiplication can produce a last-digit wobble across CPUs, and a stored golden example compared byte to byte would fail on a different machine for a reason that has nothing to do with correctness. Six decimals is far beyond what any physical measurement of a diameter justifies — a caliper good to a hundredth of a millimetre constrains the circumference far more than pi does. Units pass through untouched: the tool never converts, so whatever unit your diameter carries is the unit of the answer, and converting units beforehand is your call.
Where it fits in real work
Single-value geometry sounds trivial until it sits inside a pipeline that consumes thousands of measurements. A cutting station that turns diameter readings into belt or strip lengths, a quoting tool that prices circular material by perimeter, a fit-check that compares a measured shaft against a tolerance band expressed as a circumference — all of them call this endpoint as a deterministic step they never have to reimplement or re-test. Because the capability is a pure parse worker with no network calls, no secrets and no shared state, it behaves identically under one request or ten thousand, and its cost is a flat $0.002 per request with no per-unit surcharge. The free browser version runs the same module, so an engineer can sanity-check a value by hand before wiring the API into production and trust that both paths return the same number. Input that is not a positive finite number fails with an invalid input error and is not charged, which makes the endpoint safe to expose directly to untrusted form submissions.
What you can do with it
Cut material to wrap a cylinder
Turn a measured pipe or drum diameter into the exact strip length needed to wrap it once, before the saw starts.
Price circular parts by perimeter
Feed diameters from a parts list into a quoting pipeline that bills gaskets, rings and seals by boundary length.
Check a wheel or pulley spec
Verify that a wheel's stated diameter implies the rollout distance a drivetrain or odometer expects.
FAQ
What does it cost?
$0.002 per request, with no per-unit surcharge. It is also free in the browser, running the exact same code.
What input does it accept?
A single field, diameter, as a positive finite number or a numeric string. Zero, negatives, non-numbers and missing values are rejected as invalid input.
What unit is the result in?
The same unit as the diameter you sent. The tool never converts units; it only multiplies by pi.
How accurate is the result?
It uses the double-precision value of pi and rounds to six decimal places, far beyond the accuracy of any physical diameter measurement.
Can I pass the radius instead?
This capability takes the diameter only. Double the radius first, or use a radius-based circle calculator from the catalogue.
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 \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"diameter":10}'const res = await fetch("https://api.kit.forhosting.com/math/circumference", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"diameter": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/circumference",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"diameter": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/circumference", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"diameter":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"diameter":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/circumference", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"diameter": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.circumference",
"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. |