Skip to main content

Perimeter of a Square Calculator (Side or Diagonal)

Calculate the perimeter of a square from its side (P = 4s) or its diagonal (P = 2√2 × d). Formulas explained, finding the side from the perimeter, edging and fencing examples, in the length unit of your choice.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Perimeter

-

Was this tool useful?

How does this tool work?

This calculator gives the perimeter of a square, the total length of its four sides, from the side or the diagonal. Use it to check an elementary or middle school exercise, or to plan the edging for a square raised bed, the fencing for a pen or the piping around a cushion.

All four sides of a square have the same length s, so its perimeter is P = s + s + s + s = 4 × s. A square with 6 cm sides has a perimeter of 24 cm.

When only the diagonal d is known, the tool recovers the side with the Pythagorean theorem: d² = 2s², so s = d ÷ √2. The perimeter is then P = 4d ÷ √2 = 2√2 × d, about 2.828 times the diagonal.

The result is a length in the same unit as the value you entered. Because the relationship is proportional, doubling the side doubles the perimeter, while the area is multiplied by four.

For the reverse operation, just divide by four: a square with a 36 cm perimeter has 9 cm sides. This tells you how large a square you can lay out with a given length of edging or fencing.

How to use this tool

  1. Pick the measurement you know

    Side or Diagonal, depending on what the problem gives or what you can measure.

  2. Enter the value and its unit

    All common length units, metric and imperial, are available.

  3. Read the perimeter

    It appears in the same unit and updates as you type.

Formulas for the perimeter of a square

The perimeter follows from the side or the diagonal.

From the side

P = 4 × c

Four sides of equal length.

From the diagonal

P = 2√2 × d

The side equals d ÷ √2, by the Pythagorean theorem.

Side from the perimeter

c = P ÷ 4

The inverse operation.

P
perimeter, in length units
c
length of one side (also written s)
d
diagonal

Example: s = 2.5 m, P = 10 m.

Use cases

Garden and fencing

Work out the edging for a square vegetable bed or sandbox, or the fencing for a square pen.

DIY and trim work

Plan the molding, sealant or trim around a square hatch, mirror or panel.

School

Check a perimeter exercise and understand the link between side, diagonal and the square root of 2.

Sewing

Measure the piping or bias tape needed around a cushion or a square of fabric.

Examples

From the side

4 × 6 = 24 cm.

Input

s = 6 cm

Result

P = 24 cm

From the diagonal

The side is 10 ÷ √2 ≈ 7.07 cm, so P ≈ 4 × 7.07 ≈ 28.28 cm.

Input

d = 10 cm

Result

P ≈ 28.28 cm

Raised bed edging

Four 1.2 m boards, or 4.8 m of flexible edging.

Input

square with 1.2 m sides

Result

P = 4.8 m

Square pen

60 m of fencing, minus the width of the access gate.

Input

s = 15 m

Result

P = 60 m

Working backwards

20 ÷ 4 = 5 m per side, for a pen of 25 m².

Input

20 m of fencing available

Result

maximum side of 5 m

Tips and best practices

  • Perimeter is a length (cm, m, ft), unlike area, which is in square units.
  • With the diagonal, do not simply multiply it by 4: divide it by √2 first.
  • For a fence, subtract the width of the gate and add a margin for fastening.
  • A square does not have to sit level: a square turned on its corner keeps the same perimeter.

Sources and references

Frequently asked questions

What is the formula for the perimeter of a square?

P = 4 × s, where s is the length of one side. With the diagonal d, P = 2√2 × d ≈ 2.828 × d.

How do you find the side of a square from its perimeter?

Divide the perimeter by 4: s = P ÷ 4. A square with a 48 cm perimeter has 12 cm sides.

How do you find the perimeter of a square from its diagonal?

Divide the diagonal by √2 (about 1.414) to get the side, then multiply by 4. A 14.14 cm diagonal gives a 10 cm side and a 40 cm perimeter.

Do a square and a rectangle with the same perimeter have the same area?

No. With a 20 m perimeter, a 5 m square covers 25 m², while an 8 × 2 m rectangle covers only 16 m². The square gives the largest area.

Why is the perimeter of a square proportional to its side?

Because it is simply the sum of four equal sides. The constant of proportionality is 4.

Related tools

Tools similar or complementary to this one.

Similar tools

Calculate fence panels, posts and footing concrete.

Mathematics & calculationUse this tool