# What is the perimeter?

Finds the perimeter of a square, rectangle, triangle, circle (its circumference), regular polygon, or any polygon from its side lengths, with the formula worked out.

- Page: https://www.acalculator.org/math/perimeter-calculator
- JSON spec: https://www.acalculator.org/math/perimeter-calculator.json
- Version: 059874a6375b

## Default answer

Example with the default inputs (Shape Rectangle or parallelogram, Length 32, Width 20): The perimeter is 104.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| shape | Shape | The shape whose perimeter you want. |
| a | Side a | The length of one side. |
| l | Length | The length of the rectangle (or one side of the parallelogram). |
| w | Width | The width of the rectangle (or the other side of the parallelogram). |
| b | Side b | The length of the second side. |
| c | Side c | The length of the third side. |
| r | Radius | The distance from the centre to the edge: half the diameter. |
| n | Number of sides | How many equal sides the regular polygon has, from 3 to 1,000. |
| s | Side length | The length of each side of the regular polygon. |
| sides | Side lengths | The length of every side, in order, separated by commas: 3 to 100 sides. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| perimeter | Perimeter | The total length around the shape, in the unit of the lengths you typed. |
| formula | Working | The formula with your numbers. |
| diameter | Diameter | For a circle: twice the radius. |

## Method

Square P = 4a; rectangle or parallelogram P = 2L + 2W; triangle P = a + b + c; circle C = 2πr; regular polygon P = n × s; any polygon P = the sum of its sides.

## Assumptions

- Lengths are in any one unit; the perimeter is in the same unit.
- A triangle’s longest side must be shorter than the other two together; a polygon’s longest side shorter than all the others together.
- The circumference uses π to double precision, not 3.14.

## Worked examples

1. shape = rectangle, l = 32, w = 20 gives perimeter = 104, formula = P = 2L + 2W = 2 × 32 + 2 × 20 = 104. Source: OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (P = 2L + 2W, P = a + b + c; Example 9.27: a 32 m by 20 m rectangle has P = 104 m), https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-02).
2. shape = triangle, a = 4, b = 9, c = 11 gives perimeter = 24. Source: OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (P = 2L + 2W, P = a + b + c; Example 9.27: a 32 m by 20 m rectangle has P = 104 m), https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-02).
3. shape = circle, r = 2 gives perimeter = 12.566371, diameter = 4. Source: OpenStax, Prealgebra 2e, §9.5 Solve Geometry Applications: Circles and Irregular Figures (C = 2πr = πd; Example 9.42: a 4 ft diameter gives C ≈ 12.56 ft with π ≈ 3.14), https://openstax.org/books/prealgebra-2e/pages/9-5-solve-geometry-applications-circles-and-irregular-figures (retrieved 2026-10-02).
4. shape = square, a = 31 gives perimeter = 124. Source: OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (P = 2L + 2W, P = a + b + c; Example 9.27: a 32 m by 20 m rectangle has P = 104 m), https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-02).
5. shape = regular, n = 6, s = 4 gives perimeter = 24, formula = P = n × s = 6 × 4 = 24. Source: OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (P = 2L + 2W, P = a + b + c; Example 9.27: a 32 m by 20 m rectangle has P = 104 m), https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-02).
6. shape = polygon, sides = 10 or 6 gives perimeter = 25, formula = P = 10 + 6 + 4 + 5 = 25. Source: OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (P = 2L + 2W, P = a + b + c; Example 9.27: a 32 m by 20 m rectangle has P = 104 m), https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-02).

## FAQ

### What is a perimeter?

The total length of the edges around a flat shape: how much fence goes around a yard, or trim around a picture. It is a length, so it is measured in inches, feet, or meters, not square units.

### How do I find the perimeter of a rectangle?

Add twice the length and twice the width: P = 2L + 2W. A rectangle 32 m long and 20 m wide has P = 64 + 40 = 104 m. A parallelogram works the same way with its two side lengths.

### How do I find the perimeter of a triangle?

Add the three sides: P = a + b + c. Sides of 4, 9 and 11 ft give 24 ft. The longest side must be shorter than the other two added together, or the sides do not meet.

### What is the perimeter of a circle?

It is called the circumference: C = 2πr, or π times the diameter. A table 4 ft across (radius 2 ft) has C = 4π ≈ 12.57 ft. With π rounded to 3.14 you get 12.56 ft.

### How do I find the perimeter of a trapezoid or another polygon?

Add the lengths of all its sides. Pick “Any polygon” and type every side, such as 10, 6, 4, 5 for a trapezoid: the perimeter is 25.

### 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 4 cm sides has P = 6 × 4 = 24 cm.

### What is the difference between perimeter and area?

Perimeter is the length around a shape; area is the space inside it, in square units. A 32 m by 20 m rectangle has a perimeter of 104 m and an area of 640 m².

## Sources

- OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (P = 2L + 2W, P = a + b + c; Example 9.27: a 32 m by 20 m rectangle has P = 104 m; Example 9.34: sides 4 ft and 9 ft with P = 24 ft leave 11 ft). https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-02)
- OpenStax, Prealgebra 2e, §9.5 Solve Geometry Applications: Circles and Irregular Figures (C = 2πr = πd; Example 9.42: a 4 ft diameter gives C ≈ 12.56 ft with π ≈ 3.14). https://openstax.org/books/prealgebra-2e/pages/9-5-solve-geometry-applications-circles-and-irregular-figures (retrieved 2026-10-02)
