Free Perimeter Calculator

Pick a shape — square, rectangle, triangle, circle, or parallelogram — enter its measurements, and this calculator returns the perimeter instantly while showing the exact formula it used.

Choose a shape, enter its measurements, and get the perimeter with the formula used.

Formula: P = 4s

Perimeter (P)
P = 4s20

Quick answer

The perimeter is the total distance around the outside of a 2D shape. The formula depends on the shape: square P = 4s, rectangle P = 2(l + w), triangle P = a + b + c, parallelogram P = 2(a + b), and for a circle the perimeter is the circumference C = 2πr. For example, a square with side 5 has perimeter 4 × 5 = 20, and a circle with radius 7 has circumference 2 × π × 7 ≈ 43.98.

Formula & method

Select a shape from the dropdown. The calculator shows only the inputs that shape needs and the matching formula. Each value is read from its field, parsed as a number, and checked to be greater than zero (a side or radius of zero or less has no real shape). The perimeter is then computed live with the shape's formula: square P = 4s, rectangle P = 2(l + w), triangle P = a + b + c, parallelogram P = 2(a + b), and circle C = 2πr using the full-precision Math.PI. The triangle case also checks the triangle inequality — each side must be shorter than the sum of the other two — and warns if the three lengths cannot form a triangle. Results are displayed to six significant figures for readability, but the underlying computation keeps full floating-point precision.

Examples

Example 1: Square
Input
Shape = Square, s = 5
Result
P = 20
Why
A square has four equal sides, so the perimeter is 4 × s = 4 × 5 = 20.
Example 2: Rectangle
Input
Shape = Rectangle, l = 5, w = 3
Result
P = 16
Why
A rectangle has two lengths and two widths, so P = 2 × (l + w) = 2 × (5 + 3) = 2 × 8 = 16.
Example 3: Circle (circumference)
Input
Shape = Circle, r = 7
Result
C ≈ 43.9823
Why
The perimeter of a circle is its circumference C = 2πr = 2 × π × 7 = 14π ≈ 43.98230.
Example 4: Triangle
Input
Shape = Triangle, a = 3, b = 4, c = 5
Result
P = 12
Why
A triangle's perimeter is just the sum of its three sides: 3 + 4 + 5 = 12. These sides also satisfy the triangle inequality (3 + 4 > 5), so they form a valid triangle.
Example 5: Parallelogram
Input
Shape = Parallelogram, a = 6, b = 4
Result
P = 20
Why
A parallelogram has two pairs of equal sides, so P = 2 × (a + b) = 2 × (6 + 4) = 2 × 10 = 20.

When to use this tool

  • Buying fencing, edging, trim, or weatherstripping where you need the total length around a yard, garden bed, room, or window.
  • Geometry and math homework that asks for the perimeter or circumference of a square, rectangle, triangle, circle, or parallelogram.
  • Estimating framing, ribbon, baseboard, or border material needed to wrap around the outside of an object.
  • Quickly checking a shape's outline measurement when you only know its side lengths or radius and want the formula shown for your work.

Common mistakes

  • Confusing perimeter with area. Perimeter is the distance around the edge (a length, in units like cm), while area is the space inside (in square units like cm²). For a 5 × 3 rectangle the perimeter is 16, but the area is 15.
  • Using the diameter instead of the radius in the circle formula. C = 2πr expects the radius; if you have the diameter d, either use C = πd or first divide by two (r = d / 2).
  • Adding only two sides of a triangle, or assuming all triangles are equilateral. You must add all three actual side lengths: a + b + c.
  • Entering three triangle sides that cannot form a triangle, such as 1, 2, and 10. Each side must be shorter than the sum of the other two (the triangle inequality).
  • Mixing units before adding. If one side is in meters and another in centimeters, convert them to the same unit first or the perimeter will be meaningless.

Frequently asked questions

What is perimeter?

Perimeter is the total distance around the outside edge of a two-dimensional shape. You find it by adding up the lengths of all the sides. For a circle, the equivalent measurement is called the circumference. Perimeter is always a length, measured in units such as centimeters, meters, or inches.

What is the formula for the perimeter of a rectangle?

A rectangle's perimeter is P = 2(l + w), where l is the length and w is the width. Add the length and width, then double the result. For example, a rectangle that is 5 by 3 has a perimeter of 2 × (5 + 3) = 16.

How do I find the perimeter of a circle?

A circle's perimeter is called its circumference, given by C = 2πr where r is the radius. If you know the diameter d instead, you can use C = πd. For a radius of 7, C = 2 × π × 7 ≈ 43.98. This calculator uses the full-precision value of π.

What is the difference between perimeter and area?

Perimeter measures the distance around a shape's boundary and is expressed in linear units like meters. Area measures the flat space enclosed inside the shape and is expressed in square units like square meters. A 4 × 4 square has a perimeter of 16 and an area of 16, but the matching units (16 m versus 16 m²) are different.

How do I calculate the perimeter of a triangle?

Add the lengths of all three sides: P = a + b + c. For a triangle with sides 3, 4, and 5, the perimeter is 3 + 4 + 5 = 12. The three lengths must satisfy the triangle inequality — each side shorter than the sum of the other two — to form a real triangle.

Why does the calculator reject zero or negative values?

A side length or radius must be positive for a shape to exist. A value of zero or less has no real geometric meaning, so the calculator asks for numbers greater than zero before it computes a perimeter.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the perimeter calculator to appear: