Diagonal Of Rectangle Calculator - Pythagorean Formula and Sides

Use this diagonal of rectangle calculator to find the diagonal of a rectangle from its length and width, or from its area and one side, with the right triangle and the squared sides shown.

Updated: June 16, 2026 • Free Tool

Diagonal Of Rectangle Calculator

Pick the two rectangle values you already know. Choose Length + Width to enter the two sides, or Area + Width to let the calculator recover the length from the area first.

Long side of the rectangle, in the chosen linear unit. Used directly in the Length + Width mode and recovered from area / width in the Area + Width mode.

Short side of the rectangle, in the same linear unit as the length. Always required so the two sides of the right triangle are well defined.

Area of the rectangle, in the matching square unit. Only used in the Area + Width mode, where the length is recovered as area / width before the diagonal is computed.

Results

Diagonal (d)
0units
Squared diagonal (d²) 0units²
Length squared (l²) 0units²
Width squared (w²) 0units²
l² + w² 0units²
Is the rectangle a square? 0

What Is a Diagonal of Rectangle Calculator?

A diagonal of rectangle calculator finds the length of the line that connects the two opposite corners of a rectangle, using the Pythagorean theorem. It is the everyday geometry answer to the question, "how long is the diagonal of a rectangle with sides a and b?" Type the length and the width, or the area and one side, and the page returns the diagonal, the squared diagonal, and the right triangle the diagonal cuts across, so you can both check a homework problem and trust the answer.

  • Homework and textbook problems: Confirm a problem that asks for the diagonal of a rectangle, the value of d in d^2 = a^2 + b^2, or the missing side from a given diagonal.
  • Carpentry, screen, and packaging measurements: Find the diagonal of a board, a TV, a monitor, a box, or a sheet of plywood so you can size a cut, a screen, a sleeve, or a shipping carton.
  • Layout and design grids: Compute the corner-to-corner distance of a room, a desk pad, a piece of paper, or a UI mockup to check fit, alignment, or aspect ratio.
  • Pair with rectangle area or perimeter: Use the diagonal alongside the area or the perimeter of the rectangle to back-solve a missing side when only one value is known.

The diagonal of rectangle calculator is intentionally narrow: it answers the d = sqrt(l^2 + w^2) question for the standard rectangular case, where the two adjacent sides are the legs of a right triangle and the diagonal is the hypotenuse. If you need the space diagonal of a cuboid or the area of the rectangle, pair this page with one of the peer calculators below.

If you need to back-solve a missing side from the area, the perimeter, or the diagonal, the Length Of A Rectangle Calculator page handles all six input pairs in one form.

How the Diagonal of Rectangle Calculator Works

The page implements the Pythagorean theorem applied to a rectangle. It takes the two adjacent sides, squares and sums them, and takes the square root to return the diagonal.

d = sqrt(l^2 + w^2)
  • l, w: Length and width of the rectangle, the two legs of the right triangle.
  • d: Diagonal of the rectangle, the hypotenuse of the right triangle.
  • l^2 + w^2: Sum of the squared sides, equal to d^2, the value under the square root.
  • d = sqrt(l^2 + w^2): Final diagonal length, the only output that depends on a square root.

The same formula works for any positive length and width, including the square case where l = w and the diagonal reduces to l * sqrt(2). Squaring removes the sign of l and w, so the diagonal is always non-negative.

Worked example: a 3 by 4 rectangle (3-4-5 right triangle)

Length = 4, width = 3.

l^2 = 16. w^2 = 9. d^2 = 16 + 9 = 25. d = sqrt(25).

d = 5 units.

The 3 by 4 rectangle forms a 3-4-5 right triangle with the diagonal as the hypotenuse. The diagonal comes out to a clean integer because (3, 4, 5) is a Pythagorean triple.

According to Wolfram MathWorld, the diagonal of a rectangle with side lengths a and b is d = sqrt(a^2 + b^2), which is the Pythagorean theorem applied to the right triangle formed by the two adjacent sides.

If you want to solve for any one leg or the hypotenuse of the right triangle the diagonal cuts across, the Pythagorean Theorem Solver page works the same arithmetic in a more general form.

Key Concepts Behind the Diagonal of a Rectangle

Four ideas explain why the formula is what it is, what the result means, and how the rectangle relates to a right triangle.

Pythagorean theorem

For a right triangle with legs a and b and hypotenuse c, c^2 = a^2 + b^2. A rectangle is two right triangles glued along a diagonal, so the diagonal of a rectangle is exactly that hypotenuse.

Two equal diagonals

A rectangle has two diagonals of equal length. The two right triangles formed by a diagonal are mirror images, so swapping which corner you start from does not change the length of the diagonal.

Square case

When the length and width are equal, the rectangle is a square. The diagonal of a square with side a is a * sqrt(2), because a^2 + a^2 = 2a^2, and sqrt(2a^2) = a * sqrt(2).

Squared diagonal

The value under the square root, l^2 + w^2, is the squared diagonal d^2. Showing it as a separate output makes it easy to verify the addition before the final square root is taken.

These four ideas are the building blocks for the rest of the rectangle geometry chain. If you have the diagonal, the length, and the width, you can recover the area, the perimeter, the aspect ratio, or the missing side of any other rectangle in the same family.

When the two sides form a Pythagorean triple, the diagonal comes out to a clean integer, and the Pythagorean Triples Calculator page is the next click for spotting side pairs that give integer results.

How to Use This Diagonal of Rectangle Calculator

Five short steps cover both input modes, from the clean 3-4-5 textbook example to the area-plus-width shortcut.

  1. 1 Pick the input mode: Use Length + Width when you know both sides, or Area + Width when you know the area and one side and want the calculator to recover the missing side first.
  2. 2 Enter the length and the width: Type the two adjacent sides. The defaults are 4 and 3, so the example starts as the 3-4-5 right triangle the moment the page loads.
  3. 3 Or enter the area and one side: Switch to Area + Width and type the area in the matching square unit and one side in the linear unit. The length is recovered as area / width before the diagonal is computed.
  4. 4 Read the diagonal: The primary output is the diagonal d, updated as you type. For a 3 by 4 rectangle the answer is 5, and for a 6 by 6 square the answer is 6 * sqrt(2) ≈ 8.4853.
  5. 5 Verify and reset: Read the squared length, squared width, and the sum to confirm the addition. Click Reset to return to the default 3 by 4 example. If you need the area or perimeter, open the Length Of A Rectangle Calculator in a new tab.

Try length = 5 and width = 12. The calculator gives l^2 = 25, w^2 = 144, l^2 + w^2 = 169, d = 13, and the rectangle is not a square. The result 13 confirms that (5, 12, 13) is a Pythagorean triple, this time for a 5 by 12 rectangle.

Once you have the diagonal, the length, and the width, the Right Triangle Calculator page can fill in any missing leg, hypotenuse, or angle of the right triangle those values describe.

Benefits of Using This Diagonal of Rectangle Calculator

These benefits matter most when you are working a problem by hand and need a quick, trustworthy check.

  • Skip the arithmetic mistakes: Manual diagonal problems are easy to get wrong on the squaring step. The calculator handles the squaring and the square root so you can focus on setting up the problem.
  • See the full step-by-step math: The page shows l^2, w^2, the sum l^2 + w^2, and the final d. That makes it a good way to check your own work, not just a way to get a number.
  • Switch between length+width and area+width: Sometimes only the area and one side are known. The mode selector recovers the missing length and runs the same Pythagorean step, so you do not have to do the back-solve yourself.
  • Get an is-square flag: The result panel reports whether the length and width are equal, which is a fast way to see the special case where the diagonal reduces to l * sqrt(2).
  • Connect to the rest of rectangle geometry: If your next step is to find the missing side, the area, or the perimeter, the page links out to the relevant peer calculator in the same category.

The page is most useful as a check, not as a replacement for understanding the formula. Use it to confirm a homework answer, sanity-check a measurement, or pre-validate a side pair before you hand it to a longer script.

If you would rather enter two corner coordinates on a grid and get the distance between them, the 2D Distance Calculator page runs the same sqrt of squared sum on coordinate pairs.

Factors That Affect the Diagonal of a Rectangle

The formula is the same in every case, but a few factors change how the result should be read.

Length-to-width ratio

A long thin rectangle has a diagonal only slightly longer than the long side. A near-square rectangle has a diagonal close to l * sqrt(2).

Whether the rectangle is a square

When l = w, the diagonal is exactly l * sqrt(2). The is-square flag in the result panel tells you that you are in this special case.

Pythagorean triple coincidence

When the two sides form a Pythagorean triple (such as 3-4-5 or 5-12-13), the diagonal is a clean integer. For most other side pairs the diagonal is irrational.

Unit of the inputs

The diagonal is in the same linear unit as the length and the width. If the sides are in centimeters, d is in centimeters. The area input must be in the matching square unit.

Numerical precision of the inputs

Very small rounding in the inputs can shift the fourth decimal place of d. Enter sides with as much precision as the original problem gives.

  • This page is the planar, 2D rectangle case only. For the space diagonal of a cuboid, the formula needs an extra height term and the dedicated cuboid surface area page handles that directly.
  • The formula assumes the two given sides are the two adjacent sides of a rectangle. If one value is actually the diagonal, the answer will be too large.
  • If the inputs are inconsistent (for example area and width that would imply a negative length), the calculator shows a validation error rather than a misleading number.

According to Encyclopaedia Britannica, a rectangle is a quadrilateral with four right angles and two pairs of equal opposite sides, and its two diagonals are equal in length and bisect each other.

When you also need the area or the perimeter of the same rectangle, the Surface Area Of A Rectangle Calculator page reads the same length and width and returns the total surface area alongside the diagonal.

Diagonal of rectangle calculator interface showing length, width, and area inputs, the Pythagorean-style formula, and the diagonal plus squared side outputs
Diagonal of rectangle calculator interface showing length, width, and area inputs, the Pythagorean-style formula, and the diagonal plus squared side outputs

Frequently Asked Questions

Q: What is the formula for the diagonal of a rectangle?

A: The formula is d = sqrt(l^2 + w^2). Square the length, square the width, add the two squares, and take the square root of the sum.

Q: How do I find the diagonal of a rectangle from length and width?

A: Enter the length and the width in the Length + Width mode. The calculator returns the diagonal, the squared length, the squared width, the sum, and the is-square flag.

Q: Can I find the diagonal of a rectangle from the area and one side?

A: Yes. Switch to Area + Width and enter the area and the width. The length is recovered as area / width and then the same Pythagorean step returns the diagonal.

Q: Are the two diagonals of a rectangle the same length?

A: Yes. A rectangle has two diagonals of equal length that bisect each other. The two right triangles formed by a diagonal are mirror images, so swapping the start corner does not change the answer.

Q: What is the diagonal of a square compared to its side?

A: The diagonal of a square with side a is a * sqrt(2), which is about 1.4142 * a. When the length and the width are equal, the is-square flag reads Yes and the diagonal reduces to l * sqrt(2).

Q: How accurate is the diagonal of rectangle calculator?

A: The result is exact up to the displayed four-decimal precision. The formula is a direct application of the Pythagorean theorem, so any small difference comes from rounding the final diagonal for display.