Area and perimeter calculator for 2D shapes

Area and perimeter of 15 plane shapes, from rectangles, triangles and trapezoids to circles, ellipses, regular polygons and rings, drawn to scale.

Drafted with AI writing toolsUpdated Checked examples: 16

Try
Area
cm²
Area: 40 cm²
Maximum decimal places: 4; Nearest, ties away from zero
Perimeter
26cm
Diagonal
9.434cm

The rectangle covers 40 cm² and its boundary is 26 cm long.

The rectangle, to scale

l = 8 cmw = 5 cm
How it's calculated S
  1. Area

    A=l×w=8×5=40 cm2A = l \times w = 8 \times 5 = 40\,\text{cm}^{2}
  2. Perimeter

    P=2(l+w)=2(8+5)=26 cmP = 2(l + w) = 2(8 + 5) = 26\,\text{cm}
  3. Diagonal

    d=l2+w2=82+52=9.433981 cmd = \sqrt{l^2 + w^2} = \sqrt{8^2 + 5^2} = 9.433981\,\text{cm}

About the area and perimeter calculator

Choose one of 15 plane shapes and enter the dimensions that define it. The area and perimeter come back with the other lengths that shape has: diagonals, heights, arc and chord lengths, a regular polygon's apothem and circumradius, or a ring's width. A triangle from three sides uses Heron's formula, A = √(s(s − a)(s − b)(s − c)) with s half the perimeter, and a regular polygon uses A = ns²/(4 tan(180°/n)).

The default rectangle, 8 cm by 5 cm, has an area of 40 cm², a perimeter of 26 cm and a diagonal of 9.434 cm. Area sizes flooring, turf and paint; perimeter sizes fencing, edging and skirting board. The drawing is to scale, so a mistyped dimension shows up as the wrong shape.

Base and height do not fix a triangle's slanted sides, and a trapezoid needs its legs, so those two inputs give area only; their drawings illustrate the known dimensions. In the overview formula, A_n is regular-polygon area and P_e is ellipse perimeter. An ellipse's perimeter has no elementary closed form; Ramanujan's second approximation is used, accurate to 0.04% or better.

How to calculate area and perimeter

Area is the surface inside a flat shape, in square units; perimeter is the length around it. For a rectangle, multiply length by width: a room 12 ft long and 10 ft wide covers 12 × 10 = 120 ft², and its perimeter is 2(12 + 10) = 44 ft.

Area formulas for common shapes

In every formula below, h is the perpendicular height, measured at right angles to the base, never along a slanted side.

  • Square: A = a², P = 4a.
  • Rectangle: A = l × w, P = 2(l + w).
  • Triangle: A = ½ × base × height.
  • Parallelogram: A = b × h, P = 2(b + s), where s is the slanted side.
  • Trapezoid (trapezium): A = (a + b)/2 × h, the average of the two parallel sides times the height.
  • Rhombus: A = pq/2, half the product of the diagonals.
  • Circle: A = πr², circumference C = 2πr.
  • Ellipse: A = πab, where a and b are the semi-axes, half the full length and half the full width.
  • Regular polygon: A = ns²/(4 tan(180°/n)) for n equal sides of length s.
  • Annulus (ring): A = π(R² − r²), the outer disk minus the hole.

Area of a triangle from base and height or three sides

Half the base times the perpendicular height: a base of 8 cm and a height of 4 cm give ½ × 8 × 4 = 16 cm². Those two numbers fix the area but not the two slanted sides, so the perimeter stays unknown. From three sides instead, use Heron's formula.

With all three sides, use Heron's formula: s = (a + b + c)/2, then A = √(s(s − a)(s − b)(s − c)). Sides of 3, 4 and 5 cm give s = 6 and A = √(6 × 3 × 2 × 1) = 6 cm².

Three lengths close into a triangle only if each is shorter than the other two combined, so 2, 3 and 6 cannot form one.

Area and perimeter examples

All dimensions are in centimeters. "Not determined" marks inputs that fix the area but leave a side length open.

Shape and dimensionsArea, cm²Perimeter, cm
Square, side 5 cm2520
Rectangle, 8 × 5 cm4026
Triangle, base 8 cm and height 4 cm16Not determined
Triangle, sides 3, 4, 5 cm612
Parallelogram, base 8, height 4, side 5 cm3226
Trapezoid, bases 10 and 4, height 4 cm28Not determined
Rhombus, diagonals 8 and 6 cm2420
Circle, radius 5 cm78.53981631.415927
Semicircle, radius 5 cm39.26990825.707963
Sector, radius 5 cm and angle 90°19.63495417.853982
Segment, radius 5 cm and angle 180°39.26990825.707963
Annulus, outer radius 5 and inner 3 cm50.26548250.265482

A semicircle's perimeter adds the 10 cm diameter to the curved edge, and a sector's adds two radii to the arc. A segment is bounded by its arc and chord, so the 180° segment is the same region as the semicircle.

Given its slanted legs, the trapezoid has a perimeter too: legs of 5 cm each make it 10 + 4 + 5 + 5 = 24 cm. The annulus row repeats 50.265482 by coincidence: 16π cm² of area and 16π cm of edge around both circles.

Floors, L-shaped rooms and walls

Split an L-shaped floor into rectangles that do not overlap and add their areas. A 12 × 10 ft room with a 4 × 6 ft alcove covers 120 + 24 = 144 ft². Measuring the outer rectangle and subtracting the missing corner gives the same answer.

For wall area, multiply the perimeter by the wall height and subtract doors and windows. The 12 × 10 ft room with 8 ft walls has 44 × 8 = 352 ft² of wall before openings.

Flooring and tile orders need extra for cuts and pattern on top of the geometric area; the room area calculator and tile calculator cover those jobs.

Converting square feet and square meters

Area converts with the square of the length factor. One foot is exactly 0.3048 m, so 1 ft² = 0.3048² = 0.09290304 m².

The 120 ft² room is therefore 11.1483648 m². For an area you already know, the square feet to square meters converter does this step.

Common mistakes

  • Using the slanted side as the height. A parallelogram with base 8 cm, slanted side 5 cm and height 4 cm covers 8 × 4 = 32 cm², not 8 × 5 = 40 cm².
  • Forgetting the ½ for a triangle. Base × height is the area of the rectangle around the triangle, twice the triangle's area.
  • Using the diameter as the radius. A circle 10 cm across has r = 5 cm and an area of 78.54 cm²; plugging in 10 gives 314.16 cm², four times too much.
  • Converting area with a length factor. 120 ft² × 0.3048 = 36.576 means nothing; multiply by 0.09290304 instead.

Which measurements each shape needs

  • Triangle (base and height) gives the area only; Triangle (three sides) adds the perimeter and checks that the sides can close.
  • Trapezoid from bases and height gives the area only; from bases and legs it also finds the height and perimeter.
  • Kite takes its two different side lengths and the angle between them, A = ab sin α.
  • Ellipse perimeter has no exact elementary formula, so Ramanujan's approximation is used, accurate to 0.04% or better.

For a solid with depth, use the volume calculator. For an irregular plot given as corner coordinates, use polygon area from coordinates.

Worked examples

Rectangle 8 × 5 cm

Shape
Rectangle
Length
8 cm
Width
5 cm
Show results in
Centimetres (cm)
Area
40 cm²
Perimeter
26 cm
Diagonal
9.433981 cm

Checked against: 8 × 5, 2(8 + 5)

3-4-5 triangle by Heron's formula

Shape
Triangle (three sides)
Side a
3 cm
Side b
4 cm
Side c
5 cm
Show results in
Centimetres (cm)
Area
6 cm²
Perimeter
12 cm
Height
4 cm

Checked against: Right triangle with legs 3 and 4: ½·3·4 = 6; height onto side 3 is the other leg, 4

Regular hexagon, side 2 m

Shape
Regular polygon
Side length
2 m
Number of sides
6
Show results in
Metres (m)
Area
10.392305 m²
Perimeter
12 m
Apothem (inradius)
1.732051 m
Circumradius
2 m

Checked against: 6*4/(4*tan(pi/6)) = 6√3, 2/(2*tan(pi/6)) = √3; a hexagon's circumradius equals its side

Square as a regular 4-gon (exact tan 45°)

Shape
Regular polygon
Side length
3 cm
Number of sides
4
Show results in
Centimetres (cm)
Area
9 cm²
Apothem (inradius)
1.5 cm
Circumradius
2.12132 cm

Checked against: Square of side 3: area 9, apothem 3/2

Questions

How do you find the area of a trapezoid?

Average the two parallel sides and multiply by the perpendicular height: A = (a + b)/2 × h. Bases of 10 cm and 4 cm with a height of 4 cm give 7 × 4 = 28 cm². British English calls this shape a trapezium; the formula is the same. The perimeter also needs the two slanted legs: legs of 5 cm each make it 24 cm.

How do you find the area of a triangle from three sides?

Use Heron's formula. Take the semi-perimeter s = (a + b + c)/2, then A = √(s(s − a)(s − b)(s − c)). Sides of 5, 6 and 7 cm give s = 9 and A = √(9 × 4 × 3 × 2) = √216 ≈ 14.697 cm². Three lengths only make a triangle if each is shorter than the other two combined, so 3, 4 and 8 have no area.

What is the area of a regular hexagon?

A = (3√3/2)s², about 2.598 times the side squared. A hexagon with 5 cm sides covers 64.952 cm², and one with 2 m sides covers 10.392 m². Any regular polygon with n sides of length s has A = ns²/(4 tan(180°/n)). A hexagon's circumradius equals its side, and its apothem is s√3/2 ≈ 0.866s.

Is there a formula for the perimeter of an ellipse?

Not an exact one in elementary functions: the exact perimeter is a complete elliptic integral. Ramanujan's 1914 approximation, P ≈ π(a + b)(1 + 3h/(10 + √(4 − 3h))) with h = (a − b)²/(a + b)², is off by at most 0.04%, reached only as the ellipse flattens into a line. For semi-axes of 10 and 6 it gives 51.0539977, within 1.2 × 10⁻⁹ of the exact value.

How do you convert square feet to square metres?

Multiply by 0.09290304, the square of the international foot (0.3048 m exactly, fixed in 1959). One square metre is about 10.764 ft². A 12 ft × 10 ft room is 120 ft², or 11.148 m². Area scales with the square of the length unit, so converting each side first and then multiplying gives the same result.

About this calculator

A△=s(s−a)(s−b)(s−c),An=ns24tan⁡(π/n)Pe≈π(a+b)(1+3h10+4−3h)\begin{gathered} A_\triangle = \sqrt{s(s-a)(s-b)(s-c)},\quad A_n = \frac{n s^2}{4\tan(\pi/n)} \\ P_e \approx \pi(a+b)\left(1 + \frac{3h}{10 + \sqrt{4-3h}}\right) \end{gathered}

Sources

  1. Weisstein, E. W. “Heron's Formula”, “Regular Polygon”, “Ellipse” — MathWorld
  2. Ramanujan, S. (1914) “Modular equations and approximations to π”, Quarterly Journal of Mathematics 45, 350–372 (perimeter approximation II)
  3. NIST Handbook 44, Appendix C — exact inch–centimetre relation (1 in = 2.54 cm)

Checked against references

This calculator includes 16 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.