Skip to content
Geometry

Perimeter Calculator

Perimeter Calculator

The distance around any shape — square, rectangle, circle, or triangle — with the formula worked out step by step.

Square — one side length

A Perimeter Calculator finds the total distance around a two-dimensional shape — the length you would walk if you traced its entire edge and came back to where you started. Fencing a yard, framing a picture, or measuring a running track all come down to perimeter. This calculator handles the four shapes people reach for most: square, rectangle, circle, and triangle. Pick the shape, type in the measurements, and you get the answer with the formula worked out line by line, so a homework check is as easy as a DIY project estimate.

What the Perimeter Calculator Does

Perimeter is the sum of all the outer edges of a shape, measured in linear units like inches, feet, or meters. The calculator applies the right formula for each shape: four times the side for a square, twice the length plus twice the width for a rectangle, two times pi times the radius for a circle, and the sum of the three sides for a triangle. For triangles it also runs the triangle inequality check — the rule that the sum of any two sides must exceed the third — because not every trio of numbers can actually form a triangle. An optional unit box lets you label the answer in feet, cm, or whatever you are working with.

How to Use the Perimeter Calculator

Choose your shape from the dropdown menu. The input boxes change to match: a square needs one side length, a rectangle needs length and width, a circle needs the radius, and a triangle needs all three sides. Type positive numbers into the boxes — zero and negative lengths are rejected, since a side cannot be zero or negative. If you like, type your unit (feet, meters, inches) into the unit box; otherwise the answer is labeled “units”. Press Calculate to see the perimeter as a large headline number followed by the step-by-step working. Press Reset to clear the form. If you switch shapes, the boxes update automatically and only the current shape’s inputs are used.

The Formulas Behind the Perimeters

Each shape has its own compact formula, and all four come from the same idea of adding up edges. Square: P = 4 × s, because all four sides are equal. Rectangle: P = 2 × (l + w), which is the same as l + w + l + w written more neatly. Circle: C = 2 × π × r, the circumference formula — with π ≈ 3.14159, a circle’s perimeter is a little more than six times its radius. Triangle: P = a + b + c, a straight sum with no shortcut, since the three sides can all differ. The triangle also obeys the triangle inequality: a + b > c, a + c > b, and b + c > a must all hold, or the “triangle” cannot close. The calculator checks this for you before giving an answer.

Worked Example: Rectangle 8 by 5

Select Rectangle, enter length 8 and width 5, and press Calculate. The breakdown shows the reasoning: a rectangle has two lengths and two widths, so P = 2 × (length + width). Substituting the numbers: P = 2 × (8 + 5) = 2 × 13 = 26. The headline answer is 26 units — or 26 feet if you typed “feet” in the unit box. This is the classic fencing problem: a garden 8 feet long and 5 feet wide needs 26 feet of fencing to go all the way around. Notice that the intermediate sum 8 + 5 = 13 is shown before the doubling, so you can spot a typo in your inputs immediately.

Worked Example: Circle With Radius 4

Select Circle, enter radius 4, and press Calculate. The formula is C = 2 × π × r. Substituting: C = 2 × π × 4 = 8π ≈ 25.1327. The calculator shows both the exact form (8π) and the decimal (25.1327), because the exact form is what a geometry class wants while the decimal is what a tape measure needs. A common slip is entering the diameter as the radius — if your circle measures 8 across, the radius is 4, and entering 8 would double the answer. Remember: radius is half the diameter, and the formula needs the radius.

Worked Example: Triangle With Sides 5, 12, and 13

Select Triangle, enter 5, 12, and 13, and press Calculate. First the calculator checks the triangle inequality: 5 + 12 = 17 > 13, and the other two pairings hold as well, so the triangle is valid. Then it adds: P = 5 + 12 + 13 = 30. The answer is 30 units. This particular triple is a famous right triangle (5² + 12² = 25 + 144 = 169 = 13²), which is a nice bonus fact but changes nothing about the perimeter — perimeter never needs angles, only side lengths. If you instead entered 1, 2, and 5, the calculator would refuse, because 1 + 2 = 3 is not greater than 5 and those segments cannot meet.

Reading Your Result

The big number is the perimeter in your chosen unit — the single value most people come for. Underneath, the Formula and Breakdown panel replays the calculation with your numbers in place, which serves two purposes: it teaches or refreshes the formula, and it lets you audit the inputs at a glance. For the circle you also get the exact multiple of π, handy for math class. For the triangle you get the inequality check spelled out, so a rejected trio of sides comes with an explanation instead of a bare error. If the answer looks wrong, the breakdown is the first place to look — nine times out of ten, one input was mistyped.

Common Mistakes With Perimeter

The number-one mistake is mixing up radius and diameter in the circle formula — C = 2πr needs the radius, so halve the across-measurement first. Second is forgetting that perimeter is a length, not an area: the answer is in feet, not square feet, and the numbers are much smaller than the area of the same shape. Third, people add only two sides of a triangle, or measure a rectangle’s length twice and forget the width — the breakdown panel exists to catch exactly this. Fourth, triangle sides that violate the triangle inequality get rejected, which surprises anyone who typed random numbers. Finally, keep units consistent: if the length is in feet and the width in inches, convert first, or the sum is meaningless.

Frequently Asked Questions

1. What is a perimeter?

The total distance around the outside of a two-dimensional shape. If you walked along every edge and returned to your start, the distance you covered is the perimeter.

2. How is perimeter different from area?

Perimeter measures the boundary as a length (feet), while area measures the surface inside as square units (square feet). A fence needs perimeter; paint needs area.

3. What is the perimeter of a square?

Four times the side length: P = 4s. A square with side 7 has perimeter 28.

4. What is the perimeter of a rectangle?

Twice the length plus twice the width: P = 2(l + w). A rectangle 8 by 5 has perimeter 26.

5. What is the perimeter of a circle called?

The circumference. It equals 2πr, or equivalently πd where d is the diameter.

6. Should I use radius or diameter for a circle?

This calculator asks for the radius. If you measured across the whole circle, that is the diameter — halve it before entering.

7. What is the perimeter of a triangle?

The sum of its three sides: P = a + b + c. A triangle with sides 5, 12, and 13 has perimeter 30.

8. Why did the calculator reject my triangle sides?

Because they violate the triangle inequality: the sum of any two sides must be greater than the third. Sides 1, 2, and 5 cannot form a closed triangle.

9. Can perimeter be zero or negative?

No. Lengths are positive, so the calculator only accepts numbers greater than zero and rejects anything else.

10. What units does the answer use?

Whatever you type in the unit box — feet, meters, inches, cm. The math is identical; only the label changes. Leave it blank for the generic “units”.

11. Do all sides need the same unit?

Yes. Convert everything to one unit before entering. Mixing feet and inches in the same calculation gives a wrong answer.

12. What is the exact vs. decimal circle answer?

The exact answer is a multiple of π, like 8π, while the decimal ≈ 25.1327 is π evaluated. Math classes usually want the exact form; real projects want the decimal.

13. How much fencing do I need for a rectangular yard?

Exactly the perimeter: 2 × (length + width). A 40-by-25-foot yard needs 130 feet of fencing, plus a little extra for the gate and posts.

14. Does perimeter work for irregular shapes?

Yes — perimeter is always the sum of all outer edges, however many there are. This calculator covers the four standard shapes; an irregular polygon just needs all its sides added.

15. Where is perimeter used in real life?

Fencing, picture framing, baseboards and trim, running tracks, garden edging, and anywhere you need to know the length of a boundary or border.

Final Thoughts

Perimeter is one of the most practical ideas in geometry — a single number that tells you how much fence, frame, or trim to buy. The Perimeter Calculator gives you that number in one click, and the step-by-step breakdown makes sure you understand it too. Measure carefully, keep your units consistent, and let the formula do the rest.