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
- Enter length (above 0).
- Enter width (above 0).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Length | A number | > 0 |
| Width | A 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.
| Result | Value |
|---|---|
| Area | 24 |
| Perimeter | 20 |
| Diagonal | 7.211103 |
Example 2
Inputs: Length = 3; Width = 4.
| Result | Value |
|---|---|
| Area | 12 |
| Perimeter | 14 |
| Diagonal | 5 |
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.
| Length | Area | Perimeter | Diagonal |
|---|---|---|---|
| 3 | 12 | 14 | 5 |
| 6 | 24 | 20 | 7.211103 |
| 12 | 48 | 32 | 12.649111 |
| 24 | 96 | 56 | 24.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.
| Calculator | You enter | It returns |
|---|---|---|
| [Diagonal of a Rectangle Calculator](/math/diagonal-of-rectangle/) | length and width | Diagonal |
| [Triangle Calculator](/math/triangle-calculator/) | side a, side b and side c | Area |
| [Circle Calculator](/math/circle-calculator/) | i know the and value | Area |
| [Circumference Calculator](/math/circumference/) | i know the and value | Circumference |
| [Area of a Circle Calculator](/math/area-of-a-circle/) | i know the and value | Area |
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.
Related calculators
- 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.
- Circumference Calculator — Circumference of a circle.
- Area of a Circle Calculator — Area of a circle from its radius, diameter or circumference.
- Rectangular Prism Volume Calculator — Volume of a rectangular prism (box).
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.