ForHosting KIT · Travel & geography

Vincenty distance calculator

From 50.06638889, -5.71472222 to 58.64388889, -3.07 the ellipsoidal distance is 969.9329875586 km, leaving on a bearing of 9.1423286009°. Enter two points in decimal degrees for a result that follows Earth's flattening, not a mean sphere. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Lat1
50.06638889
Lon1
-5.71472222
Lat2
58.64388889
Lon2
-3.07
You get
Distance m
969,932.9875585939
Distance km
969.9329875586
Initial bearing deg
9.1423286009
Final bearing deg
11.2977211188

Vincenty inverse distance answers a surveying and navigation question that a simple spherical formula leaves slightly wrong on long routes: how far is the geodesic surface path between two geodetic coordinates on the real WGS-84 ellipsoid, not on a mean sphere. GIS engineers, surveyors, aviation planners, and logistics platforms use that ellipsoidal length when map projections are overkill but metre-class consistency still matters across continents. Near-antipodal pairs that refuse to converge fail with a clear invalid input error instead of inventing a distance. Out-of-range coordinates are rejected the same way.

Why an ellipsoid gives a better distance than a sphere

Earth is slightly flattened at the poles, so a formula that treats it as a perfect sphere, such as haversine, carries a small but systematic bias on long routes. Vincenty's inverse method works on the WGS-84 ellipsoid instead, with its fixed equatorial radius of 6,378,137 metres and its flattening. It repeats a correction of the longitude difference until the change becomes tiny, then reports the length of the shortest path along the ellipsoid surface together with the bearing at departure and at arrival. The result is given in both metres and kilometres.

When to use it and what to watch for

Use it to estimate the true surface distance and initial course between two airports or ports, or wherever metre-level consistency matters across continents. Metres suit survey corridors and runway-scale work; kilometres suit intercity and ocean legs. Enter latitudes from -90 to 90 and longitudes from -180 to 180 in decimal degrees, because values outside those ranges are rejected rather than quietly corrected. Points that are almost exactly opposite each other on the globe can stop the method from settling on an answer, and in that case you get a clear error instead of an invented distance.

What Vincenty distance measures and how to supply the two points

Vincenty’s inverse problem starts from two geodetic latitudes and longitudes on an oblate spheroid and solves for the length of the shortest surface path that stays on that ellipsoid, together with the forward azimuth at the first point and the reverse azimuth at the second. Unlike haversine on a sphere of fixed radius, the iteration accounts for Earth flattening through reduced latitudes and a longitude difference update until the longitude residual falls below a tight tolerance.

Send required fields lat1 and lon1 for the first WGS-84 point and lat2 and lon2 for the second, all in decimal degrees. Latitude must lie between minus ninety and ninety inclusive; longitude must lie between minus one hundred eighty and one hundred eighty inclusive. Coincident points return zero distance with zero bearings and zero iterations without entering the loop.

Long-haul route planning

Estimate true WGS-84 surface distance and initial course between two airports or ports when a spherical haversine would leave a small but systematic bias.

What happens for near-antipodal points?

The classical Vincenty iteration may fail to converge.

Is this the same as haversine distance?

No. Haversine assumes a sphere. Vincenty models the WGS-84 ellipsoid with flattening, so long geodesics are more accurate for survey-grade and intercontinental work.

Is the Vincenty distance calculator free?

The browser tool runs free on your device.

What is the difference between the initial and final bearing?

The initial bearing is the direction you leave the first point in, measured clockwise from true north. The final bearing is the direction you are travelling as you arrive at the second point. On a long route they differ, as with 9.1423286009° and 11.2977211188° in the example.

What happens if I enter the same point twice?

You get a distance of zero, both bearings set to zero and zero iterations. The calculation recognises coincident points straight away instead of running the iterative method.

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.

POSThttps://api.kit.forhosting.com/geo/vincenty-distance

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.

curl -X POST https://api.kit.forhosting.com/geo/vincenty-distance \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat1":50.06638889,"lon1":-5.71472222,"lat2":58.64388889,"lon2":-3.07}'
{
  "lat1": 50.06638889,
  "lon1": -5.71472222,
  "lat2": 58.64388889,
  "lon2": -3.07
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.vincenty_distance",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This capability takes two latitude and longitude pairs, runs the classic Vincenty iteration with fixed WGS-84 semi-major axis and flattening, and returns metres, kilometres, and initial and final bearings as deterministic JSON.

What Vincenty distance measures and how to supply the two points

Aliases such as from_lat, to_lat, from_lon, to_lon, latitude1, and longitude1 are accepted when your client already uses those names. Any coordinate outside those ranges raises invalid_input with a message that names the field and the bound, so callers never silently clamp bad GPS noise into a fake geodesic. Identical inputs always produce identical JSON because the path is pure arithmetic with fixed WGS-84 constants, no wall clock, and no external map service.

Reading metres, kilometres, bearings, iterations, and convergence

Prefer metres for survey corridors and runway-scale work; prefer kilometres for intercity and oceanic legs. On success the response echoes every input coordinate, then reports distance_m and distance_km as the ellipsoidal geodesic length. initial_bearing_deg is the forward azimuth at the first point measured clockwise from true north on the zero-to-three-hundred-sixty interval; final_bearing_deg is the corresponding reverse azimuth at the second point after the geodesic arrives. iterations counts how many longitude updates the solver needed before the residual fell below the published epsilon, which helps diagnose borderline pairs without re-running the loop by hand. ellipsoid is always the string WGS-84, a_m is the semi-major axis in metres, and f is the flattening, so downstream code can assert the datum without hard-coding constants in every client. method is always vincenty_inverse and converged is true on every successful response. When two points are nearly antipodal the classical iteration may never settle; the engine stops at a hard iteration cap and raises invalid_input with a message that names near-antipodal failure rather than returning a half-finished distance. Validation failures for missing fields, non-finite numbers, and out-of-range coordinates likewise fail closed and are not charged under the prepaid API.

API usage, pricing, GIS workflows, and practical limits

Send a JSON body with the four required coordinates, then call the free in-browser Vincenty distance calculator for classroom demos, chart checks, and quick mental verification without installing PROJ, GeographicLib, or a full GIS stack. Use the prepaid API when a logistics platform, flight-planning tool, cadastral workflow, or simulation harness needs a stable contract under KIT balance at $0.002 per successful item; validation failures and non-converging antipodes never consume balance after the engine rejects the request. Pair this endpoint with your own geocoder when you need place names: this product only measures geometry on the WGS-84 ellipsoid. For ordinary continental separations Vincenty is accurate to well under a metre relative to modern geodesic libraries; for the thin band of near-antipodal cases where the 1975 iteration diverges, switch to a specialized antipodal solver or a Karney-style geodesic rather than forcing this endpoint.

Survey and cadastral distance checks

Compare field GPS endpoints against an ellipsoidal geodesic length in metres for boundary legs and control-network QA without spinning up a full GIS desktop.

Classroom geodesy and exam oracles

Students solve Vincenty worksheet pairs by hand; graders pin deterministic distance and bearing JSON from the same lat/lon values used in the problem set.

How do I compute Vincenty distance between two points?

Send JSON with lat1, lon1, lat2, and lon2 in decimal degrees. The response includes distance_m, distance_km, initial_bearing_deg, and final_bearing_deg on the WGS-84 ellipsoid.

Which datum and constants are used?

Always WGS-84: semi-major axis a = 6378137 m and flattening f = 1/298.257223563. The response echoes ellipsoid, a_m, and f on every success.

Read the full KIT documentation →