ToolNimba Browse

📐 Perimeter Calculator

By ToolNimba Math Team · Updated 2026-06-19

Perimeter
Choose a shape and enter its dimensions.

The perimeter is the total distance around the outside of a flat shape, the length you would walk if you traced its edge once and returned to the start. This calculator handles the five shapes you meet most often: rectangle, square, triangle, circle and regular polygon. Pick a shape, enter its dimensions, and you get the perimeter (or circumference, for a circle) along with the exact formula and the working, so you can see how the answer was reached.

What is the Perimeter Calculator?

Perimeter measures the boundary of a two-dimensional shape. For any shape made of straight sides, the perimeter is simply the sum of the side lengths, you just add them up. That single idea gives every polygon formula: a rectangle has two lengths and two widths, so its perimeter is 2 x (l + w); a square has four equal sides, so 4 x s; a triangle is a + b + c; and a regular polygon with n equal sides of length s is n x s. Each formula is just a shortcut for adding the sides.

The circle is the special case. It has no straight sides, so instead of a perimeter we talk about its circumference, the distance once around the edge. That distance is always 2 x pi x r, where r is the radius and pi (about 3.14159) is the fixed ratio of any circle's circumference to its diameter. Because pi is irrational, a circle's circumference is almost never a tidy whole number, which is why circle answers usually carry decimals.

The most important thing to get right is units. Perimeter is a length, so it is measured in the same one-dimensional units as the sides: centimetres, metres, inches, feet, and so on, never square units (those are for area). Every measurement you enter must be in the same unit before you add them, and the answer comes out in that unit. The optional unit label in this tool just stamps your chosen unit onto the result so the output reads naturally.

When to use it

  • Working out how much fencing, edging or trim you need to go around a garden, room or picture frame.
  • Checking homework or exam answers for rectangle, triangle and circle perimeter questions.
  • Finding the circumference of a circular table, pool or wheel from its radius.
  • Measuring the length of skirting board, baseboard or ribbon to run around the edge of a shape.

How to use the Perimeter Calculator

  1. Choose the shape you are measuring from the dropdown.
  2. Enter the required dimensions (sides, radius, or number of sides and side length).
  3. Optionally type a unit label such as cm, m, in or ft to show on the result.
  4. Click Calculate perimeter to see the perimeter (or circumference), the formula and the full working.

Formula & method

Rectangle: P = 2 x (l + w). Square: P = 4 x s. Triangle: P = a + b + c. Circle (circumference): C = 2 x pi x r. Regular polygon: P = n x s, where n is the number of sides and s is the side length.

Worked examples

A rectangle that is 8 cm long and 5 cm wide.

  1. Add the length and width: l + w = 8 + 5 = 13
  2. A rectangle has two of each side, so double it: 2 x 13 = 26

Result: Perimeter = 26 cm

A triangle with sides of 3, 4 and 5 metres.

  1. Check the sides can form a triangle: each is shorter than the sum of the other two (3 + 4 > 5).
  2. Add all three sides: 3 + 4 + 5 = 12

Result: Perimeter = 12 m

A circle with a radius of 7 inches.

  1. Use C = 2 x pi x r with pi ≈ 3.14159265
  2. C = 2 x 3.14159265 x 7
  3. C = 43.982 (rounded to 3 decimals)

Result: Circumference ≈ 43.98 in

A regular hexagon (6 equal sides) with each side 5 cm.

  1. A regular polygon perimeter is n x s, with n the number of sides.
  2. P = 6 x 5 = 30

Result: Perimeter = 30 cm

Perimeter and circumference formulas by shape

ShapeInputsFormula
Rectanglelength l, width wP = 2 x (l + w)
Squareside sP = 4 x s
Trianglesides a, b, cP = a + b + c
Circleradius rC = 2 x pi x r
Regular polygonsides n, side length sP = n x s

Perimeter of a regular polygon with side length 5 units

PolygonSides (n)Perimeter (n x 5)
Equilateral triangle315
Square420
Pentagon525
Hexagon630
Octagon840

Common mistakes to avoid

  • Using square units for a perimeter. Perimeter is a length, so it is measured in plain units like cm or m, never square units like cm². Square units are for area. If your answer has a small 2 on the unit, you have measured the wrong thing.
  • Mixing units before adding. You cannot add 30 cm to 1 m directly. Convert every measurement to the same unit first (1 m = 100 cm), then add. Forgetting this gives an answer that is wildly too small or too large.
  • Using diameter instead of radius for a circle. The formula C = 2 x pi x r needs the radius, which is half the diameter. If you measured straight across the circle you have the diameter, so either halve it first or use C = pi x diameter instead.
  • Applying n x s to an irregular shape. The shortcut n x s only works when every side is the same length (a regular polygon). For a shape with sides of different lengths, you must add up each individual side.

Glossary

Perimeter
The total length of the boundary of a flat shape, found by adding up all its side lengths.
Circumference
The perimeter of a circle, the distance once around its edge, equal to 2 x pi x r.
Radius
The distance from the centre of a circle to its edge, half the diameter.
Regular polygon
A polygon whose sides are all equal in length and whose angles are all equal, such as a square or a regular hexagon.
Pi
The constant ratio of a circle's circumference to its diameter, approximately 3.14159.

Frequently asked questions

What is the perimeter of a shape?

The perimeter is the total distance around the outside of a two-dimensional shape. For shapes with straight sides you find it by adding the lengths of all the sides. For a circle the equivalent measure is the circumference.

How do I find the perimeter of a rectangle?

Add the length and the width, then double the result: P = 2 x (l + w). For example, a rectangle 8 by 5 has a perimeter of 2 x (8 + 5) = 26 in the same units as the sides.

What is the formula for the circumference of a circle?

The circumference is C = 2 x pi x r, where r is the radius and pi is about 3.14159. If you know the diameter instead, you can use C = pi x diameter, since the diameter is twice the radius.

How do I calculate the perimeter of a triangle?

Add the lengths of all three sides: P = a + b + c. The three lengths must be able to form a real triangle, meaning each side is shorter than the sum of the other two.

What is the perimeter of a regular polygon?

Because every side of a regular polygon is the same length, the perimeter is simply the number of sides times the side length: P = n x s. A regular hexagon with 5 cm sides has a perimeter of 6 x 5 = 30 cm.

What units does perimeter use?

Perimeter is a length, so it uses one-dimensional length units such as millimetres, centimetres, metres, inches or feet, the same unit as the sides you entered. It is never measured in square units, which describe area.