acalculator

What is the perimeter?

Pick a shape and type its sides, or the radius of a circle. The perimeter calculator adds up the distance around it and shows the formula with your numbers. The answer is in the same unit as your lengths.

Your numbers

Perimeter
104

The perimeter is 104.

Working
P = 2L + 2W = 2 × 32 + 2 × 20 = 104

Perimeter: 104. The perimeter is 104.

How to calculate

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.

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

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.

  • 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.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Shape Rectangle or parallelogram, Length 32, Width 20 gives Perimeter 104, Working 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, Side a 4, Side b 9, Side 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 (circumference), Radius 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, Side 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 polygon, Number of sides 6, Side length 4 gives Perimeter 24, Working 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 Any polygon (all sides), Side lengths 10, 6, 4, 5 gives Perimeter 25, Working 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)

How it works

ShapePerimeter
Square with side aP = 4a
Rectangle (length L, width W), or parallelogram with sides L and WP = 2L + 2W
Triangle with sides a, b, cP = a + b + c
Circle with radius rC = 2πr (the diameter is 2r)
Regular polygon with n sides of length sP = n × s
Any polygon with sides s₁, s₂, …, sₖP = s₁ + s₂ + … + sₖ

All sums are in double-precision floating point, and π is Math.PI (3.141592653589793). OpenStax’s Prealgebra 2e is used because Algebra and Trigonometry 2e has no perimeter section.

Rules

  • Every length is more than 0 and at most 10¹² (any one unit). A regular polygon has 3 to 1,000 sides; any polygon has 3 to 100 sides, each more than 0.
  • A triangle needs its longest side shorter than the sum of the other two; otherwise there is no answer. Any polygon needs its longest side shorter than the sum of all the others; otherwise there is no answer.
  • A polygon perimeter beyond the largest double-precision number has no answer.

Output format. The perimeter and diameter are numbers in the unit typed. The working shows each number to 10 significant digits, for example “P = 2L + 2W = 2 × 32 + 2 × 20 = 104”, “C = 2πr = 2 × π × 2 = 12.56637061”, or “P = 10 + 6 + 4 + 5 = 25”.

Worked examples by hand

Rectangle 32 by 20. P = 2 × 32 + 2 × 20 = 64 + 40 = 104.

Triangle 4, 9, 11. P = 4 + 9 + 11 = 24 (11 < 4 + 9 = 13, so it is a triangle).

Circle with radius 2 (a 4 ft table). C = 2 × π × 2 = 4π ≈ 12.566371; the diameter is 4.

Square with side 31. P = 4 × 31 = 124.

Regular hexagon with side 4. P = 6 × 4 = 24.

Trapezoid with sides 10, 6, 4, 5. P = 10 + 6 + 4 + 5 = 25 (10 < 6 + 4 + 5 = 15).

Other questions people ask

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².