PLANE GEOMETRY

Rectangle Calculator

Find a rectangle’s area, perimeter, diagonal, and missing side lengths. Enter dimensions directly or solve from area and perimeter or from a diagonal and one side.

INPUTS

Enter your measurements

Enter the side lengths in the same unit. If both sides match, the rectangle is a square. Area is shown in square units.

Press Enter to calculate
Try an example

YOUR ANSWER

Rectangle measurements

Area60 cm²A = L × W
Perimeter34 cmP = 2(L + W)
Diagonal13 cmd = √(L² + W²)
Length12 cm
Width5 cm
Aspect ratio2.4 : 1
ShapeRectangle
Rectangle length, width, and diagonalA rectangle with length 12 cm, width 5 cm, and diagonal 13 cm.Length = 12 cmWidth = 5 cmd = 13 cm
The dashed diagonal splits the rectangle into two congruent right triangles.
Step-by-step calculation
  1. Use the supplied side lengths: length = 12 and width = 5.
  2. Area: A = LW = 12 × 5 = 60 square units.
  3. Perimeter: P = 2(L + W) = 2(12 + 5) = 34 units.
  4. Diagonal: d = √(L² + W²) = √(12² + 5²) = 13 units.

What is a rectangle?

A rectangle is a quadrilateral with four right angles. Its opposite sides are parallel and equal, and its two diagonals have the same length and bisect each other. A square is a special rectangle whose four sides are equal. The calculator uses length and width for the two distinct side measurements.

Rectangle formulas

AreaA = L × WMultiply the perpendicular side lengths.
PerimeterP = 2(L + W)Add all four side lengths.
Diagonald = √(L² + W²)Apply the Pythagorean theorem.
From area and perimeterL, W = (P/4) ± ½√((P/2)² − 4A)Side lengths are the roots of t² − (P/2)t + A = 0.

How to calculate a rectangle’s area

Measure one side as the length and the adjacent side as the width, then multiply: A = L × W. For a 12 cm by 5 cm rectangle, A = 12 × 5 = 60 cm². Area is measured in square units because both dimensions are lengths.

How to find the perimeter

A rectangle has two sides of length L and two sides of width W. Add them to get P = L + W + L + W, which simplifies to P = 2(L + W). For sides 12 cm and 5 cm, P = 2(12 + 5) = 34 cm.

How to find a diagonal

A diagonal connects opposite corners. It forms a right triangle with the length and width as its legs, so the Pythagorean theorem gives d² = L² + W² and therefore d = √(L² + W²). For a 12-by-5 rectangle, d = √(144 + 25) = √169 = 13.

Worked example: a 12 cm by 5 cm rectangle

Area: A = 12 × 5 = 60 cm².

Perimeter: P = 2(12 + 5) = 34 cm.

Diagonal: d = √(12² + 5²) = √169 = 13 cm.

The diagonal check is exact, so the 5–12–13 right-triangle relationship confirms the dimensions.

Solving for missing sides

If area A and perimeter P are known, then L + W = P/2 and LW = A. Thus L and W solve t² − (P/2)t + A = 0. Real positive sides exist only when P² ≥ 16A, which is equivalent to the fact that among rectangles with a fixed perimeter, the square has the greatest area. If the diagonal d and one side s are known, the other side is √(d² − s²); this requires d > s.

Rectangle and square: what is the difference?

Every square is a rectangle because it has four right angles, but a rectangle does not need four equal sides. When L = W, the area becomes A = L², the perimeter becomes P = 4L, and the diagonal is d = L√2. The calculator identifies equal side lengths as a square while retaining the same general formulas.

Common mistakes

Frequently asked questions

What is the formula for the area of a rectangle?

Multiply its length by its width: A = L × W. Use square units for the result.

How do you calculate a rectangle’s perimeter?

Use P = 2(L + W), or add all four sides. The result is in the same length unit as the sides.

How do I find the diagonal?

Use the Pythagorean theorem: d = √(L² + W²).

Can I find the side lengths from area and perimeter?

Yes. The sides have sum P/2 and product A. The calculator solves the resulting quadratic and checks that the values are real and positive.

Can a rectangle also be a square?

Yes. A square is a rectangle with equal length and width.

Does the diagonal divide a rectangle into equal parts?

It divides the rectangle into two congruent right triangles, each with half the rectangle’s area.

Related geometry calculators