What this calculator does
Perimeter is the total distance around the outside edge of a flat shape, and the formula for it depends entirely on which shape you are measuring. This calculator covers the five shapes people most often need: rectangles, squares, circles (where perimeter is usually called circumference), triangles from their three sides, and regular polygons of any number of sides.
The reason there is no single perimeter formula is that each shape's boundary is built differently: a rectangle has two pairs of equal straight sides, a circle has no straight sides at all, and a triangle just adds up whatever three lengths it happens to have. Pick the shape below and the right formula for it is applied automatically.
The formula
Each shape uses its own rule. A rectangle sums both pairs of opposite sides: 2(a+b). A square multiplies one side by four. A circle's perimeter, its circumference, is 2πr. A triangle simply adds its three sides together, once they pass the check that any two sides must be longer than the third. A regular polygon with n equal sides multiplies the side length by n.
| Term | Meaning |
|---|---|
| Perimeter | The total length of the boundary of a two-dimensional shape. |
| Circumference | The specific name for the perimeter of a circle: 2πr. |
| Semiperimeter | Half the perimeter, a quantity used in formulas such as Heron's formula for triangle area. |
The inputs explained
| Field | What to enter |
|---|---|
| Shape | Which shape to measure. The fields below take on different meanings depending on this choice. |
| Side a / length / radius (see shape) | Length (rectangle), side (square or regular polygon), radius (circle), or one side (triangle). |
| Side b / width (rectangle & triangle only) | Width (rectangle) or a second side (triangle only). Not used for the other shapes. |
| Side c (triangle only) | The third side of a triangle. Not used for the other shapes. |
| Number of sides (regular polygon only) | The number of sides of a regular polygon. Not used for the other shapes. |
When to use it
Working out fencing or edging needed
Fencing, skirting board and edging are all sold by length, so the perimeter of the area being enclosed is the starting figure for how much material to order.
Checking a homework answer
Switching the shape selector between rectangle, triangle and polygon on the same page confirms which formula to use for how to calculate perimeter without hunting through separate references.
Comparing shapes of a similar size
Shapes with the same rough footprint can have noticeably different perimeters, which matters when the boundary itself, not the area inside it, is what costs money.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How does a rectangle's perimeter grow as one side lengthens?
A rectangle with a fixed 6-unit width, as its length grows.
| Length | Perimeter | Semiperimeter (half the perimeter) |
|---|---|---|
| 4 | 20.000 | 10.000 |
| 6 | 24.000 | 12.000 |
| 8 | 28.000 | 14.000 |
| 10 | 32.000 | 16.000 |
| 15 | 42.000 | 21.000 |
| 20 | 52.000 | 26.000 |
How does perimeter compare across shapes of a similar size?
The same measurement of 10, applied as the defining length of each shape.
| Shape | Perimeter | Shape used |
|---|---|---|
| Rectangle | 40.000 | Rectangle |
| Square | 40.000 | Square |
| Circle | 62.832 | Circle (circumference) |
| Triangle | 30.000 | Triangle |
| Regular polygon | 60.000 | Regular 6-sided polygon |
Questions
What is the perimeter formula?
There is no single formula; it depends on the shape. A rectangle uses 2(length + width), a square uses 4 × side, a circle's circumference uses 2πr, and an irregular polygon or triangle is simply the sum of all its side lengths.
How do I find the perimeter of a shape with unequal sides?
Add every side length together. That works for any polygon, regular or not, as long as every side has been measured; there is no shortcut formula once the sides are not all equal.
Is circumference the same thing as perimeter?
Yes. Circumference is just the name reserved specifically for the perimeter of a circle, because a circle has no straight sides to sum; the underlying idea, the total distance around the shape, is identical.
Why does the triangle option reject some combinations of sides?
Three lengths only form a real triangle if each pair of sides adds up to more than the third side (the triangle inequality). If that check fails the three lengths cannot be closed into a triangle at all, so no perimeter exists to calculate.
For a triangle's area alongside its perimeter, see the triangle from three sides calculator. For a circle's area and diameter as well as its circumference, see the circle calculator.