Rectangle & Square Calculator

Enter any two of length, width, diagonal, area or perimeter, and the rest are worked out instantly — with the rectangle drawn to scale. Click a value on the drawing to change it.

Known values

Enter any two values.

Click an amber value to edit it · not to printed scale

Results

Rectangle formulas

A rectangle is fixed by any two independent measurements. Length and width give everything directly; other pairs solve back to them.

Area · A = L × W


Perimeter · P = 2 (L + W)


Diagonal · D = √(L² + W²)

Squares

A square is just a rectangle with equal sides. Enter the same value for length and width, or use the Square preset, and the calculator labels it accordingly.

Working from area or perimeter

Know the area and one side? The other side is area ÷ side. Know the perimeter and one side? The other is half the perimeter minus that side. The calculator handles every combination for you.

Calculating a rectangle

A rectangle is fixed by any two independent measurements. Length and width are the most direct pair — they give the area, perimeter and diagonal straight away — but the calculator also works backwards from other combinations, like an area and one side, or a diagonal and one side. A square is simply the special case where the two sides are equal.

How the measurements relate

Worked example: length and width

Take a rectangle with length L = 12 and width W = 5. All three results follow directly.

Step 1 — area
A = L × W = 12 × 5 = 60
Step 2 — perimeter
P = 2(L + W) = 2(12 + 5) = 34
Step 3 — diagonal, by Pythagoras
D = √(L² + W²) = √(144 + 25) = √169 = 13
Result

Area 60, perimeter 34, diagonal 13 — a tidy 5-12-13 rectangle, where the diagonal lands on a whole number.

Worked example: from the area and one side

If instead you know the area A = 60 and one side W = 5, the other side comes from dividing.

Missing side
L = A ÷ W = 60 ÷ 5 = 12
Then everything else follows

With L = 12 and W = 5 known, the perimeter and diagonal are found exactly as above. The same idea works from the perimeter: one side is half the perimeter minus the side you have.

Formulas this calculator uses

Area · A = L × W

Perimeter · P = 2(L + W)

Diagonal · D = √(L² + W²)

Missing side from area · L = A ÷ W

Missing side from perimeter · L = P ÷ 2 − W

Frequently asked questions

How do you find the area of a rectangle?

Multiply the length by the width: A = L × W. A rectangle 12 long and 5 wide has an area of 60 square units. Area is always in square units, even when the sides are whole numbers.

How do you find the perimeter of a rectangle?

Add the length and width, then double it: P = 2(L + W). For sides of 12 and 5 that's 2 × 17 = 34. Doubling works because a rectangle has two lengths and two widths.

How do you find the diagonal of a rectangle?

The diagonal splits the rectangle into two right triangles, so use Pythagoras: D = √(L² + W²). For a 12 by 5 rectangle that's √(144 + 25) = √169 = 13.

How do you find the missing side from the area?

Divide the area by the side you know: L = A ÷ W. If the area is 60 and one side is 5, the other side is 60 ÷ 5 = 12.

How do you find the missing side from the perimeter?

Halve the perimeter, then subtract the known side: L = P ÷ 2 − W. With a perimeter of 34 and one side of 5, the other side is 17 − 5 = 12.

What is the difference between a rectangle and a square?

A square is a rectangle whose length and width are equal, so all four sides match. Every square is a rectangle, but only rectangles with equal sides are squares. Enter the same value for both sides and this calculator labels the shape a square.