Rectangle Calculator
Calculate area, perimeter, and diagonal of a rectangle.
What this calculator does
This tool works out the area, perimeter and diagonal of any rectangle from its length and width. It is the shape behind most rooms, walls, yards, doors and screens.
Homeowners use it for flooring, paint and fencing. Students use it to check geometry work. It accepts any unit, as long as both measurements use the same one.
A worked example
Kofi is putting vinyl plank flooring in the rec room of his basement in Ottawa. The room measures 5.4 metres by 3.6 metres.
The floor area is 19.44 sq units, meaning square metres in his case. He compares that with the coverage printed on each box of planks. Baseboard runs around the whole room. The perimeter is 18.00 units, so he needs that many metres of baseboard, less the width of the doorway.
The longest straight line on the floor, from one corner to the far corner, is 6.49 units. That is the longest piece of pipe or trim he could lay flat in the room.
How we work it out
Area is the length times the width. Perimeter is the distance all the way around: twice the length plus twice the width. The diagonal, from one corner to the far corner, comes from the Pythagorean theorem. We square the length and the width, add them, and take the square root.
Answers are rounded to two decimal places. Area is in square units of whatever you entered, and the other two are plain lengths.
Floors, walls and fences
Area tells you how much material covers a flat surface. Use it for flooring, carpet, drywall, paint and sod. For a wall, enter the wall's width as the length and its height as the width. Run the calculator again for each window and door, and take those areas off the total before you buy paint.
Perimeter is for things that go around the edge, such as baseboard, crown moulding, fencing and garden edging. Take off the width of each doorway or gate, since no trim or fence goes there.
Rooms that are not one rectangle
Most L-shaped or T-shaped rooms can be split into two or three rectangles. Draw a quick sketch, divide it with straight lines, and measure each part. Add the areas together. Do not add the perimeters of the pieces, because the lines where they meet are not real walls. Measure the outside walls instead.
For a room with an angled wall or a bay window, use the trapezoid calculator or the triangle calculator for the odd part, and this tool for the rest.
Mistakes to avoid
- Mixing units, such as length in feet and width in inches. The answer will be meaningless.
- Measuring each wall at only one spot. Older homes are rarely exact, so measure at both ends and use the larger number.
- Rounding every measurement down. Round up when you buy materials, so you do not run short.
- Forgetting closets and alcoves. Measure them as small rectangles of their own and add them in.
What this does not include
- Volume, which needs a third measurement
- Rooms that are not rectangles, unless you split them into parts
- Windows, doors and other openings you would subtract
- Converting between feet, inches and metres
- Extra material for cuts, waste and pattern matching
Common questions
What units does this use?
Whatever you enter. If you use metres, the area is in square metres and the perimeter and diagonal are in metres. If you use feet, you get square feet and feet. Just keep both measurements in the same unit. The square footage calculator takes feet and shows both square feet and square metres.
How do I work out how much paint I need?
Find the area of each wall, using the wall's width as the length and its height as the width. Add the walls together, then subtract the doors and windows. Check the coverage printed on the paint can and divide your area by it. Multiply by the number of coats you plan to apply.
How do I convert square feet to square metres?
Multiply square feet by 0.0929 to get square metres. To go the other way, multiply square metres by about 10.76. For example, a 200 square foot bedroom is about 18.6 square metres. Make sure you convert before comparing with a product sold in the other unit.
Why can two rectangles with the same perimeter have different areas?
The perimeter only measures the edge. A rectangle 9 by 1 and a rectangle 5 by 5 both have a perimeter of 20, but the first covers 9 square units and the second covers 25. For a fixed length of fence, the closer the shape is to a square, the more ground it encloses.
What is the diagonal useful for?
It is the longest straight line that fits inside the rectangle. TV and monitor sizes are measured this way. It also helps you check that a frame, deck or room is square, since both diagonals should match the result. And it tells you whether a wide item can be tilted through a doorway, using the door's width and height.
Sources
- NIST Guide to the SI, Appendix B.8: Factors for Units Listed Alphabetically, National Institute of Standards and Technology
Last reviewed October 18, 2026. How we check our numbers.
This is an estimate to help you plan. It is not financial, medical, or legal advice. Talk to a professional before you make a big decision.