Rectangle Calculator

Find the area, perimeter and diagonal of a rectangle or square from its length and width, in any units.

Results

Area
96
Perimeter
40
Diagonal
14.422

How it’s calculated

A rectangle's area is its length times its width. The perimeter is the distance around all four sides, and the diagonal follows from the Pythagorean theorem because the diagonal splits the rectangle into two right triangles.

Area A = L × W Perimeter P = 2(L + W) Diagonal d = √(L² + W²)

Example: a 12 ft × 8 ft rectangle has area 12 × 8 = 96 ft², perimeter 2 × (12 + 8) = 40 ft and diagonal √(144 + 64) = √208 ≈ 14.42 ft.

Frequently asked questions

Does this work for a square?

Yes. Enter the same value for length and width. A square with side s has area s², perimeter 4s and diagonal s√2.

Can I mix units, like feet and inches?

Yes. Each input has its own unit picker; everything is converted internally before calculating, and you can pick the output unit too.

How do I check that a corner is square?

Measure the diagonal. If it matches √(L² + W²), the corners are 90°. This is the same idea as the 3-4-5 rule used by builders.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Spotted a mistake or missing option? Report a problem · GitHub issue· Suggest a calculator