Spherical excess polygon area
Get the real surface area of a polygon defined by GPS corners: a one-degree box at the equator covers 12,364.031909 km². The area comes from the spherical excess of its corner angles, not from a flat formula. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
This spherical excess polygon area calculator takes an ordered ring of latitude and longitude vertices and returns the surface area of that polygon in square kilometers on a mean-Earth sphere. The engine applies Girard's theorem: it measures the interior angle at every corner from successive great-circle arcs, forms the spherical excess E as the sum of those angles minus (n minus two) times pi, and multiplies by R squared to obtain area. Unlike a flat Cartesian shoelace in abstract x-y units, the result is real spherical surface area you can report in km² (with a companion m² field). You need at least three distinct vertices; a closing repeat of the first point is optional and is dropped automatically. The path is fully deterministic: no network calls, no sampling, and no date-dependent shortcuts.
What spherical excess area means and what you get
A geographic polygon is an ordered sequence of points on the Earth expressed as latitude and longitude in decimal degrees. Planar formulas that treat those numbers as plain x-y coordinates ignore the sphere: they can be useful for tiny local sketches, but they do not report true surface area in square kilometers. This calculator models the planet as a sphere of radius R and evaluates Girard's classical identity for spherical polygons.
At each vertex the interior angle is the angle between the two great-circle arcs that meet there, computed from unit vectors and their tangent components at that corner. The spherical excess is E equals the sum of all interior angles minus (n minus two) times pi; the surface area is R squared times the absolute value of E.
For a familiar check, the spherical right triangle with vertices at (0,0), (0,90), and the north pole has three right angles, excess pi over two, and area equal to one eighth of the sphere. Self-intersecting multipolygons and ellipsoidal geodesic area are outside this contract: feed a single simple ordered ring on a sphere. If you need planar shoelace on abstract coordinates, use the dedicated planar polygon tool; if you already know the three angles of a spherical triangle and only want excess, use the pure spherical-excess math tool.
This page answers the lat/lon polygon case through Girard excess in square kilometers.
Where spherical excess polygon area fits in mapping, teaching, and software
Analysts and developers reach for spherical excess polygon area when a property boundary, climate region, or delivery zone is defined by GPS corners and the stakeholder asks for square kilometers grounded in classical spherical geometry rather than a black-box GIS routine. Students and teachers use known rings—such as a one-degree box near the equator or an octant triangle with three right angles—to verify Girard's theorem by hand against a live calculator without installing a full desktop stack.
Product teams embed the same contract when a mobile app captures a fence-walk of lat/lon points and must show area immediately, or when a backend job validates uploaded coordinate rings before storage. Pair it with great-circle distance helpers when you also need path lengths on the same sphere, with the pure spherical-excess tool when you already have triangle angles, and with planar shoelace when the problem is pure Euclidean geometry rather than geography.
What you can do with it
Parcel and region area in km²
Turn ordered GPS corners of a field, lot, or climate polygon into square kilometers via Girard spherical excess.
FAQ
What does the spherical excess polygon area calculator cost?
It is free in your browser on this page.
How is the area computed?
On a sphere of radius R (km), Girard's theorem gives area = R² |E| where E = Σ α_i − (n−2)π and each interior angle α_i is measured between successive great-circle arcs at a vertex.
What if I supply fewer than three distinct vertices?
A spherical polygon surface needs at least three distinct corners after an optional closing duplicate is dropped.
How is this different from geographic polygon area or pure spherical excess?
This tool takes lat/lon rings and returns km² via Girard interior-angle excess. The geographic polygon area tool uses a Chamberlain–Duquette ring sum in m². The pure spherical excess tool accepts triangle angles A, B, C and radius, not coordinates.
Can I change the Earth radius?
The default is 6371.0088 km (IUGG mean Earth radius). Results scale with R².
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/spherical-polygon-area \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"vertices":[[0,0],[0,1],[1,1],[1,0]]}'const res = await fetch("https://api.kit.forhosting.com/geo/spherical-polygon-area", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"vertices": [
[
0,
0
],
[
0,
1
],
[
1,
1
],
[
1,
0
]
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/spherical-polygon-area",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"vertices": [
[
0,
0
],
[
0,
1
],
[
1,
1
],
[
1,
0
]
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/spherical-polygon-area", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"vertices":[[0,0],[0,1],[1,1],[1,0]]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"vertices":[[0,0],[0,1],[1,1],[1,0]]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/spherical-polygon-area", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"vertices": [
[
0,
0
],
[
0,
1
],
[
1,
1
],
[
1,
0
]
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.spherical_polygon_area",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
lat_min | -90 |
lat_max | 90 |
lon_min | -180 |
lon_max | 180 |
max_vertices | 10000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What spherical excess polygon area means and what the response contains
The response includes the vertex count n, how many of those vertices are distinct, area_km2 as the primary unit, a companion area_m2, excess_rad, signed_excess_rad for orientation, the sum of interior angles, per-vertex interiors in radians and degrees, a clockwise or counterclockwise orientation label, the radius_km used, the unit tag km2, a short formula reminder, the precision applied, and the normalized vertex list as lat/lon objects. Degenerate rings that collapse to fewer than three distinct points after dropping a trailing closer are rejected with invalid_input rather than returning a silent zero that could look like a real plot.
How vertices, radius, and precision are read so results stay reproducible
A trailing vertex that duplicates the first within a tiny degree epsilon is treated as closed-ring notation and removed before the angle sum, so you can paste rings from GIS exporters that repeat the start point. Latitude must lie in [−90, 90] and longitude in [−180, 180]; out-of-range or non-finite coordinates fail clearly so a bad spreadsheet cell does not become a wrong square-kilometer figure. Interior angles use the unit-vector construction at each corner so the same ring always yields the same excess regardless of starting vertex order among convex simple rings. Orientation is recovered from a signed solid-angle fan so clockwise and counterclockwise rings are labeled consistently. The preferred field is vertices: an ordered array of at least three points. Each point may be a [lat, lon] pair or a {lat, lon} object; aliases latitude for lat and longitude or lng for lon are accepted so GeoJSON-adjacent objects and typed forms can reuse the same contract without renaming columns. Aliases for the whole list include points, polygon, coords, and ring. After that normalization, fewer than three distinct vertices raises invalid_input with a message that names the requirement—this is the hard product rule for the capability. Optional radius_km (aliases radius, R, and earth_radius) sets the sphere radius in kilometers and defaults to the IUGG mean Earth radius 6371.0088 km; optional precision (aliases decimals and dp) chooses decimal places for the primary area field, defaulting to six so km² values stay stable for JSON goldens while remaining readable. Pair the free browser run on this page with the priced API when you need the same mathematical result inside an automated pipeline without re-implementing Girard excess yourself.
Where spherical excess polygon area fits in mapping, teaching, and software
Survey prep and environmental reporting often need a second opinion on a ring exported from a handheld GNSS unit: pasting vertices here and comparing area_km2 to the field logger catches unit mistakes early. Contest and interview problems sometimes ask for spherical area via excess; a deterministic endpoint gives reference values for grading scripts. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Classroom Girard checks
Verify spherical excess and area for textbook rings (equatorial boxes, octant triangles) against a deterministic API.
Deterministic CI fixtures
Generate reproducible area_km2 and excess_rad values for unit tests of mapping UIs, cadastral tools, and analytics jobs.