Skip to content
CalcTide logo
Education & Math

Perimeter Calculator

A square with 5-unit sides has a perimeter of 20, and a circle with a 7-unit radius has a circumference of 43.9823. This perimeter calculator finds the distance around five common shapes: a square, a rectangle, a triangle, a circle, and a regular polygon. Pick the shape that matches your problem, enter its side lengths or radius, and the calculator applies the correct formula automatically, including a validity check for triangles. Perimeter is one of the first geometry concepts most people meet in school, and it stays useful well past the classroom. Fencing a yard, framing a picture, trimming a garden bed, hemming fabric, and laying edge molding around a room all depend on knowing the exact distance around a shape. Because each shape uses a different formula, this tool switches the required inputs the moment you change the shape, so you never have to remember five separate equations.

Education & MathBy

Quick answer

A square's perimeter is 4 times the side length, since all four sides are equal.

What this tells you

  • A square's perimeter is 4 times the side length, since all four sides are equal.
  • A rectangle's perimeter is 2 times the sum of the length and width, because opposite sides match in pairs.
  • A triangle's perimeter is the sum of its three sides, but only if the three lengths can actually form a triangle.
  • A circle does not have straight sides, so its perimeter is called the circumference, equal to 2 times pi times the radius.
  • A regular polygon's perimeter is the number of sides times the length of one side, since every side is identical.
  • Every input must be a positive number. Negative, zero, or non-numeric values return no result.

How to Use

  1. 1Select the shape you are measuring: square, rectangle, triangle, circle, or regular polygon.
  2. 2Enter the side length for a square, or the length and width for a rectangle.
  3. 3For a triangle, enter all three side lengths. The calculator confirms the three lengths form a valid triangle before computing the perimeter.
  4. 4For a circle, enter the radius. The calculator also reports the equivalent diameter for reference.
  5. 5For a regular polygon, enter the whole number of sides (at least 3) and the length of one side.
  6. 6Read the perimeter result along with the formula breakdown showing exactly how the number was calculated.

How It Works

Formula

Square: P = 4s. Rectangle: P = 2(l + w). Triangle: P = a + b + c. Circle: C = 2*pi*r. Regular polygon: P = n*s.

Each shape has its own perimeter rule based on how many sides it has and whether those sides are equal. A square has four equal sides, so multiplying one side by 4 gives the full distance around it. A rectangle has two pairs of equal sides, so doubling the sum of the length and width covers all four edges. A triangle has three sides that can differ from each other, so the perimeter is a simple sum, but the three lengths must satisfy the triangle inequality: each side must be shorter than the sum of the other two, or the shape cannot physically close. A circle has no straight sides at all, so its boundary length is called the circumference and is found by multiplying the radius by 2 and by pi, since the ratio of a circle's circumference to its diameter is always pi. A regular polygon, such as a pentagon or hexagon, has n equal sides, so multiplying the number of sides by one side's length gives the total perimeter directly.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

Square with a 5-unit side

ShapeSquare
Side5
ResultPerimeter = 20

4 x 5 = 20, since all four sides of a square are equal.

Rectangle 8 by 3

ShapeRectangle
Length8
Width3
ResultPerimeter = 22

2 x (8 + 3) = 2 x 11 = 22.

3-4-5 right triangle

ShapeTriangle
Side A3
Side B4
Side C5
ResultPerimeter = 12, valid triangle

3 + 4 + 5 = 12. Each side is shorter than the sum of the other two, so the triangle is valid.

Circle with a 7-unit radius

ShapeCircle
Radius7
ResultCircumference = 43.9823

2 x pi x 7 = 43.9823, using pi to four decimal places of precision in the final rounding.

Regular hexagon with a 6-unit side

ShapeRegular polygon
Sides6
Side length6
ResultPerimeter = 36

6 sides x 6 units each = 36, since every side of a regular hexagon is the same length.

Perimeter Formulas by Shape

Quick reference for the formula and required inputs for each shape this calculator supports.

ShapeFormulaRequired inputs
SquareP = 4 x side1 side length
RectangleP = 2 x (length + width)2 side lengths
TriangleP = a + b + c3 side lengths
CircleC = 2 x pi x radius1 radius
Regular polygonP = sides x side lengthside count and 1 side length

Why the triangle inequality matters

Not every set of three numbers can form a real triangle. If one side is too long compared to the other two, the shorter sides cannot reach each other and the triangle collapses flat instead of closing. The triangle inequality rule states that each side must be strictly less than the sum of the other two sides. For example, 3, 4, and 5 pass the test because 3 is less than 4 plus 5, 4 is less than 3 plus 5, and 5 is less than 3 plus 4. But 1, 1, and 5 fail, since 5 is not less than 1 plus 1, and no triangle with those three side lengths can exist.

This calculator checks the triangle inequality automatically before returning a perimeter, so an invalid combination of sides never produces a misleading result. If your three measurements do not pass, double-check them, since a small measurement or entry error is the most common cause.

Try the Right Triangle Calculator

Common mistakes

  • Confusing perimeter with area. Perimeter is the distance around a shape, measured in linear units like feet or meters, while area is the space inside the shape, measured in square units.
  • Entering three triangle sides that cannot form a real triangle, such as 2, 3, and 10. The calculator flags these as invalid rather than returning a misleading total.
  • Mixing units within the same shape, such as entering a rectangle's length in feet and its width in inches. All measurements must share the same unit before you calculate.
  • Using the diameter instead of the radius for a circle without dividing by 2 first, which doubles the circumference by mistake.
  • Assuming a regular polygon formula works for an irregular polygon. The sides-times-length shortcut only applies when every side is the same length, as in a regular pentagon, hexagon, or octagon.

Embed this calculator on your site

Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.

<script src="https://calctide.com/embed.js" data-tool="perimeter-calculator" async></script>

Preview the embed at /embed/perimeter-calculator/.

Frequently Asked Questions

The formula depends on the shape. A square uses 4 times the side length, a rectangle uses 2 times the sum of length and width, a triangle uses the sum of its three sides, a circle uses 2 times pi times the radius, and a regular polygon uses the number of sides times one side's length.
Circumference is simply the name for the perimeter of a circle. Both measure the total distance around the outside of a shape, but circumference specifically applies to circles because they have no straight sides.
Add each pair of sides and compare the sum to the third side. If every side is shorter than the sum of the other two, the three lengths form a valid triangle. If any side is equal to or longer than the sum of the other two, no triangle can close.
Multiply the length of one side by 6, since a regular hexagon has six equal sides. A hexagon with a 6-unit side has a perimeter of 36.
Enter the radius directly. If you only know the diameter, divide it by 2 first, since the radius is always half the diameter.
No. It covers squares, rectangles, triangles, circles, and regular polygons where every side is equal. An irregular polygon needs its individual side lengths added together manually, since there is no single shortcut formula.
It estimates perimeter calculator outputs using the visible inputs and formula assumptions on this page.

Explore More in Education & Math