HomeGeometryRectangle Diagonal Calculator
Geometry

Rectangle Diagonal Calculator

Calculate a rectangle diagonal from positive length and width in centimeters, with three-decimal results, worked examples and browser-limit guidance.

rectangle-diagonal-calculator
Diagonal

Formula: d = √(length² + width²)

Enter positive length and width values in centimeters. The diagonal is returned in centimeters and rounded to three decimal places.

The Rectangle Diagonal Calculator finds the straight-line distance between opposite corners from a rectangle’s length and width. Enter positive length and width values in centimeters. The diagonal is returned in centimeters and rounded to three decimal places. Select Calculate after entering or changing either value.

With the default length 10 and width 5, the calculation is √125, approximately 11.1803399, so the widget displays 11.180 cm. For decimal inputs 3.5 and 2.25, the diagonal is approximately 4.1608292 and displays as 4.161 cm.

How to Use the Rectangle Diagonal Calculator

  1. Enter a positive finite length in centimeters.
  2. Enter a positive finite width in centimeters.
  3. Select Calculate and read the diagonal shown to three decimal places.

Both values must be greater than zero. Blank, nonnumeric, non-finite, zero and negative entries are rejected with an accessible field error. Decimal values are supported, and there is no arbitrary maximum below the browser’s finite-number limit. Changing either input clears the earlier result until you calculate again.

Rectangle Diagonal Formula and Worked Examples

d = √(length² + width²)

A rectangle’s diagonal divides it into two right triangles. The diagonal is the hypotenuse, while the length and width are the legs. The OpenStax Prealgebra 2e treatment of the Pythagorean theorem states the squared-side relationship for right triangles. Squaring the two side lengths, adding them and taking the principal square root gives the positive diagonal.

For 10 cm by 5 cm, d = √(10² + 5²) = √125, which displays as 11.180 cm. For 3.5 cm by 2.25 cm, d = √(3.5² + 2.25²), which displays as 4.161 cm. Display rounding changes only the shown value.

For equal sides, use the Square Diagonal Calculator. Use the Rectangle Area Calculator for square-centimeter area and the Rectangle Perimeter Calculator for boundary length; those are different measurements.

Input Limits, Rounding and Related Geometry Tools

The widget evaluates the length and width with the browser’s scaled hypotenuse operation. MDN’s Math.hypot reference documents that operation. It avoids the avoidable intermediate overflow caused by squaring first: inputs of 1 × 10²⁰⁰ cm for both sides still produce a finite diagonal of approximately 1.414213562373095 × 10²⁰⁰ cm.

JavaScript still has a finite numeric ceiling. MDN’s Number.MAX_VALUE reference documents the largest positive finite number. Two Number.MAX_VALUE inputs produce a non-finite diagonal; the widget then clears the result to an em dash and displays an accessible calculation error instead of showing Infinity.

Finite results are displayed to three decimal places, so a value with more digits is rounded for display. Keep both inputs in centimeters to obtain centimeters. The Right Triangle Area Calculator finds triangle area, while the Pythagorean Theorem Calculator applies the same right-triangle relationship when you need a broader theorem-focused tool.

Frequently asked questions

What formula does the Rectangle Diagonal Calculator use?

It uses d = √(length² + width²), the Pythagorean-theorem relationship for the hypotenuse formed by a rectangle’s length and width.

What values can I enter for length and width?

Both inputs must be positive finite numbers. Decimals are supported; blank, nonnumeric, non-finite, zero and negative values are rejected with a field error.

Which units does the calculator use?

Enter length and width in centimeters. The result is a diagonal length in centimeters, not an area in square centimeters.

What results do the worked examples produce?

A 10 cm by 5 cm rectangle returns 11.180 cm. A 3.5 cm by 2.25 cm rectangle returns 4.161 cm after three-decimal display rounding.

Can I calculate the diagonal of a square?

Yes. A square is a rectangle with equal length and width, so enter the same positive side length in both fields.

How does the calculator handle very large inputs?

It uses a scaled hypotenuse operation, so two inputs of 1 × 10²⁰⁰ remain finite. If a finite input pair produces a non-finite diagonal, the widget clears the result to an em dash and displays an accessible calculation error.

Why does the Pythagorean theorem apply to a rectangle?

A diagonal splits a rectangle into two right triangles. The length and width are perpendicular legs, and the diagonal is the hypotenuse.