Rectangle Calculator

Use this rectangle calculator and rectangle diagonal calculator to find two sides, area, perimeter and diagonal from a sufficient pair of measurements. Solve from two sides, one side plus area, perimeter or diagonal, or area plus perimeter or diagonal. The tool checks whether the constraints describe a positive rectangle instead of inventing a missing side from insufficient information.

Method reviewed by the NumUtility editorial team · Updated October 25, 2026

Find rectangle sides, area, perimeter and diagonal

All dimensions use this one unit. Changing it keeps the numbers and reinterprets their unit; it does not convert measurements. Use a converter for existing quantities.

Changing the measurement pair loads an example. Area plus perimeter or diagonal determines side lengths only up to swapping a and b; these modes return the longer side as a. Impossible or unresolved rounded constraints are rejected.

Rectangle: perpendicular sides a and b, diagonal d between opposite cornersSchematic, not to scale. Dimension labels match the input fields. Heights marked h are perpendicular; no measurements should be taken from this illustration.dab
Rectangle: perpendicular sides a and b, diagonal d between opposite corners. Not to scale.
Side a8 cmSide b6 cmArea48 cm²Perimeter28 cmDiagonal10 cm

Calculation steps

  1. a and b are supplied
  2. a = 8; b = 6.
  3. A = ab; P = 2(a + b); d = √(a² + b²).

Positive, nondegenerate geometry only. Dimensions must be 1e-9–1e12 in the selected length unit. Display is rounded; intermediate calculations use double precision.

How to use this rectangle calculator

Select the measurement pair you actually know, then enter its two positive values in the common unit. An area field uses square units; sides, perimeter and diagonal use length units. Switching the pair loads a consistent example, so re-enter your own figures afterward. Area plus perimeter or diagonal returns the longer side as a and the other as b, with an explicit swapping note. Changing the unit relabels unchanged numbers; convert mixed-unit source measurements separately. Invalid or impossible combinations hide all result cards until corrected.

How the calculation works

A rectangle has four right angles and opposite sides of equal length. Its two independent dimensions are adjacent sides a and b. Once they are known, area is ab, perimeter is 2(a+b), and either diagonal is √(a²+b²). This makes the page more than a length-times-width area form: it also checks the right-triangle relationship of the diagonal and recovers missing dimensions from several explicitly supported pairs of constraints.

For sides 8 cm and 6 cm, area is 48 cm², perimeter is 28 cm and diagonal is 10 cm. The diagonal spans opposite corners through the interior; it is not half the perimeter or the sum of the sides. The 6–8–10 relationship supplies a simple check of the square root. If the physical object is a skewed quadrilateral rather than a right-angled rectangle, these formulas may not represent it even when two edge lengths have been measured accurately.

With a known side and area, divide area by that side to recover the other side: b=A/a. With a known side and perimeter, subtract the side from half the perimeter: b=P/2−a. For side 8 and area 48, the result is 6. For side 8 and perimeter 28, it is also 6. A perimeter no larger than twice the known side cannot leave a positive second side and is rejected rather than converted into a zero-width shape.

With a side and diagonal, recover the other side from the Pythagorean relationship. For a=8 and d=10, b=√(100−64)=6. The implementation uses √((d−a)(d+a)) to avoid subtracting two separately squared, nearly equal numbers. The diagonal must exceed the known side. If rounded measurements make them equal, the missing positive width cannot be resolved from those inputs; a result of zero would falsely claim that a valid rectangle had been recovered.

Area and perimeter together are sufficient only when they are geometrically consistent. Let S=P/2, so a+b=S and ab=A. The sides are roots of t²−St+A=0. A real rectangle requires A≤P²/16, with equality for a square. At A=48 and P=28, the two roots are 8 and 6. At A=60 and P=28, no rectangle exists because the greatest possible area at that perimeter is 49. The interface reports the contradiction rather than silently changing a measurement.

Area and diagonal provide another sufficient pair. The equations ab=A and a²+b²=d² imply A≤d²/2, again with equality for a square. With A=48 and d=10, the recovered sides are 8 and 6. If A=60 and d=10, the maximum allowed area is 50, so the request is impossible. These inverse modes determine side lengths up to interchange: the numbers alone do not establish which edge of a real object should be called its length, width or horizontal direction.

The inverse quadratic calculation forms the larger side first and derives the smaller side from the product A/a, reducing cancellation for very thin rectangles. Floating-point precision still limits recovery from nearly equal or rounded constraints. The tool does not automatically relax an impossible pair because it looks close to a square. Inspect measurement precision and units if a boundary case is rejected; the interface cannot determine an uncertainty interval or decide which of two conflicting records should be trusted.

A single area, perimeter or diagonal alone is not enough to determine an arbitrary rectangle. Many different side pairs can share one of those quantities, and no hidden assumption of a square is applied. The supported modes deliberately ask for two sufficient values. Computed sides must each remain between 1e-9 and 1e12 in the selected unit. Use this educational result as a geometric calculation, not proof of structural capacity, material tolerance, building compliance or the squareness of an installation.

Formulas

Rectangle outputs

A = ab; P = 2(a + b); d = √(a² + b²)

Recover a missing side

b = A/a; b = P/2 − a; or b = √((d − a)(d + a))

Inverse feasibility

Area + perimeter: A ≤ P²/16; area + diagonal: A ≤ d²/2

Worked examples

Recover width from a diagonal

With one side 8 cm and diagonal 10 cm, the other side is √((10−8)(10+8)) = 6 cm. This gives area 48 cm² and perimeter 28 cm.

Distinguish a sufficient pair from an impossible one

Area 48 m² and perimeter 28 m recover sides 8 m and 6 m, up to interchange. Area 60 m² at the same perimeter is impossible because P²/16 = 49 m² is the maximum.

Common uses

Check a diagonal independently

Compare a stated pair of rectangular sides with the Pythagorean diagonal. A mathematical match does not by itself establish the squareness or safety of a real structure.

Recover a missing edge

Use a measured side plus area, perimeter or diagonal, or solve both side lengths from one of the supported area-based pairs. The selected pair must be both sufficient and geometrically consistent.

Understand inverse constraints

Test how a fixed perimeter or diagonal limits possible rectangular area. The square boundary is explicit, and impossible requests produce an error rather than a fabricated result.

Accuracy and limitations

Uses hypot for the diagonal, a factored difference for side-plus-diagonal recovery and a product-based smaller quadratic root. These methods reduce cancellation but do not recover information lost through rounded inputs.

Positive sides must lie between 1e-9 and 1e12 in the chosen unit. Area-based inverse pairs determine dimensions only up to interchange. No square assumption is used to solve an insufficient single measurement.

Sources and methodology

These primary references explain the numerical methods and units used here. Review the calculation assumptions and limitations alongside the result.

Frequently asked questions

Can the calculator find a missing rectangle side?

Yes. Supply one side plus area, perimeter or diagonal, or choose a supported two-constraint inverse mode.

Can I solve a rectangle from area alone?

No. Many side pairs share the same area. The tool does not assume a square to fill the missing information.

Why are some area and perimeter pairs rejected?

For perimeter P, area cannot exceed P²/16. A request above that bound has no real rectangular solution.

Can a square be a valid result?

Yes. Equal positive sides are accepted, including the maximum-area boundary for a fixed perimeter or diagonal.

Which recovered side is length?

Area-plus-perimeter and area-plus-diagonal modes return the longer dimension as a. Swapping the dimensions describes the same unoriented rectangle.

Can changing units fix incompatible measurements?

Not automatically. The selector relabels unchanged numbers. Convert source measurements to a consistent length and square-area basis first.

Related calculators

Related guides