ForHosting KIT · Travel & geography

Geographic midpoint calculator

The halfway point between 40.7128, -74.006 and 34.0522, -118.2437 is 39.51030757, -97.16013189: the middle of the shortest path over the globe, not a plain average of the two latitudes and longitudes. 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
40.7128
Lon1
-74.006
Lat2
34.0522
Lon2
-118.2437
You get
Latitude
39.51030757
Longitude
-97.16013189

When you need the halfway point between two places on Earth, a simple average of latitudes and longitudes is wrong for most routes. Enter four decimal-degree coordinates, receive a single latitude and longitude you can drop into a map, a logistics plan, or a field report.

Why a great-circle midpoint beats a flat average

People often average two latitudes and two longitudes and call the result the middle. That flat mean only works for short distances near the equator. On a sphere, longitudes converge toward the poles, and the shortest path between cities is an arc of a great circle, not a straight line on a paper map.

Averaging angles can place the result off the actual route, especially when the segment crosses high latitudes or the antimeridian. The method used here converts each point into a three-dimensional unit vector, averages those vectors, normalizes the sum, and converts the result back to latitude and longitude with atan2. Use it for aviation legs, shipping corridors, radio-link planning, survey baselines, and any workflow where “halfway” must mean equal geodesic distance along the shortest path rather than a cartographic convenience.

How to supply coordinates and read the result

Latitude must fall in the closed interval from −90 to 90; longitude must fall in the closed interval from −180 to 180. Positive latitude is north of the equator; positive longitude is east of the prime meridian. Nearly antipodal pairs, where the vector sum is effectively zero and every direction is equally valid as a midpoint, are rejected instead of inventing an arbitrary answer.

No geocoding, reverse lookup, or elevation model is applied; you already know the coordinates you care about.

Practical limits, precision, and integration notes

This capability models Earth as a perfect sphere for the purpose of angular midpoint calculation. That is the standard great-circle assumption used in navigation primers and most lightweight geo utilities. It does not apply an ellipsoid (WGS84 geodetic distance), terrain, airways, or political borders.

For city-to-city planning and most logistics sketches the spherical midpoint is more than adequate; for high-precision surveying you may still want an ellipsoidal library downstream. The algorithm is pure arithmetic: no network calls, no randomness, and no clocks, so it is safe inside automated tests and offline runners. Pair the output with your own mapping stack—Leaflet, MapLibre, Google Maps, or a CAD layer—by treating lat and lon as ordinary WGS84-style decimal degrees ready for display.

Logistics and fleet staging

Place a temporary depot, fuel stop, or meeting point roughly equidistant along the great-circle path between two warehouses or ports.

Flight and radio path planning

Estimate the halfway position on an airway or line-of-sight link before refining with specialized aviation or RF tools.

Is this the same as averaging latitude and longitude?

No. A flat average of degrees ignores spherical geometry. This tool averages unit vectors on the sphere so the result lies on the great-circle arc between the two points.

What coordinate ranges are accepted?

Latitude must be between −90 and 90 inclusive; longitude between −180 and 180 inclusive.

What happens for antipodal points?

If the two points are opposite on the globe (or numerically degenerate), every midpoint on the perpendicular great circle is equally valid. The capability rejects that case instead of picking an arbitrary location.

Does it use a WGS84 ellipsoid?

No. It uses the classic spherical great-circle construction. For most planning and mapping this matches common navigation practice; use an ellipsoidal library when sub-meter geodesy is required.

What is a geographic midpoint useful for?

It places a meeting point, depot or fuel stop roughly equidistant along the route between two warehouses or ports, and it gives a first estimate of the halfway position on a flight leg, a radio link or a survey baseline.

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/midpoint

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/midpoint \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat1":40.7128,"lon1":-74.006,"lat2":34.0522,"lon2":-118.2437}'
{
  "lat1": 40.7128,
  "lon1": -74.006,
  "lat2": 34.0522,
  "lon2": -118.2437
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.midpoint",
  "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 calculator returns the true great-circle midpoint: the location that sits in the middle of the shortest path over the globe between your two endpoints. Everything runs as deterministic analytic geometry with no external services, so the same inputs always produce the same answer and your coordinates never leave the request path.

Why a great-circle midpoint beats a flat average

The midpoint therefore lies on the sphere surface along the great-circle route between the endpoints.

How to supply coordinates and read the result

Provide lat1 and lon1 for the first endpoint and lat2 and lon2 for the second, all in decimal degrees. Values outside those ranges are rejected with an invalid_input error so a typo cannot produce a quiet, meaningless map pin. The response echoes the four input numbers and adds lat and lon for the midpoint, rounded to eight decimal places—more than enough for mapping and GIS while remaining stable across platforms. Identical endpoints return the same point.

Field survey and research

Compute a spherical midpoint for transect centers, sample sites, or event basemaps when only endpoint coordinates are known.

How much does the API cost?

The browser page runs locally for free on desktop and mobile. The same computation via the API is billed at $0.002 per request from prepaid KIT balance.

Read the full KIT documentation →