DigitHelm

Perimeter Calculator | 2D Shapes

Calculate the perimeter and circumference of common 2D shapes.

What Is the Perimeter Calculator | 2D Shapes?

This perimeter calculator supports 7 shapes, rectangle, square, triangle, equilateral triangle, circle, regular polygon, and rhombus, with a unit selector (mm/cm/m/km/in/ft/yd). Every calculation also returns the area and, where applicable, the diagonal or apothem.

  • 7 shapes: Rectangle, square, triangle (any), equilateral triangle, circle, regular polygon, rhombus.
  • Unit selector: mm, cm, m, km, in, ft, yd, perimeter, area, and diagonal all display in the chosen unit.
  • Heron's formula: Triangle area computed from 3 sides alone, with triangle inequality validation.
  • Regular polygon: n-gon perimeter plus apothem (inradius) for any number of sides ≥ 3.
  • Rhombus from diagonals: Side and perimeter derived from the two diagonals d₁ and d₂.

Formula

Rectangle: 2(l+w)  ·  Circle: 2πr  ·  Triangle: a+b+c  ·  Polygon: n×s
Heron's area: A = √(s(s−a)(s−b)(s−c)) where s = (a+b+c)/2
ShapeFormulaBonus output
RectangleP = 2(l + w)Area, diagonal
SquareP = 4sArea, diagonal
Triangle (any)P = a + b + cArea (Heron's formula)
CircleC = 2πrArea πr², diameter
Regular PolygonP = n × sArea, apothem
RhombusP = 4 × √((d₁/2)² + (d₂/2)²)Area = ½d₁d₂, side length

How to Use

  1. 1Select a shape from the dropdown.
  2. 2Choose your unit (m, cm, ft, etc.).
  3. 3Enter the required dimensions, the labels update to match each shape.
  4. 4Press Enter on any field or click Calculate.
  5. 5Read the perimeter (or circumference), area, diagonal/apothem, and any additional values.
  6. 6Click Clear to reset all fields.

Example Calculation

Triangle: a = 3, b = 4, c = 5

Perimeter = 3 + 4 + 5 = 12 m Heron's area: s = 6 A = √(6 × 3 × 2 × 1) = √36 = 6 m² This is a right triangle (3-4-5 Pythagorean triple)

Circle vs. circumference

For a circle, the "perimeter" is called the circumference: C = 2πr. A circle with r = 7 m has circumference 43.9823 m and area 153.94 m². The ratio of circumference to diameter is always π, regardless of size.

Understanding Perimeter | 2D Shapes

What Is Perimeter?

Perimeter is the total length of the boundary of a two-dimensional shape, the distance you would walk if you traced the edge once. For a circle, this is called the circumference. Perimeter is measured in linear units (m, cm, ft) while area is measured in square units. The two are related by the isoperimetric inequality: for a fixed perimeter, the circle encloses the maximum area.

Heron's Formula for Triangle Area

Heron of Alexandria (c. 60 AD) discovered that the area of any triangle can be computed from its three side lengths alone, without knowing the height. The formula uses the semi-perimeter s = (a+b+c)/2:

A = √(s(s−a)(s−b)(s−c)) Example: a=5, b=6, c=7 s = (5+6+7)/2 = 9 A = √(9×4×3×2) = √216 = 14.697 m²

This is particularly useful in surveying and GPS calculations where side lengths are easier to measure than heights. The triangle inequality (a+b > c for all permutations) must hold for any valid triangle, this calculator validates it automatically.

Regular Polygons and the Apothem

A regular polygon has all sides equal (length s) and all interior angles equal. Its perimeter is simply n × s. The apothem (inradius) is the perpendicular distance from the center to any side: a = s / (2 tan(π/n)). The area equals ½ × perimeter × apothem = ½ × ns × a. As n increases, a regular polygon approaches a circle.

  • Equilateral triangle (n=3): 60° interior angles, apothem = s/(2√3)
  • Square (n=4): apothem = s/2 (half the side)
  • Regular hexagon (n=6): apothem = s√3/2, tiles the plane perfectly
  • Circle (n→∞): apothem → radius, perimeter → 2πr

Frequently Asked Questions

What is the difference between perimeter and area?

Perimeter is the total length of the boundary of a shape, measured in linear units (m, cm, ft). Area is the amount of 2D surface enclosed within that boundary, measured in square units (m², cm², ft²). The two quantities are completely independent, a shape can have a large perimeter with a small area, or a small perimeter with a large area.

A classic illustration: a 10×10 m square and a 1×100 m rectangle both have an area of 100 m², but the square has a perimeter of 40 m while the rectangle has 202 m. This independence is the basis of the isoperimetric problem: which shape maximises area for a given perimeter? The answer is always the circle.

  • Perimeter: measured in metres, centimetres, feet, one-dimensional length
  • Area: measured in m², cm², ft², two-dimensional surface measure
  • Same area → many possible perimeters (rectangle vs. square vs. triangle)
  • Same perimeter → maximum area is achieved only by the circle

What is the isoperimetric inequality?

The isoperimetric inequality states that for any closed curve with perimeter P enclosing area A, the relationship A ≤ P²/(4π) always holds, with equality if and only if the curve is a perfect circle. This is one of the oldest results in mathematics, known informally since antiquity and proved rigorously in the 19th century.

The practical consequence is that the circle is the most area-efficient shape. For the same perimeter, no other shape encloses more area. Equivalently, for a fixed area, the circle requires the least boundary material. This efficiency principle appears throughout nature and engineering:

  • Soap bubbles are spherical, surface tension minimises area for a fixed enclosed volume
  • Circular cross-section pipes carry maximum flow for a given pipe circumference
  • Bees use hexagonal cells, the best tessellating approximation to circles, to minimise wax
  • Circular storage tanks and silos use less material per unit of stored volume than rectangular ones

What is Heron's formula and when do I use it?

Heron's formula computes the area of any triangle purely from its three side lengths a, b, c, without needing a height or any angle. First compute the semi-perimeter s = (a + b + c) / 2, then Area = √(s(s−a)(s−b)(s−c)). The formula is named after Hero of Alexandria (c. 60 AD) but may have been known to Archimedes earlier.

Use Heron's formula when you know all three sides but not the altitude, this is common in:

  • Land surveying, three measured distances define a triangular plot without needing a perpendicular
  • Navigation, GPS-based triangle calculations from known distances between waypoints
  • Coordinate geometry, the distance formula gives side lengths; Heron gives area from those
  • Construction, verifying triangular roof sections or land boundaries from measured edges
a = 5, b = 12, c = 13 (right triangle) s = (5 + 12 + 13) / 2 = 15 Area = √(15 × 10 × 3 × 2) = √900 = 30 ✓ Check: ½ × base × height = ½ × 5 × 12 = 30 ✓

How do I find the perimeter of a rhombus from its diagonals?

A rhombus has four equal sides, and its diagonals bisect each other at right angles. This means each side of the rhombus is the hypotenuse of a right triangle whose legs are half of each diagonal. If the diagonals are d₁ and d₂, then each side = √((d₁/2)² + (d₂/2)²), and perimeter = 4 × side. The diagonals also give the area directly: Area = ½ × d₁ × d₂.

d₁ = 8 m, d₂ = 6 m Side = √((8/2)² + (6/2)²) = √(16 + 9) = √25 = 5 m Perimeter = 4 × 5 = 20 m Area = ½ × 8 × 6 = 24 m²
  • A square is a special rhombus with d₁ = d₂ (equal perpendicular diagonals)
  • The diagonal method is useful when it is easier to measure across than along a slanted side
  • For a given perimeter, the square (d₁ = d₂) maximises the area among all rhombuses

How does perimeter scale when you double the dimensions?

Geometric scaling follows a consistent pattern: perimeter scales linearly with the scale factor, area scales as the square, and volume scales as the cube. Doubling all dimensions doubles the perimeter, quadruples the area, and octuples the volume. This has profound consequences in biology and engineering, larger organisms have a smaller surface-area-to-volume ratio, which is why elephants need large ears to dissipate heat and small mice lose heat far faster relative to body size.

  • Scale factor k: new perimeter = k × original perimeter
  • Scale factor k: new area = k² × original area
  • Scale factor k: new volume = k³ × original volume
  • Doubling all dimensions (k = 2): perimeter ×2, area ×4, volume ×8
  • Halving all dimensions (k = ½): perimeter ÷2, area ÷4, volume ÷8

In packaging and manufacturing, a container that is twice as large in every dimension uses 4× the material (surface area) but holds 8× the product, the economy-of-scale effect that makes large containers proportionally cheaper per unit of contents.

What is the apothem of a regular polygon?

The apothem is the perpendicular distance from the centre of a regular polygon to the midpoint of any one of its sides. It equals the inradius, the radius of the largest inscribed circle that fits inside the polygon and touches all sides. For a regular n-gon with side length s, the apothem = s / (2 tan(π/n)). The apothem gives a clean formula for the polygon's area: Area = ½ × perimeter × apothem, because the polygon can be divided into n identical isosceles triangles each with base s and height equal to the apothem.

  • Equilateral triangle (n = 3): apothem = s / (2√3) ≈ 0.2887s
  • Square (n = 4): apothem = s/2
  • Regular hexagon (n = 6): apothem = s√3/2 ≈ 0.8660s
  • As n → ∞: the polygon approaches a circle, and apothem → circumradius
Regular hexagon, s = 6: Apothem = 6 / (2 × tan(π/6)) = 6 / (2 × 0.5774) = 5.196 Area = ½ × 36 × 5.196 = 93.53 m²

Why does the circle circumference formula use π?

π (pi) is defined as the ratio of a circle's circumference to its diameter: π = C/d. This ratio is the same for every circle, regardless of size, a circle 1 mm across and one 100 km across both have C/d = π. Rearranging gives C = πd = 2πr. The ancient Egyptians approximated π ≈ 3.16; Archimedes (c. 250 BC) proved 223/71 < π < 22/7 by inscribing and circumscribing 96-sided polygons.

π is irrational (cannot be expressed as any fraction) and transcendental (not the root of any polynomial with integer coefficients). Its decimal expansion is non-repeating and non-terminating: 3.14159265358979…

  • C = 2πr, circumference from radius
  • C = πd, circumference from diameter
  • Area = πr², the companion area formula, derived by integrating 2πr dr from 0 to r
  • π ≈ 3.14159265, use full precision in engineering to avoid accumulated rounding errors
  • 22/7 ≈ 3.14286, a handy fraction approximation, error is only 0.04%

Related Calculators