Math Calculators › Geometry
Perimeter of Square & Rectangle Calculator
Calculate the perimeter of a square or rectangle instantly — or reverse-solve for a missing side using the perimeter or area. Get results converted across five units and a scaled visual of your shape, all in one place.
| cm | m | ft | in | yd |
|---|---|---|---|---|
| 4000 | 40 | 131.23 | 1574.8 | 43.74 |
Shape view: a proportional sketch of your square or rectangle, so you can visually confirm your inputs before ordering trim, fencing, or edging material.
What Is Perimeter?
Perimeter is the total distance around the outside edge of a shape — the length of fencing you’d need to enclose it, or the length of trim you’d need to frame it. For squares and rectangles, the formulas are simple but easy to apply incorrectly if you’re not careful about which sides you’re measuring:
- Square: Perimeter = 4 × side (all four sides are equal)
- Rectangle: Perimeter = 2 × (length + width)
This calculator doesn’t just apply those formulas forward — it also works backward. If you already know a project’s perimeter (say, a fence budget) or its area (a floor plan), you can solve for the missing side length directly, without rearranging the algebra yourself.
How This Calculator Works
Square Mode
- Find Perimeter (from side): enter the side length; the calculator returns perimeter, area, and diagonal.
- Find Side (from perimeter): enter a known perimeter; the calculator divides by 4 to return the side length, then derives area and diagonal from it.
- Find Side (from area): enter a known area; the calculator takes the square root to return the side length, then derives perimeter and diagonal.
Rectangle Mode
- Find Perimeter (from side): enter length and width; the calculator returns perimeter, area, and diagonal.
- Find Side (from perimeter + one side): enter the perimeter and one known side; the calculator solves for the missing side using width = (Perimeter ÷ 2) − length.
- Find Side (from area + one side): enter the area and one known side; the calculator solves for the missing side using width = Area ÷ length.
Every mode also returns the diagonal, calculated with the Pythagorean theorem (√(l² + w²) for a rectangle, s√2 for a square), and a live unit-conversion row across centimeters, meters, feet, inches, and yards — so you never need to open a separate converter mid-project.
Worked Examples
| Project | Known Values | Result |
|---|---|---|
| Picture frame (square) | Side = 12 in | Perimeter = 48 in |
| Garden plot edging | L = 15 ft, W = 10 ft | Perimeter = 50 ft |
| Area rug border | L = 8 ft, W = 5 ft | Perimeter = 26 ft |
| Fixed fencing budget | Perimeter = 60 m, Length = 20 m | Width = 10 m |
| Known floor area | Area = 150 sq ft, Length = 15 ft | Width = 10 ft |
Real-World Applications of Perimeter
🏠 Home Improvement & Remodeling
Installing baseboards, crown molding, or chair rails? The perimeter tells you exactly how much trim to buy, minimizing waste and preventing an awkward last-minute second trip to the hardware store.
🌿 Outdoor & Garden Projects
Fencing a yard, edging a garden bed, or installing a dog run all come down to the perimeter of the enclosed space — this calculator lets you plan material quantities before you buy.
🎨 Crafting & DIY Projects
Quilt borders, picture frames, and scrapbook mats all rely on accurate perimeter measurements to avoid awkward seams or wasted trim.
🎉 Event & Decor Planning
Wrapping ribbon around a table, running rope barriers around a venue zone, or hanging garland around a hall edge all use the same perimeter math to estimate exactly how much material to order.
🏗️ Construction & Site Planning
Contractors use perimeter calculations to estimate foundation footings, site fencing, and the total linear footage of a building’s exterior wall plan.
Perimeter vs. Area — Why the Distinction Matters
Perimeter and area answer two completely different questions, and mixing them up is one of the most common errors in DIY planning. Area tells you how much surface is inside a shape — how much carpet, tile, or paint you need to cover the floor. Perimeter tells you how much distance runs around the outside — how much trim, fencing, or edging you need to enclose it. A single project often needs both numbers calculated separately: area for coverage, perimeter for the finish.
Solving for a Missing Side — The Algebra Behind It
When you know a rectangle’s perimeter and one side, this calculator rearranges the perimeter formula to isolate the unknown:
Width = (Perimeter ÷ 2) − Length
When you know the area and one side instead, it rearranges the area formula:
Width = Area ÷ Length
For a square, both reverse calculations simplify further because every side is equal — dividing the perimeter by 4, or taking the square root of the area, gives the side length directly.
The Diagonal Connection
Every rectangle (and every square, which is just a special rectangle with equal sides) has a diagonal that connects two opposite corners. Because a rectangle’s diagonal splits it into two right triangles, the Pythagorean theorem gives us the diagonal length directly: diagonal = √(length² + width²). For a square, this simplifies to side × √2. This calculator returns the diagonal automatically alongside perimeter and area, which is useful for confirming a frame or cabinet opening is truly square before installation — if the two diagonals of a rectangular frame don’t match, the corners aren’t at true 90°.
Composite and Irregular Shapes
Real-world spaces aren’t always a clean rectangle. If your shape is a rectangle with a semicircular end — like a bay window or a running-track shape — calculate the straight-line rectangle sides separately, then add the curved portion using the circumference formula for a circle, and sum the two results together. Breaking a composite shape into simple pieces like this is the standard approach used in construction takeoffs and landscaping quotes.
Common Mistakes to Avoid
- Forgetting a side. A rectangle has four sides, not two — remember to double the sum of length and width, not just add them once.
- Mixing units. Entering length in feet and width in inches will silently produce a wrong perimeter — always convert to one consistent unit first.
- Confusing perimeter with area. A room’s perimeter (for baseboards) and its area (for flooring) are two different numbers with different units — one is linear, the other is squared.
- Not rounding up material orders. Buy 5–10% more trim, fencing, or edging than the calculated perimeter to allow for corner cuts and mistakes.
- Ignoring corner overlap. Physical materials like molding or fencing posts consume a small amount of extra length at each corner joint — factor this into your final purchase quantity.
Frequently Asked Questions
Perimeter = 2 × (length + width). Add the length and width together, then double the result to account for all four sides.
Perimeter = 4 × side, since all four sides of a square are equal in length.
Yes — for a rectangle, use the “Find Side (from perimeter)” mode with one known side, and the calculator solves width = (Perimeter ÷ 2) − length automatically.
Yes — enter the known area and one side in the “Find Side (from area)” mode, and the calculator divides area by the known side to return the missing dimension.
Centimeters, meters, feet, inches, and yards. The result panel shows your perimeter converted across all five units simultaneously, so no separate unit converter is needed.
No. Perimeter measures the distance around a shape’s edge (a linear measurement), while area measures the surface enclosed inside it (a squared measurement). They answer different questions and are used for different materials.
The diagonal is useful for checking “squareness” — if a frame or foundation’s two diagonals match, the corners are true right angles. It’s calculated with the Pythagorean theorem.
A common rule of thumb is 5–10% extra to account for corner cuts, mitered joints, and measurement error, especially for trim, fencing, and edging projects.
It’s built specifically for squares and rectangles. For composite shapes with curved sections, calculate the straight and curved portions separately and add them together.
Yes — it’s completely free, with no sign-up and no limit on how many times you can use it.
Final Thoughts
Perimeter looks like the simplest formula in geometry — until you’re standing in a hardware store trying to work backward from a fixed budget or a known floor area. This calculator handles both directions: the straightforward side-to-perimeter calculation, and the reverse-solve most simple tools skip, so whether you’re planning a fence, framing a project, or double-checking a floor plan, you get a complete, unit-converted answer in one place.