Shoelace Formula Calculator

Calculate the area, perimeter, and centroid of any irregular polygon by entering its vertex (x, y) coordinates. Supports up to 20 vertices with step-by-step working.

Load Example

#
x
y

Frequently Asked Questions

The shoelace formula (Gauss's area formula) calculates the area of a simple polygon given its vertices in order: Area = ½ × |Σ(xᵢ × yᵢ₊₁ − xᵢ₊₁ × yᵢ)|. The name comes from the cross-multiplying pattern resembling shoelace crisscross. It works for any non-self-intersecting polygon listed in order (clockwise or counterclockwise).

The vertices must be entered in consistent order — either all clockwise or all counterclockwise. Mixing orders or entering vertices in a random order will give incorrect results. The formula gives a positive area for counterclockwise order and negative for clockwise, but the absolute value is taken for the final area.

Yes. The shoelace formula correctly computes the area of any simple polygon (non-self-intersecting), including concave ones. It does NOT work for self-intersecting polygons (like a figure-8 shape) or polygons with holes. For those, each region must be computed separately.

For triangle with vertices (x₁,y₁), (x₂,y₂), (x₃,y₃): Area = ½ × |x₁(y₂−y₃) + x₂(y₃−y₁) + x₃(y₁−y₂)|. This is a special case of the shoelace formula with 3 vertices. For example, (0,0), (4,0), (0,3): Area = ½ × |0(0−3) + 4(3−0) + 0(0−0)| = ½ × 12 = 6.

Shoelace Formula Explained

Given n vertices (x₁,y₁), (x₂,y₂), ..., (xₙ,yₙ) listed in order:

Area = ½ × |Σᵢ(xᵢ × yᵢ₊₁ − xᵢ₊₁ × yᵢ)| where xₙ₊₁ = x₁ and yₙ₊₁ = y₁ (wraps around).

The "shoelace" name comes from writing the coordinates in two columns and cross-multiplying diagonally — the pattern resembles lacing a shoe.

Centroid of a Polygon

The centroid (geometric center) of a polygon is: Cₓ = (1/6A) × Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) and similarly for Cy. This is the point where a flat, uniform plate of the polygon's shape would balance.

  • Works for any simple (non-self-intersecting) polygon
  • Vertices must be in consistent clockwise or counterclockwise order
  • Also works with floating-point (non-integer) coordinates
  • Named after Carl Friedrich Gauss; also called the surveyor's formula