Perimeter of a Square Calculator

Enter a square's side length to get its perimeter (P = 4s), the side length echoed back, and its diagonal (d = s√2), plus an optional fencing or edging material cost estimate.

Quick Facts

Perimeter formula
P = 4s
Sum of all four equal sides.
Side from perimeter
s = P / 4
Reverse the formula when you know the perimeter but not the side.
Diagonal formula
d = s × √2 ≈ 1.4142s
Follows from the Pythagorean theorem across two adjacent sides.

Your Results

Calculated
Perimeter
-
P = 4 × side
Side Length
-
As entered
Diagonal
-
d = side × √2
Estimated Material Cost
-
Perimeter × cost per unit length

Ready

Enter a side length and unit, then press Calculate.

Formula and Method for the Perimeter of a Square

A square is a four-sided polygon with all sides equal in length and every interior angle equal to 90°. Because every side is the same length, the total distance around the square — its perimeter — is simply four times one side: P = 4s, where s is the length of one side. This calculator also echoes back the side length, derives the diagonal, and gives an optional fencing or edging material cost estimate from the same measurements.

How the calculation works

Enter the side length and choose the unit it is measured in. The calculator multiplies that value by 4 to get the perimeter (P = 4s, in the same linear unit you entered) and multiplies it by √2 ≈ 1.4142 to get the diagonal (d = s√2) — this comes from the Pythagorean theorem, since a square's diagonal is the hypotenuse of the right triangle formed by two adjacent sides. If you know the perimeter but not the side length, reverse the formula: s = P / 4. If you enter a cost per unit length, the tool multiplies it by the perimeter to estimate the total cost of fencing, edging, or trim material.

Common mistakes

  • Confusing perimeter with area: a square with 5 ft sides has a perimeter of 4 × 5 = 20 ft, not 25 ft (that's the area, 5² = 25 ft²).
  • Mixing units: keep the side length in one consistent unit — convert inches to feet, or centimeters to meters, before entering the value.
  • Forgetting the ×4: the perimeter is the sum of all four equal sides, not just one side or two adjacent sides.

Real-world applications

  • Fencing, edging, and trim projects use perimeter directly to determine how much linear material to buy.
  • Framing a square garden bed, patio, or room uses perimeter to plan borders and baseboards.
  • Perimeter combined with a cost per linear unit gives a quick material-cost estimate before purchasing.
  • Comparing a measured diagonal to the expected d = s√2 helps confirm a layout is truly square — equal diagonals confirm 90° corners.

Frequently Asked Questions

What is the formula for the perimeter of a square?
The perimeter of a square equals four times its side length: P = 4s. For example, a square with a 5 ft side has a perimeter of 4 × 5 = 20 ft.
How do I find the side length from the perimeter?
Divide the perimeter by 4: s = P / 4. A square with a 24 in perimeter has sides of 24 / 4 = 6 in.
How is the diagonal of a square related to its perimeter?
The diagonal is d = s√2, and since s = P/4, the diagonal can also be written as d = (P/4) × √2 ≈ 0.3536 × P. A square with a 20 ft perimeter (5 ft sides) has a diagonal of about 7.07 ft.
How much fencing or edging material should I buy?
Add roughly 5–10% extra to the calculated perimeter to cover corner posts, overlaps, and waste when purchasing fencing, edging, or trim material.