GeoJSON area & length
Measure every feature: polygon area on the sphere in km², hectares, acres, mi² or m², and line length (or polygon perimeter) in km, miles, feet or nautical miles. Read it as a table, export a CSV, or get your GeoJSON back with the numbers added as properties.
GeoJSON area & length
What this tool does
It computes the geodesic area of every polygon and the geodesic length of every line, feature by feature, and totals them. Area uses the spherical-excess formula on a sphere of radius 6 371 008.8 m — the same approach Turf.js uses — with interior rings subtracted, so a polygon with holes reports its net area. Length uses the haversine distance between consecutive positions; for a polygon it is the perimeter, ring by ring.
The intent it closes: "how big is this?" — the question that comes up with a drawn catchment, a downloaded administrative boundary, a GPS track, or a parcel. Because the maths is geodesic rather than planar, the answer is right without projecting anything first.
How this tool works
Per feature, then totalled.
1. Measure area
For each polygon ring the spherical excess is computed from consecutive longitude differences weighted by the sine of latitude, then scaled by the Earth radius squared. The exterior ring counts positively and each interior ring is subtracted, so holes are handled correctly. MultiPolygon parts are summed. Points and lines contribute no area.
2. Measure length
Consecutive positions are measured with the haversine formula and summed. For a LineString that is its length; for a Polygon it is the total perimeter including holes; for a MultiLineString or MultiPolygon all parts are added. Points contribute nothing.
3. Report
The text table lists one line per feature with the geometry type and both measurements, then a total row. CSV gives the same figures with a header, ready for a spreadsheet. GeoJSON with properties returns your document with area_… and length_… properties added to each feature, so the numbers travel with the data.
Options
Units
Area in km², m², hectares, acres, mi² or ft²; length in km, m, miles, feet or nautical miles. Conversions use exact factors (an acre is 4046.8564224 m², a mile 1609.344 m), so the only approximation in the numbers is the spherical Earth model.
Label from
A property name to use as the row label — name, id, NUTS_ID. Without it, rows are labelled feature 1, feature 2 and so on, which is fine for a handful of shapes and unhelpful for a hundred.
Decimals
How many decimal places to show. Four is a sensible default for km²; drop it to 0–1 for m² or ft², where the extra digits are noise.
Example
Input:
{
"type": "Feature",
"properties": { "name": "Plot" },
"geometry": { "type": "Polygon",
"coordinates": [[[0,0],[0,0.01],[0.01,0.01],[0.01,0],[0,0]]] }
}
Output (km², km, labelled from name):
Plot Polygon 1.2364 km² 4.4462 km
TOTAL area 1.2364 km² · perimeter/length 4.4462 km · 1 feature(s)
A 0.01° square at the equator is about 1.11 km on a side, so 1.24 km² is the expected answer. The same square at 60° latitude measures roughly half that, because a degree of longitude shrinks — which is exactly why geodesic measurement matters.
Tips & common pitfalls
- Spherical, not ellipsoidal. The Earth is modelled as a sphere, which is what Turf and most web tooling do. Against a geodesic WGS 84 ellipsoid calculation (PostGIS
ST_Area(geography)) expect agreement to within roughly 0.3–0.5%. For legal or cadastral figures, use a projected CRS chosen for your area. - Holes are subtracted. A polygon with interior rings reports net area. If you want the gross outline, remove the holes first.
- Coordinates must be degrees. If your file holds Web Mercator metres the numbers will be meaningless — reproject to 4326 first.
- Self-intersecting polygons give unreliable areas. The formula assumes simple rings. Check suspicious shapes with the validator.
FAQ
Which Earth radius is used?
6 371 008.8 m, the IUGG mean radius — the same value Turf.js uses, so numbers here match a Turf-based pipeline.
Why does my area differ from PostGIS?
ST_Area(geography) measures on the WGS 84 ellipsoid; this measures on a sphere. The difference is a few tenths of a percent, larger at high latitudes.
Does length include polygon holes?
Yes — the reported length for a polygon is the total perimeter of every ring, exterior and interior. For the outline only, remove the holes.
Can I keep the numbers with the data?
Set Output to GeoJSON with properties and each feature gets area_… and length_… properties in the units you chose.