Geographic polygon perimeter
The ring (0, 0), (0, 1), (1, 1), (1, 0) measures 444.763384955 km around, or 276.363154773 miles, along great-circle edges on a sphere. The last point joins back to the first by itself, so the loop is always closed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
When you already have a closed or ordered ring of geographic coordinates — a parcel boundary, a delivery zone, a survey transect, or a flight path that returns to its start — the quantity that matters next is the true length around the edge. Flat-map formulas underestimate or overestimate that length depending on latitude and projection. This capability accepts an ordered list of latitude and longitude vertices and returns the spherical great-circle perimeter using a fixed haversine model, so every caller gets the same meters, kilometers, or miles for the same ring.
Why planar perimeter formulas mislead on Earth
Spreadsheet formulas that treat latitude and longitude as Cartesian x and y ignore the fact that one degree of longitude shrinks toward the poles and that shortest paths between distant points follow great circles on a sphere. A fence line drawn across several degrees of longitude at high latitude is shorter than the same angular span near the equator; a “straight” edge on a Web Mercator basemap is not a geodesic.
Survey teams, logistics planners, and GIS pipelines therefore need a shared spherical definition rather than each product inventing its own local projection math. You do not choose an ellipsoid epoch or a map projection: the contract is intentionally simple, analytic, and stable for product integrations that only need a trustworthy perimeter figure.
What to send: ordered vertices and an optional unit
Values must be finite numbers with latitude in the closed interval from minus ninety to ninety and longitude from minus one hundred eighty to one hundred eighty. If the first and last points already coincide within a tiny degree epsilon, the input is treated as an explicitly closed ring and the duplicate closing vertex is not double-counted. Otherwise the last vertex is connected back to the first so the perimeter always describes a closed loop.
Optional unit selects the primary perimeter field: m for meters, km for kilometers, or mi for statute miles. The response always includes perimeter in the chosen unit plus the same length in meters, kilometers, and miles, along with segment count, ring vertex count, whether the input was already closed, and the Earth radius constant used for the haversine calculation.
What you can do with it
Parcel and fence length estimates
Turn a cadastral or drawn boundary ring into an approximate fence or wall length in meters or miles before ordering materials.
Delivery and service zone QA
Verify that imported geoJSON or admin polygons have plausible perimeters when onboarding new coverage areas.
Route loop and survey track summaries
Measure closed flight, boat, or field-walk loops from ordered GPS vertices without pulling a full GIS desktop stack.
FAQ
How is the geographic polygon perimeter calculated?
Each consecutive pair of vertices is measured with the haversine great-circle formula on a fixed mean Earth radius of 6,371,008.8 meters. The ordered ring is closed automatically when the first and last points differ, and the segment lengths are summed.
How many vertices do I need?
At least two. One point has no edge; zero points are empty. Two points form a digon-style closed loop (out and back). Typical polygons use three or more distinct vertices.
Does the input ring need to be closed already?
No. If the first and last coordinates already match within a tiny epsilon, the duplicate is not counted twice. If they differ, the service adds the closing segment from the last vertex back to the first.
Is this an ellipsoid geodesic or just a sphere?
It is a spherical great-circle (haversine) model with a constant mean radius—fast and deterministic for product use, not a full Vincenty or Karney ellipsoid geodesic. For centimeter-grade survey work, use a specialized geodesy library.
Should I simplify a noisy GPS track before measuring it?
Yes. Raw tracks with huge numbers of jittery samples add length that is not really there. Keep rings to tens or thousands of vertices and smooth the track first, so the perimeter reflects the boundary you meant.
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/polygon-perimeter \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"vertices":[{"lat":0,"lon":0},{"lat":0,"lon":1},{"lat":1,"lon":1},{"lat":1,"lon":0}]}'const res = await fetch("https://api.kit.forhosting.com/geo/polygon-perimeter", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"vertices": [
{
"lat": 0,
"lon": 0
},
{
"lat": 0,
"lon": 1
},
{
"lat": 1,
"lon": 1
},
{
"lat": 1,
"lon": 0
}
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/polygon-perimeter",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"vertices": [
{
"lat": 0,
"lon": 0
},
{
"lat": 0,
"lon": 1
},
{
"lat": 1,
"lon": 1
},
{
"lat": 1,
"lon": 0
}
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/polygon-perimeter", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"vertices":[{"lat":0,"lon":0},{"lat":0,"lon":1},{"lat":1,"lon":1},{"lat":1,"lon":0}]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"vertices":[{"lat":0,"lon":0},{"lat":0,"lon":1},{"lat":1,"lon":1},{"lat":1,"lon":0}]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/polygon-perimeter", 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": [
{
"lat": 0,
"lon": 0
},
{
"lat": 0,
"lon": 1
},
{
"lat": 1,
"lon": 1
},
{
"lat": 1,
"lon": 0
}
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.polygon_perimeter",
"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.
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
Why planar perimeter formulas mislead on Earth
This endpoint implements the classic haversine segment length on a fixed mean Earth radius and sums consecutive edges of the ordered ring, so the result is reproducible across languages, runtimes, and billing channels.
What to send: ordered vertices and an optional unit
Provide vertices as an array of objects with lat and lon (aliases latitude, longitude, and lng are accepted). At least two vertices are required; fewer points cannot define an edge and are rejected with invalid_input without charge.
How to use the result in products and pipelines
Keep rings modest—tens to thousands of vertices rather than raw GPS dumps of hundreds of thousands of samples—and simplify noisy tracks before measuring so the perimeter reflects the intended boundary rather than GPS jitter. Call the free browser tool for interactive checks, or post the same JSON contract to the API for batch jobs that validate cadastral imports, estimate fencing and cable runs, compare delivery-zone outlines, or score route loops. The published price is $0.002 per successful item; failed validation does not consume balance. When you need ellipsoid-grade geodesy or area on a reference ellipsoid, use a dedicated surveying stack; when you need a fast, shared great-circle ring length that matches across web and API, this capability is the right fit.
Technical questions
Is this free, and what does the API cost?
The in-browser tool is free and runs locally. API usage is prepaid KIT balance at $0.002 per successful request. Invalid input fails without charge.