Sphere calculator
Enter a sphere's radius and get its diameter, equatorial circumference, surface area and volume at once: a radius of 1 gives a surface of 12.5663706144 and a volume of 4.1887902048. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Radius (r)
- 1
- Diameter
- 2
- Circumference
- 6.2831853072
- Sphere surface area
- 12.5663706144
- Sphere volume
- 4.1887902048
Given a positive sphere radius, compute diameter, equatorial circumference, surface area and volume using Math.PI with round10 outputs.
Four measurements from one radius
Everything about a sphere follows from its radius. The diameter is twice the radius and the equatorial circumference is 2π times the radius. The surface area is 4π times the radius squared, and the volume is four thirds of π times the radius cubed. With a radius of 1 that gives a diameter of 2, a circumference of 6.2831853072, a surface of 12.5663706144 and a volume of 4.1887902048, all rounded to ten decimals. Because all four come from the same input, they always agree with each other.
Getting the units right
The results come out in the units you used: a radius in centimetres gives a surface in square centimetres and a volume in cubic centimetres, so convert before mixing the figures with others. Doubling the radius doubles the diameter and the circumference, multiplies the surface by four and the volume by eight, which is why small measuring errors grow quickly in the volume. The calculation is deterministic, so the same radius always gives the same numbers, a quick way to check a formula result without opening a spreadsheet.
What you can do with it
Engineering quick checks
Validate a formula result without a spreadsheet.
FAQ
Is it free?
Yes. Tier A runs in your browser without an account.
Rounding?
Half-away-from-zero to 10 decimal places on numeric outputs.
Why is it called the equatorial circumference?
Because it is measured around the widest circle of the sphere, the one that would be the equator on a globe. It equals π times the diameter, which for a radius of 1 is 6.2831853072.
Can I start from the diameter or the volume?
Only the radius goes in. If you measured the diameter, halve it first; if you only know the volume or the surface area, the radius has to be found from it before using this calculator.
Which values are rejected?
Zero, negative numbers and anything that is not a number are rejected before any arithmetic. A radius so large that a result would overflow is refused too, instead of returning a meaningless figure.
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/dev/sphere \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"r":1}'const res = await fetch("https://api.kit.forhosting.com/dev/sphere", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"r": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/sphere",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"r": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/sphere", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"r":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"r":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/sphere", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"r": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.sphere",
"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
How it works
Given a positive sphere radius, compute diameter, equatorial circumference, surface area and volume using Math.PI with round10 outputs. Inputs are validated before arithmetic. The calculation is fully deterministic and runs free in your browser with the same pure function as the API path. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results.
Inputs and outputs
Required fields must be present and correctly typed. Optional fields use documented defaults. Success payloads always include the primary output fields for stable UI binding. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results.
Edge cases and limits
Wrong types, zero or negative values where forbidden, and overflow to non-finite results become clear invalid_input errors instead of silent null or NaN fields. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results. Additional detail covers validation order, deterministic rounding, browser and API parity, stable error matches for certification, and safe handling of non-finite floating results.
Integration use cases
Homework and teaching
Check classic examples with stable golden fixtures.
Automation
Same pure function in the free widget and the API.
Technical questions
Does it call the network?
No. Pure parse on-device.
What if input is invalid?
invalid_input with a clear stable match string.
Author?
samurai.