Skip to content
CalculatorAtlas

Rectangle Calculator

Tested

Area, perimeter and diagonal of a rectangle.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

A rectangle with length l and width w has area l × w, perimeter 2(l + w) and diagonal √(l² + w²). A 6 × 4 rectangle has area 24, perimeter 20 and diagonal 7.2111.

Enter the length and width. The calculator returns area, perimeter and diagonal.

Related tools: Diagonal of a Rectangle Calculator: Diagonal length of a rectangle. Triangle Calculator: Area, perimeter, angles and type of a triangle from its three sides. Circle Calculator: Radius, diameter, circumference and area of a circle from any one of them.

How to use the Rectangle Calculator

  1. Enter length (above 0).
  2. Enter width (above 0).
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the Rectangle Calculator
InputWhat to enterAllowed values
LengthA number> 0
WidthA number> 0

Formula and method

Formula

A = l × w; P = 2(l + w); d = √(l² + w²)

IEEE-754 double precision; shown to at most 6 decimal places.

Standard rectangle formulas.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Length = 6; Width = 4.

Results of example 1
ResultValue
Area24
Perimeter20
Diagonal7.211103

Example 2

Inputs: Length = 3; Width = 4.

Results of example 2
ResultValue
Area12
Perimeter14
Diagonal5

The first line is the headline result (area). Below it the rectangle Calculator lists perimeter and diagonal, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

The three measures

Area: 6 × 4 = 24. Perimeter: 2 × (6 + 4) = 20. Diagonal: √(36 + 16) = √52 = 7.2111. For a fixed perimeter, the square has the largest area.

Practical use

Area gives paint or flooring, perimeter gives fencing and trim, and the diagonal checks squareness. Use one unit for both sides.

How the result changes with length

Holding every other input at the first worked example, this table changes only length. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with length
LengthAreaPerimeterDiagonal
312145
624207.211103
12483212.649111
24965624.33105

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Length: entering "-1" shows "Length must be greater than 0." beside that field and no result.

Choosing between the Rectangle Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Rectangle Calculator and similar calculators
CalculatorYou enterIt returns
[Diagonal of a Rectangle Calculator](/math/diagonal-of-rectangle/)length and widthDiagonal
[Triangle Calculator](/math/triangle-calculator/)side a, side b and side cArea
[Circle Calculator](/math/circle-calculator/)i know the and valueArea
[Circumference Calculator](/math/circumference/)i know the and valueCircumference
[Area of a Circle Calculator](/math/area-of-a-circle/)i know the and valueArea

Background: geometry measurements

Geometry results carry units that depend on the quantity: a perimeter or length is in linear units such as cm, an area or surface area is in square units (cm²) and a volume is in cubic units (cm³). Use one length unit for every input, because the calculator multiplies the numbers as given.

Flat (2D) shapes have an area and a perimeter; solids (3D) have a surface area and a volume. Two familiar checks: a circle of radius r has area πr² and circumference 2πr, and a sphere has volume (4/3)πr³ and surface area 4πr².

Assumptions and limitations

  • Sides must be positive

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for length to confirm this.

Frequently asked questions

What is the area of a 10 × 5 rectangle?

A 10 × 5 rectangle has area 50 and perimeter 30.

Is a square a rectangle?

Yes. A square is a rectangle whose sides are all equal.

How do I find a side from area?

Divide the area by the other side.

What does the Rectangle Calculator calculate?

Area, perimeter and diagonal of a rectangle. It returns Area, Perimeter and Diagonal.

What formula does the Rectangle Calculator use?

A = l × w; P = 2(l + w); d = √(l² + w²). Standard rectangle formulas.

What do I need to enter in the rectangle Calculator?

You enter Length and Width.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Sides must be positive.

What is an example of a rectangle result?

With length 6 and width 4, the area is 24.

Sources

  • Standard Euclidean geometry formulas (e.g. NIST Digital Library of Mathematical Functions §4, CRC Standard Mathematical Tables)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.