Euler's polyhedron formula calculator
A cube with 8 vertices and 12 edges must have 6 faces, so give any two counts and the third follows from Euler's rule that vertices minus edges plus faces always makes 2. Enter all three to find out whether the shape can exist. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Vertices
- 8
- Edges
- 12
- Faces
- 6
- Euler characteristic
- 2
A cube (8 vertices, 12 edges, 6 faces) checks out; a claimed shape with 5 vertices, 8 edges and 6 faces does not. It is the fastest way to validate a mesh header, a homework answer or a 3D model's topology before trusting it, done deterministically in a single call with no approximation and no external data.
What Euler's formula actually says
In 1750 Leonhard Euler observed that for every convex polyhedron — cubes, pyramids, prisms, dodecahedra, geodesic domes — the number of vertices minus the number of edges plus the number of faces always equals two. The value 2 is called the Euler characteristic of a sphere, and the formula holds because any convex polyhedron can be stretched onto a sphere without changing how its corners, sides and regions connect.
The relation is purely topological: it does not care about lengths, angles or symmetry, only about how many of each element exist. That makes it a remarkably cheap consistency check.
How the computation works
The solver is elementary algebra on integers. Given vertices and edges, faces equals E − V + 2. Given vertices and faces, edges equals V + F − 2.
Given edges and faces, vertices equals E − F + 2. Inputs must be positive integers: a polyhedron cannot have a fractional vertex or a negative edge, and non-integer or non-positive values are rejected with a clear error rather than silently rounded. If the derived third count would come out zero or negative — for example, claiming 3 vertices and 4 edges, which would imply only 3 faces but is tested the same way — the arithmetic is still exact and deterministic.
Fewer than two counts is an error, because one number alone says nothing about the shape. Everything runs in microseconds with no network access, no randomness and no clock, so the same request always returns the same answer.
Where it earns its place
Three groups reach for this check constantly. Students and teachers use it to verify answers about prisms and Platonic solids: knowing any two counts of a pentagonal prism, the third should fall out of the formula, and a mismatch means an arithmetic slip somewhere upstream. Game and 3D-graphics developers use it as a smoke test on mesh statistics — a closed manifold mesh that claims to be sphere-like must satisfy the characteristic, so a failed check flags non-manifold geometry, holes or duplicated elements before the asset ships.
And anyone designing polyhedral structures, from geodesic domes to dice, uses it in reverse: fix the faces and edges implied by the design and read off the vertex count the connectors must provide.
What you can do with it
Smoke-test a 3D mesh header
Reject sphere-like meshes whose reported counts violate the Euler characteristic, catching non-manifold geometry at import time.
Derive a missing count in a design
Given the faces and edges of a planned geodesic dome or dice shape, compute the exact number of vertices the connectors must supply.
FAQ
What happens if I only send one value?
Euler's formula relates three counts, so at least two are needed to say anything.
Does it work for non-convex polyhedra?
Shapes with holes, like a toroidal polyhedron, have a different characteristic and will correctly report valid: false.
What if my three values do not satisfy the formula?
You get valid: false together with the face count that would make the triple consistent, so you can see how far off the numbers are.
Are decimals or negative numbers accepted?
No. Vertices, edges and faces are counts, so only positive integers are accepted; anything else is rejected with a clear error message.
Is any data stored?
No. The three integers are evaluated and discarded; only the result is returned.
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/eulers-formula-for-polyhedron \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"vertices":8,"v":1}'const res = await fetch("https://api.kit.forhosting.com/math/eulers-formula-for-polyhedron", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"vertices": 8,
"v": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/eulers-formula-for-polyhedron",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"vertices": 8,
"v": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/eulers-formula-for-polyhedron", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"vertices":8,"v":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"vertices":8,"v":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/eulers-formula-for-polyhedron", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"vertices": 8,
"v": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.eulers_formula_for_polyhedron",
"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
Euler's polyhedron formula ties together the three counts that define any convex polyhedron: vertices, edges and faces always satisfy V − E + F = 2. This capability takes any two of the three counts and returns the third, or takes all three and tells you whether the triple is geometrically consistent.
What Euler's formula actually says
If someone hands you a description of a polyhedron where the counts do not satisfy V − E + F = 2, no such convex polyhedron exists, full stop. The euler's formula for polyhedron endpoint applies exactly this test: send any two counts and it derives the third by rearranging the equation, or send all three and it reports whether the equality holds, along with the face count that would make it hold.
How the computation works
When all three counts arrive, the service computes the Euler characteristic V − E + F and compares it with 2, returning a boolean verdict plus the full triple it evaluated.
Where it earns its place
The API costs $0.002 per request, and the identical code runs free in your browser on this page, so you can experiment interactively and only pay when you wire the check into a pipeline.
Integration use cases
Check homework on prisms and pyramids
Verify that the vertex, edge and face counts of a hexagonal prism or square pyramid actually satisfy V − E + F = 2 before submitting.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page.