What this calculator does
This tool computes the enclosed area and the perimeter of an arbitrary simple polygon defined by an ordered list of (x, y) coordinate points in a 2D plane. It uses the classic shoelace (Gauss) formula for area and the sum of Euclidean edge lengths for perimeter. Coordinates are treated as plain numbers in any single consistent length unit (meters, feet, pixels, etc.); the area is returned in that unit squared and the perimeter in that unit. No unit conversion is applied.
How to use it
Enter each vertex on its own line as x, y in the order you walk around the polygon (clockwise or counterclockwise both work). You do not need to repeat the first point at the end — the closing edge from the last vertex back to the first is added automatically. Pick a display precision and read off the area and perimeter.
The formula explained
The shoelace formula sums the cross-terms \((x_j - x_{j+1})(y_j + y_{j+1})\) around the loop, halves the total, and takes the absolute value. Geometrically this accumulates signed trapezoid areas under each edge; opposite edges cancel except for the enclosed region. The perimeter simply adds the straight-line distance of every edge, including the closing edge.
$$A = \frac{1}{2}\left| \sum_{j=1}^{n} (x_j - x_{j+1})(y_j + y_{j+1}) \right| \qquad P = \sum_{j=1}^{n} \sqrt{(x_j - x_{j+1})^2 + (y_j - y_{j+1})^2}$$ $$\text{where}\quad \left\{ \begin{aligned} (x_j, y_j) &= \text{Coordinate Points} \\ (x_{n+1}, y_{n+1}) &= (x_1, y_1) \end{aligned} \right.$$
Worked example
For a 4×3 rectangle with vertices (0,0), (4,0), (4,3), (0,3): the shoelace sum is \(0 + 0 + 24 + 0 = 24\), so \(S = 24/2 = \)12 square units. The edge lengths are \(4 + 3 + 4 + 3\), giving a perimeter of 14 units. A triangle (0,0), (4,0), (0,3) yields \(S = 6\), matching \(\frac{1}{2} \times \text{base} \times \text{height}\).
How to Apply the Shoelace Formula by Hand
The shoelace formula (also called Gauss's area formula) gives the area of a simple polygon directly from its ordered vertex coordinates. The perimeter comes from adding the straight-line length of every edge.
- List the vertices in order around the boundary (clockwise or counterclockwise) and repeat the first vertex at the end, so \((x_{n+1}, y_{n+1}) = (x_1, y_1)\).
- Compute each cross-term. Use either form: \((x_j - x_{j+1})(y_j + y_{j+1})\) or \(x_j y_{j+1} - x_{j+1} y_j\). Both give the same final area.
- Sum the terms for \(j = 1\) to \(n\), keeping the signs.
- Take the absolute value and halve it: $$A = \frac{1}{2}\left| \sum_{j=1}^{n} (x_j y_{j+1} - x_{j+1} y_j) \right|$$
- Compute each edge length with the distance formula \(d_j = \sqrt{(x_{j+1}-x_j)^2 + (y_{j+1}-y_j)^2}\).
- Add the edge lengths to get the perimeter \(P = \sum d_j\).
Example: triangle (0,0), (4,0), (0,3), then back to (0,0).
- Term 1: \(0\cdot 0 - 4\cdot 0 = 0\)
- Term 2: \(4\cdot 3 - 0\cdot 0 = 12\)
- Term 3: \(0\cdot 0 - 0\cdot 3 = 0\)
- Sum = 12, so \(A = \tfrac{1}{2}\cdot 12 = 6\).
- Edges: \(4\), \(\sqrt{(0-4)^2 + (3-0)^2} = 5\), and \(3\), so \(P = 4 + 5 + 3 = 12\).
Tip: Sketch the polygon on graph paper before trusting the numbers. Check that the vertices run around the boundary without edges crossing, that the area is plausible against the bounding box (it can never exceed it), and that no edge is longer than the perimeter minus the other edges.
Comparing Common Polygon Shapes
The values below are in the same units as the coordinates (area in square units, perimeter in linear units).
| Shape | Vertices | Area | Perimeter |
|---|---|---|---|
| 4×3 rectangle | (0,0), (4,0), (4,3), (0,3) | 12 | 14 |
| Right triangle | (0,0), (4,0), (0,3) | 6 | 12 |
| Unit square | (0,0), (1,0), (1,1), (0,1) | 1 | 4 |
| L-shaped concave polygon | (0,0), (4,0), (4,2), (2,2), (2,4), (0,4) | 12 | 16 |
Note: Reversing the vertex order (clockwise vs. counterclockwise) flips the sign of the raw shoelace sum but gives the same area and perimeter, because the formula takes the absolute value and edge lengths do not depend on direction. The L-shape shows that the formula works for concave polygons too: it is a 4×2 block plus a 2×2 block, so \(8 + 4 = 12\).
Key Terms and Definitions
- Vertex: a corner point of a polygon, given here as an (x, y) coordinate pair.
- Edge: a straight line segment joining two consecutive vertices; the last vertex connects back to the first.
- Simple polygon: a closed polygon whose edges meet only at shared endpoints, with no crossings and no holes.
- Self-intersecting (complex) polygon: a polygon whose edges cross each other, such as a bow-tie. The shoelace formula then gives a signed combination of regions, not the true enclosed area.
- Convex polygon: every interior angle is less than 180°, and any segment between two interior points stays inside. A concave polygon has at least one interior angle greater than 180° (a dent).
- Clockwise vs. counterclockwise: the direction in which the vertices are listed around the boundary.
- Signed area: the shoelace result before taking the absolute value. It is positive for counterclockwise order and negative for clockwise order (in a standard x-right, y-up system).
- Euclidean distance: the straight-line distance between two points, \(\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}\), used for each edge length.
- Shoelace (Gauss's area) formula: a method that computes a simple polygon's area from its vertex coordinates by summing cross-products of consecutive vertices and halving the absolute value.
FAQ
Does vertex order matter? The direction (clockwise vs counterclockwise) does not change the result because the absolute value is taken, but the points must be in sequential boundary order — not scrambled.
Does it work for self-intersecting shapes? The shoelace formula is exact only for simple (non-self-intersecting) polygons. If edges cross, you get the algebraic signed-region area, not the visible enclosed area.
What about just two points? Two points give area 0; because the closing edge is also counted, the perimeter equals twice the segment length. Use three or more points for a real polygon.