How to use the perimeter calculator
- Choose the shape. For an irregular shape, pick Any polygon and type every side length separated by commas, for example 5, 7, 4, 6, 3.
- Enter the side lengths. Decimals are fine. Choose a unit if your problem has one — make sure every side uses the same unit.
- Read the perimeter, the formula and the steps. The diagram labels each side so you can check nothing was missed.
What is perimeter?
The perimeter of a shape is the total length of its boundary — how far you would walk if you went once all the way around the edge. The word comes from Greek: peri (around) and metron (measure). Perimeter is a length, so it is measured in ordinary units such as cm, m, in or ft, never in square units.
For any shape with straight sides the rule is always the same: add up all the sides. The formulas below are just shortcuts for shapes where some sides are equal.
Perimeter formulas
| Shape | Formula | Why |
|---|---|---|
| Rectangle | P = 2 × (l + w) | two lengths and two widths |
| Square | P = 4 × s | four equal sides |
| Triangle | P = a + b + c | three sides |
| Circle | C = 2 × π × r | the circumference |
| Parallelogram | P = 2 × (a + b) | opposite sides are equal |
| Trapezoid | P = a + b + c + d | four different sides |
| Regular polygon | P = n × s | n equal sides |
| Any polygon | P = sum of all sides | the definition |
Worked examples
Rectangle. A garden is 8 m long and 5 m wide. How much fencing goes around it?
P = 2 × (8 + 5) = 2 × 13 = 26 m.
Regular hexagon. Each side is 4 cm.
P = 6 × 4 = 24 cm.
Irregular pentagon. The sides are 5, 7, 4, 6 and 3 ft.
P = 5 + 7 + 4 + 6 + 3 = 25 ft.
Circle. The radius is 5 in.
C = 2 × π × 5 = 10π ≈ 31.4159 in.
Can these sides really make a shape?
Not every set of lengths closes up into a shape. For a triangle, the longest side must be shorter than the other two put together — the triangle inequality. Sides 2, 3 and 10 cannot make a triangle, because the two short sides cannot reach each other across a gap of 10. The same idea applies to every polygon: the longest side must be shorter than the sum of all the others. The calculator checks this and warns you if your numbers describe an impossible shape, which usually means a typing mistake or a misread diagram.
Finding a missing side first
Many homework problems hide one of the sides:
- Right triangles: if you know two sides, find the third with the Pythagorean theorem calculator, then add all three.
- Shapes on a coordinate grid: find each side length with the distance calculator.
- L-shapes and other rectilinear figures: opposite sides must add up to the same total, so a missing horizontal side is the difference between the horizontal sides you know.
- Working backwards: if a rectangle has perimeter 30 and length 9, then 2 × (9 + w) = 30, so 9 + w = 15 and w = 6.
Perimeter and area are different things
Perimeter is the distance around a shape; area is the space inside it. Fencing, picture frames, ribbon around a cake and skirting boards are perimeter problems. Carpet, paint, grass seed and tiles are area problems — use the area calculator for those. Two shapes can have the same perimeter and very different areas: a 1 × 9 rectangle and a 5 × 5 square both have perimeter 20, but their areas are 9 and 25.
Frequently asked questions
How do I find the perimeter of a rectangle?
Add the length and the width, then double the result: P = 2 × (l + w). A rectangle 8 by 5 has perimeter 2 × 13 = 26.
How do I find the perimeter of a triangle?
Add the three side lengths: P = a + b + c. A triangle with sides 5, 6 and 7 has a perimeter of 18.
What is the perimeter of a circle called?
It is called the circumference. Use C = 2πr with the radius or C = πd with the diameter. A circle of radius 5 has circumference 10π ≈ 31.42.
How do I find the perimeter of an irregular shape?
Measure every side and add the lengths together. Choose “Any polygon” in the calculator and type the sides separated by commas.
What is the difference between perimeter and area?
Perimeter is the distance around a shape, measured in units such as cm. Area is the surface inside the shape, measured in square units such as cm².
How do I find a side length from the perimeter?
Reverse the formula. For a square, divide the perimeter by 4. For a rectangle, halve the perimeter and subtract the side you know: a perimeter of 30 with length 9 gives a width of 15 − 9 = 6.