Rectangle and Square Calculator

Choose what you know, enter it, and get every measurement of the rectangle in the unit you pick.

Fields the chosen calculation does not use are ignored.
Labels the results only; every length is taken in this unit and the area in it squared.
For a square, the side.
In the chosen unit squared.

Length

12 ft

Width

8 ft

Area

96 ft²

Perimeter

40 ft

Diagonal

14.4222 ft

How it works

A rectangle is fixed by two numbers, its length and width. The area is their product, the perimeter is twice their sum, and the diagonal is the hypotenuse of the right triangle formed by a length and a width, so it comes from the Pythagorean theorem. A square is the special case where the two sides are equal.

Because only two numbers are independent, any two of length, width, area and perimeter determine the rest. If you know the area and one side, the other side is the area divided by that side. If you know the perimeter and one side, the other side is half the perimeter minus that side, which is why the perimeter has to be more than twice the side you give.

The unit you choose does not change the arithmetic; it labels the results. Enter every length in that unit and the area comes out in that unit squared. For a room, a slab or a lawn, that is usually square feet or square metres.

Formula

area      = length × width
perimeter = 2 × (length + width)
diagonal  = √(length² + width²)
width from area:      width = area ÷ length
width from perimeter: width = perimeter ÷ 2 − length

Example

A room 12 ft long and 8 ft wide has an area of 12 × 8 = 96 ft², a perimeter of 2 × (12 + 8) = 40 ft, and a diagonal of √(144 + 64) = √208 ≈ 14.42 ft.

If a rectangle has an area of 12 ft² and a length of 3 ft, its width is 12 ÷ 3 = 4 ft, its perimeter is 14 ft and its diagonal is √(9 + 16) = 5 ft, the 3-4-5 right triangle.

Assumptions and limitations

  • All four corners are right angles. A parallelogram or a room that is out of square has the same perimeter but a smaller area and two different diagonals.
  • Every length is in the unit you choose; the unit does not convert anything, it labels the result.
  • A square is handled as a rectangle whose width equals its length.
  • Results are rounded for display only.

Frequently asked questions

How do I check that a rectangle is square?

Measure both diagonals. In a true rectangle they are equal and each matches the diagonal shown here. If one diagonal is longer than the other, the shape is a parallelogram, and the corners are not right angles.

Why does the calculator reject my perimeter?

The two long sides alone use up twice the length, so the perimeter must be more than twice the length you entered for any width to be left over. A perimeter of 24 with a length of 12 leaves a width of zero.