Rectangle Calculator — Width, Height, Diagonal, Perimeter, Area

Enter any two values (with at least one length). Private by design — runs locally in your browser.

Diagram & Inputs

Tip: Provide any two independent values (e.g., w & h, w & A, P & A, d & A, P & d, etc.). The solver infers the rest and flags inconsistencies if your extra inputs don’t match.

Results

How the Rectangle Calculator Works (with Visuals)

All rectangle properties connect through a handful of formulas. With width w and height h, we have perimeter P = 2(w + h), area A = w·h, diagonal d = √(w² + h²) (Pythagoras), and circumradius R = d/2. Because a rectangle has two defining lengths, **any two independent values** determine the entire shape. The calculator recovers w and h first, then computes the rest. If you enter more than two values, we check for consistency (within a small numerical tolerance) and still display a helpful “best-fit” set for learning and quick estimates.

Typical input pairs include: (w, h); (w, A) ⟶ h = A/w; (h, P) ⟶ w = P/2 − h; (w, d) ⟶ h = √(d² − w²); (P, A) via the quadratic above; (P, d) ⟶ A = ((P/2)² − d²)/2 then use (P, A); and (d, A) using the sum/product approach. Everything runs privately in your browser, with outputs labeled in your chosen unit (areas use squared units automatically).

5 Fun Facts about Rectangles

Golden cameo

The golden rectangle uses the ratio 1:φ; slice off a square and a smaller golden rectangle remains—self-similarity that can repeat forever.

Self-similarity

Diagonals spill secrets

Each diagonal is √(w² + h²) and they always bisect each other. Two matching diagonals are a reliable proof of right angles, even if the shape looks skewed.

Pythagoras inside

Square = rectangle on easy mode

When w = h, the rectangle maximizes area for a fixed perimeter and its circumradius collapses to R = d/2 = s/√2—a tidy bundle of equalities.

Special case

Aspect ratio fingerprints

4:3, 16:9, and √2:1 (A-series paper) are all rectangle ratios. Hold area constant but stretch the ratio and the perimeter balloons—a quick layout sanity check.

Everyday geometry

Perimeter vs area

Among rectangles with the same perimeter, the square encloses the largest area. Push the ratio toward a skinny strip and area collapses while perimeter holds steady.

Optimization clue

Rectangle Calculator: FAQs

Which inputs are valid?

Any two independent values among \(w, h, d, P, A, R\). Extra values are checked for consistency.

What about units?

Lengths use your chosen unit; area shows squared units (e.g., cm²).

Is this private?

Yes—100% client-side.

Explore more tools