On this page
If you pick up a dice, a prism from a physics lab, or a triangular pyramid, you can easily count its corners, its flat sides and the straight lines where those sides meet. But there is a hidden mathematical law that links these three numbers, no matter how complicated the shape becomes.
What is Euler's formula for 3D polyhedra?
Euler's formula states that for any convex polyhedron, the number of vertices (V), minus the number of edges (E), plus the number of faces (F) will always equal 2. This rule applies to any 3D shape with flat polygonal faces, straight edges, and no dents or holes.
Leonhard Euler introduced this concept for convex polyhedra in 1758, making it one of the foundational ideas of topology. If you imagine a convex polyhedron made of rubber, you could inflate it until it becomes a perfect sphere. Because of this, mathematicians say that any convex polyhedron has an Euler characteristic of 2.
How to predict V − E + F for a cube, a prism and a pyramid
Counting the parts of a 3D shape is the best way to see Euler's formula in action. Here is how to test the formula on three common polyhedra.
The Cube (Hexahedron): A cube has 8 corners, or vertices (V = 8). It has 12 straight edges (E = 12) and 6 square faces (F = 6). Plugging these into the formula gives 8 − 12 + 6, which equals 2.
The Triangular Prism: A triangular prism, like a glass prism used in optics, has two triangular bases and three rectangular sides. This gives it 6 vertices (V = 6), 9 edges (E = 9) and 5 faces (F = 5). Calculating 6 − 9 + 5 confirms the result is 2.
The Square Pyramid: A square pyramid has a square base and four triangular sides meeting at an apex. It has 5 vertices (V = 5), 8 edges (E = 8) and 5 faces (F = 5). The sum 5 − 8 + 5 is exactly 2.
You can practise picturing complex 3D shapes like a dodecahedron in the Fermi Simulation Lab, where interactive tools make it easier to count vertices and edges by spinning the shape in space.
A framework for finding the vertices, edges and faces of any shape
If you need to quickly find the V, E and F of a large shape in an exam, you do not have to count every single line. Instead, you can use the number of sides on the shape's base (n) to predict the rest.
For any pyramid with an n-sided base:
Vertices (V): The base has n corners, plus one apex at the top. So, V = n + 1.
Faces (F): The base is 1 face, and there are n triangular faces meeting at the apex. So, F = n + 1.
Edges (E): The base has n edges, and there are n edges rising to the apex. So, E = 2n.
Check Euler's formula: (n + 1) − 2n + (n + 1) = 2.
For any prism with an n-sided base:
Vertices (V): There is a top base and a bottom base, each with n corners. So, V = 2n.
Faces (F): There are 2 bases (top and bottom), plus n rectangular sides. So, F = n + 2.
Edges (E): There are n edges on the top base, n edges on the bottom base, and n vertical edges connecting them. So, E = 3n.
Check Euler's formula: 2n − 3n + (n + 2) = 2.
Using this framework, if you are given a decagonal prism (a prism with a 10-sided base), you immediately know n = 10. It will have 20 vertices, 30 edges, and 12 faces, and 20 − 30 + 12 perfectly equals 2.
What happens to Euler's formula if the shape has a hole?
Euler's original formula only works for convex shapes. If a 3D object has a hole passing all the way through it — like a donut or a coffee mug — the rule changes. In topology, this kind of shape is known as a torus, and the number of holes it has is called its genus (g).
For a surface with holes, the formula is adjusted to include the genus: V − E + F = 2 − 2g. If you have a polyhedron shaped like a torus, it has exactly one hole (g = 1). Plugging 1 into the new formula gives 2 − 2(1) = 0. Therefore, for any torus-shaped polyhedron, the number of vertices minus edges plus faces will always equal 0.
Why is counting in 3D so important?
Euler's formula is a topological invariant, meaning it does not care about the lengths of the edges or the angles of the corners. You can stretch, squash, or twist a cube into any other convex shape, and the relationship between V, E, and F will not break.
This idea opened the door to modern topology and geometry. Studying the properties of shapes that remain unchanged under deformation is a powerful mathematical tool. You can read more about how mathematicians explore these concepts in our post on Maryam Mirzakhani and the geometry of surfaces, explained simply.
If you are preparing for exams and need to tackle combinatorics, learning how to track points and lines is essential. You can find strategies for this in our guide on Counting triangles, diagonals and lines from points for JEE. Furthermore, if you are struggling to map out these shapes, Fermi's AI tutor can build a session plan for you, drawing figures and helping you work through the geometry step by step.



