The perimeter is the total length of the boundary of a flat shape — the distance you would walk if you went once around its edge. It is what you need to buy fencing for a garden, skirting board for a room, trim for a tablecloth or edging for a flower bed, and it is one of the first formulas met in geometry lessons.
This perimeter calculator covers 11 shapes: square, rectangle, triangle from its three sides, circle, semicircle, ellipse, parallelogram, trapezoid, rhombus from its diagonals, regular polygon and circular sector. Choose the shape, type the lengths in millimetres, centimetres, metres, kilometres, inches, feet, yards or miles, and read the perimeter in whichever unit you prefer.
It also checks your data. Three lengths that cannot close into a triangle, or four sides that cannot make a trapezoid, are rejected with an explanation instead of returning a meaningless number. For the trapezoid it also gives the height; for the rhombus, the side; for the sector and semicircle, the length of the arc alone. The ellipse perimeter, which has no elementary formula, is computed exactly with the arithmetic-geometric mean and compared with Ramanujan's famous approximation.
The surface inside the shape is another matter: for that, use the area calculator, and for everything about circles, the circle calculator.
How to use this calculator
- Pick the shape from the list.
- Enter the requested lengths. Each field has its own unit menu, so you may mix centimetres and metres; everything is converted before the calculation.
- For a sector, enter the central angle in degrees; for a regular polygon, the number of sides and one side length.
- Read the perimeter at the top and switch its display unit if needed. Extra results (arc, height, side, semi-perimeter) appear below it.
- Open the steps to see the formula with your numbers.
The formula
| Shape | Perimeter |
|---|---|
| Square, side | |
| Rectangle | |
| Triangle, sides | (valid only if each side is less than the sum of the other two) |
| Parallelogram, sides | |
| Trapezoid, bases , legs | |
| Rhombus, diagonals | |
| Regular polygon, sides of length | |
| Circle, radius | |
| Semicircle | |
| Sector, angle in degrees |
Ellipse with semi-axes : the exact perimeter is , where is the complete elliptic integral of the second kind and . The calculator evaluates it with the arithmetic-geometric mean, which converges in a handful of steps. Ramanujan's second approximation is shown for comparison:
For the trapezoid height, the calculator forms the triangle with sides , and and divides twice its area by .
Worked example
Garden fence. A rectangular plot of 8 m by 5 m needs m of fencing (minus the width of any gate).
Triangle. Sides of 7, 8 and 9 cm give a perimeter of 24 cm and a semi-perimeter of 12 cm.
Isosceles trapezoid. Bases of 12 and 6 with legs of 5: , and the height is 4 (a 3-4-5 right triangle hides at each end).
Rhombus. Diagonals of 6 and 8: each side is , so the perimeter is 20.
Semicircle and sector. With a radius of 2 m, a semicircular window has an arc of 6.28 m and a full outline of 10.28 m. A 60° slice of the same circle has an arc of 2.09 m and a perimeter of 6.09 m.
Ellipse. With semi-axes 5 and 3, the exact perimeter is 25.526999; Ramanujan's formula gives 25.526999. For a much flatter ellipse, 10 by 1, the exact value is 40.639742 and the approximation 40.639272.
Perimeter of a circle, semicircle and sector
The perimeter of a circle is usually called its circumference: , about 6.283 times the radius. A semicircle is not just half of that. Its boundary is half the circumference plus the straight diameter, . Forgetting the diameter is the classic error when ordering trim for an arched window.
A sector (a slice of pie) works the same way: the arc plus two radii. A 90° sector of radius 1 m has an arc of 1.571 m and a perimeter of 3.571 m. At 360° the two radii merge and only the circumference remains.
Why the ellipse is harder
An ellipse has a simple area, , but no elementary formula for its perimeter. The exact value is an elliptic integral, studied by Euler, Legendre and Gauss. Gauss's arithmetic-geometric mean gives it to full precision after five or six iterations, which is what this calculator uses. Ramanujan's 1914 approximation remains popular for hand calculation: it is essentially exact for ordinary ellipses and stays within about 0.04 % even for an extremely flat one. The simpler rough guess can be off by several percent and is best avoided.
Perimeter versus area
Perimeter is a length (m, ft); area is a surface (m², sq ft). They do not grow together: a 1 × 9 rectangle and a 5 × 5 square both have a perimeter of 20, but areas of 9 and 25. Among all rectangles with a given perimeter, the square encloses the most area, and among all shapes, the circle does. Doubling every length doubles the perimeter but multiplies the area by four.
Frequently asked questions
How do I calculate the perimeter of a rectangle?
Add the length and the width and double the result: P = 2(L + W). An 8 m by 5 m rectangle has a perimeter of 26 m.
How do I find the perimeter of a triangle?
Add the three sides: P = a + b + c. The lengths must satisfy the triangle inequality — each side shorter than the sum of the other two — otherwise no triangle exists, and the calculator tells you so.
What is the perimeter of a semicircle?
Half the circumference plus the diameter: P = πr + 2r. For a radius of 2 m that is about 10.28 m, of which 6.28 m is the curved arc.
How accurate is the ellipse perimeter?
The main result is computed exactly (to machine precision) with the arithmetic-geometric mean. Ramanujan’s approximation is shown next to it: its error is negligible for most ellipses and below about 0.04 % even for very flat ones.
How do I find the perimeter of a regular polygon?
Multiply the number of sides by the side length: P = n × s. A regular hexagon with 2 cm sides has a perimeter of 12 cm.
Do I need the height to find the perimeter of a trapezoid?
No. The perimeter is simply the sum of the four sides. The calculator works the other way round: from the four sides it also deduces the height, when such a trapezoid exists.
Sources
- OpenStax, Prealgebra 2e, §9.4: Rectangles, Triangles and Trapezoids
- NIST Digital Library of Mathematical Functions, §19.8: Arithmetic-geometric mean
- NIST DLMF, §19.9: Perimeter of an ellipse and Ramanujan’s approximation
Last updated: