Perimeter Calculator — Free Rectangle, Triangle, Circle & Polygon Perimeter 2026 | AllInOneTools
▱ Free Calculator

Perimeter Calculator

Calculate the perimeter of any 2D shape — rectangle, triangle, circle, square, parallelogram, trapezoid, regular polygon, or ellipse. Interactive visualization and step-by-step formulas.

Perimeter Calculator
Shape:
DIMENSIONS
Rectangle: Length & Width
Length (l)
l
Width (w)
w
📐
RESULT
Perimeter
▭ 2(l+w)| △ a+b+c| ○ 2πr| ⬡ n×s
Perimeter
--
Perimeter
--
Area
--
Shape
--
Sides
--
P/A Ratio
--
Compactness
--
Quick Reference Table
ShapeFormulaExamplePerimeter
💡 Insight

Related Math Tools

Perimeter: The Complete Guide to Every Shape

What Is Perimeter?

Perimeter is the total distance around the boundary of a two-dimensional shape. The word comes from the Greek "peri" (around) and "metron" (measure). It is measured in linear units — centimeters, meters, inches, feet, etc. — unlike area, which uses square units. Perimeter is one of the most fundamental measurements in geometry and has countless practical applications: fencing a yard, framing a picture, trimming fabric edges, building a border, or calculating the distance around a running track.

Rectangle: P = 2(l + w)
Square: P = 4s
Triangle: P = a + b + c
Circle: C = 2πr = πd
Regular Polygon: P = n × s
Parallelogram: P = 2(a + b)
Trapezoid: P = a + b + c + d
Ellipse: P ≈ π[3(a+b) − √((3a+b)(a+3b))]

Perimeter of a Rectangle

A rectangle has two pairs of equal sides. Its perimeter is P = 2(l + w), where l is the length and w is the width. This is the most commonly used perimeter formula in everyday life. For example, if you need fencing for a 30m × 20m garden, you need P = 2(30+20) = 100 meters of fencing. If you know the perimeter and one dimension, you can find the other: w = P/2 − l. Among all rectangles with a given perimeter, the square has the largest area — this is the isoperimetric property for rectangles.

Real-World Example: Fencing
A rectangular yard is 25 ft by 40 ft. Fencing costs $12/foot. How much to fence it?
P = 2(25 + 40) = 130 ft. Cost = 130 × $12 = $1,560.

Perimeter of a Triangle

The perimeter of any triangle is simply P = a + b + c, the sum of all three sides. For an equilateral triangle (all sides equal), P = 3s. For an isosceles triangle (two equal sides), P = 2a + b. If you know two sides and the included angle, you can use the Law of Cosines to find the third side: c² = a² + b² − 2ab·cos(C), then add all three for the perimeter. The triangle inequality theorem states that any side must be less than the sum of the other two: a + b > c.

Circumference of a Circle

The perimeter of a circle is called the circumference: C = 2πr = πd. This formula connects every circle's size to the constant π ≈ 3.14159. A circle with radius 10 has circumference 62.83. For a semicircle, the perimeter includes half the circumference plus the diameter: P = πr + 2r = r(π + 2). The circle has the remarkable property of enclosing the maximum area for any given perimeter — this is the classical isoperimetric inequality.

Perimeter of a Square

A square has four equal sides, so P = 4s. If you know the diagonal d, then s = d/√2, giving P = 4d/√2 = 2d√2. If you know the area A, then s = √A, giving P = 4√A. The square is the most efficient rectangle — it encloses more area per unit of perimeter than any other rectangle. This is why many containers and rooms tend toward square proportions for space efficiency.

Perimeter of a Parallelogram

A parallelogram has two pairs of equal parallel sides: P = 2(a + b), the same formula as a rectangle. However, unlike a rectangle, a parallelogram can be "slanted" — the height (perpendicular distance between parallel sides) is less than the slant side. This means two parallelograms with the same perimeter can have very different areas. A rectangle is a special parallelogram where all angles are 90°.

Perimeter of a Trapezoid

A trapezoid (trapezium in British English) has exactly one pair of parallel sides. Its perimeter is P = a + b + c + d, the sum of all four sides. For an isosceles trapezoid (equal non-parallel sides), P = a + b + 2c. If you only know the parallel sides (a, b) and the height h, the non-parallel sides can be calculated using the Pythagorean theorem if you also know the offset: leg = √(h² + offset²). Trapezoids appear in architecture (rooflines), civil engineering (road cross-sections), and furniture design.

Perimeter of a Regular Polygon

A regular polygon has n equal sides each of length s, so P = n × s. Common regular polygons: equilateral triangle (n=3), square (n=4), pentagon (n=5), hexagon (n=6), octagon (n=8). If you know the circumradius R (center to vertex), then s = 2R·sin(π/n) and P = 2nR·sin(π/n). As n increases, the regular polygon approaches a circle, and its perimeter approaches 2πR. Hexagonal tiling is common in nature (honeycomb) because regular hexagons tile the plane with the least total perimeter.

Perimeter of an Ellipse

Unlike the circle, the ellipse has no exact closed-form perimeter formula using elementary functions. The exact value requires an elliptic integral. However, Ramanujan's approximation is remarkably accurate: P ≈ π[3(a+b) − √((3a+b)(a+3b))], where a and b are the semi-major and semi-minor axes. This approximation is accurate to within 0.01% for most ellipses. When a = b, this reduces to 2πa (the circumference of a circle), confirming the formula's consistency.

Pro Tip
To quickly estimate if a shape is "efficient," compare its perimeter to that of a circle with the same area. The compactness ratio 4πA/P² equals 1 for a circle (maximum) and less than 1 for all other shapes. A square has compactness ≈ 0.785, an equilateral triangle ≈ 0.605.

Perimeter vs Area: Key Differences

Perimeter measures distance around (1D, linear units). Area measures space inside (2D, square units). Crucially, shapes with the same perimeter can have vastly different areas, and vice versa. A long thin rectangle 1×49 has perimeter 100 and area 49, while a 25×25 square also has perimeter 100 but area 625 — nearly 13 times more. This distinction is vital in land surveying, packaging design, and architecture. Always specify which measurement you need: border length (perimeter) or surface coverage (area).

Real-World Applications of Perimeter

Perimeter calculations appear everywhere: Construction — calculating baseboard, crown molding, fencing, and edging materials. Landscaping — border plants, garden edging, retaining walls. Sports — track lengths (standard 400m track is the perimeter of a rectangle with semicircular ends). Sewing — bias tape, trim, and hem lengths. Framing — picture frame material. Packaging — strap and tape lengths. Geography — coastline length (though fractal coastlines present the famous "coastline paradox"). In all cases, adding 5-10% extra material is recommended to account for cuts and waste.

How to Use This Calculator

Select a shape from the 8 options: Rectangle, Square, Triangle, Circle, Parallelogram, Trapezoid, Regular Polygon, or Ellipse. Enter the required dimensions for your shape and click "Calculate Perimeter." The calculator displays the perimeter with an interactive canvas visualization showing labeled dimensions, all properties including area, a step-by-step formula application, and a reference table comparing all 8 shapes. The compactness ratio tells you how efficiently your shape encloses area relative to its perimeter.

Common Mistake
Confusing perimeter with area is one of the most common math errors. Doubling a square's side doubles the perimeter (×2) but quadruples the area (×4). When buying fencing (perimeter), don't accidentally calculate the area — and when buying sod or tile (area), don't use the perimeter formula. Units are a helpful clue: perimeter uses meters, area uses m².

Frequently Asked Questions

What is perimeter?
The total distance around a 2D shape. Rectangle: P = 2(l+w). Circle: C = 2πr. Triangle: P = a+b+c.
How do you find the perimeter of a rectangle?
P = 2 × (length + width). A 8×5 rectangle has P = 2(8+5) = 26.
What is the perimeter of a triangle?
Sum of all three sides: P = a + b + c. Equilateral: P = 3s. Isosceles: P = 2a + b.
What is the difference between perimeter and area?
Perimeter = distance around (linear units: cm, m). Area = space inside (square units: cm², m²). Same perimeter can give different areas.
How do you find the circumference of a circle?
C = 2πr = πd. Radius 7 → C = 2π(7) = 43.98. Diameter 14 → C = π(14) = 43.98.
How do you calculate a regular polygon's perimeter?
P = n × s (number of sides × side length). Hexagon with side 4: P = 6×4 = 24.
How do you approximate an ellipse's perimeter?
Ramanujan's formula: P ≈ π[3(a+b) − √((3a+b)(a+3b))]. Very accurate for most ellipses.
What is compactness ratio?
Compactness = 4πA/P². A circle scores 1.0 (maximum). Square ≈ 0.785. It measures how efficiently a shape encloses area.