Geographic Midpoint Calculator & Coordinate Distance

Find a true geographic midpoint or generate uniformly random coordinates within a radius.

Two tools share this page: a geographic midpoint, or centroid, of any list of two or more coordinates, and a batch of random points scattered inside a radius around a center, exportable as CSV or GeoJSON. Each one uses real spherical geometry rather than a shortcut that only looks right on a flat map, which matters most near the poles and across the antimeridian, where naive lat/lng arithmetic quietly breaks.

How to find the midpoint of coordinates

  1. Type each location's latitude and longitude in decimal degrees, such as 40.7128 and -74.0060; the page opens with New York and London already filled in.
  2. Click Add point for every extra location — there is no cap on the number of rows, and the trash button removes one.
  3. Read the centroid latitude and longitude, which update as you type; rows that are incomplete or outside -90..90 and -180..180 are skipped and counted in a notice.
  4. Click Copy centroid to get the result as "latitude, longitude" to six decimal places, ready to paste into a map search box.

The centroid is averaged on a sphere, not on a flat grid

Averaging latitude and longitude values directly gives the wrong answer almost everywhere degrees of longitude aren't a constant width — which is everywhere except the equator — and it breaks outright for points straddling the 180th meridian. The centroid here instead converts every point to a unit vector on the sphere, averages those vectors, and converts the renormalized result back into latitude and longitude, the standard spherical-centroid technique that reduces to the ordinary great-circle midpoint for exactly two points and generalizes correctly to any larger set.

Why the midpoint looks off on a flat map

Most web maps use the Mercator projection, which stretches the world more and more the farther you get from the equator. On such a map the shortest route between two northern cities is not the straight line a ruler would draw but a curve that bows toward the North Pole, and the true midpoint sits on that curve, not on the ruler line.

The default pair shows the size of the effect. New York is at 40.71°N and London at 51.51°N, and the flat average of their coordinates is 46.11°N, 37.07°W. The spherical midpoint this page returns is 52.37°N, 41.29°W, out in the North Atlantic and farther north than London itself. Drop a pin halfway along a straight line on the map and you get the flat answer; plot a great-circle line between the cities and the calculated midpoint lands right on it. South of the equator the same bow points toward the South Pole.

What a geographic midpoint is useful for

Where the haversine distance is used on this page

There is no separate two-point distance calculator here. The haversine formula, over a spherical Earth with a 6,371,000-meter radius, runs behind the random-point generator to report how far the farthest generated point sits from the center, in meters — a quick check that the scatter respects the radius you asked for. That figure lands slightly under the radius, partly because no random point sits exactly on the edge and partly because the offsets are laid out at 111,320 meters per degree while the check measures on a sphere whose degree is about 0.1 percent shorter. Neither model captures the Earth's small flattening the way a surveying-grade ellipsoid would.

Random points are spread by area, not by a straight radius draw

Picking a random distance uniformly between zero and the radius, then a random angle, sounds like it should scatter points evenly across a circle — it doesn't, because that approach packs points more densely near the center. The generator instead samples the radius as R times the square root of a uniform random value, which correctly spreads points evenly across the circle's area, and separately corrects the longitude offset by dividing by the cosine of the center's latitude so points near a high-latitude center aren't squeezed by the compression of longitude lines up there.

This particular generator draws from Math.random by default, not from a cryptographic source — it's built for scattering plausible test markers across a map, not for anything where the positions need to be unpredictable to an adversary. Each batch holds up to 5,000 points, with the radius in meters or kilometers. Results can be copied as a plain decimal list or downloaded as a CSV with lat and lng columns or as a GeoJSON FeatureCollection in the [longitude, latitude] coordinate order the GeoJSON spec requires.

No address ever gets looked up here

Every input on this page is a raw decimal coordinate, and nothing on it calls a geocoding or mapping service — there's no way to type a city name or street address and have it resolved to a point. Row validation checks only that a latitude sits between -90 and 90 and a longitude between -180 and 180, catching an obvious typo like a transposed pair of coordinates, not whether the resulting point corresponds to anywhere real; plenty of validly-formatted random points will land in open ocean.

Questions people ask about Geographic Centroid & Coordinate Generator

What's the difference between a midpoint and a centroid?
A midpoint usually means two locations: the point halfway along the great circle joining them. With three or more, this page returns the centroid, averaging the points as 3D vectors and projecting back to the surface. That is the geographic center of gravity, not the spot that minimizes total travel distance, which can differ for lopsided groups.
Why does my midpoint look too far north on the map?
Because the map is flat and the Earth isn't. Mercator-style web maps turn great-circle routes into curves that bulge toward the pole, so the real halfway point sits north of a straight ruler line between two northern-hemisphere places. New York and London meet at 52.37°N, north of both cities.
What happens with points on opposite sides of the Earth?
Exactly antipodal points, such as 0, 0 and 0, 180, have no single midpoint: every spot on the great circle lying 90 degrees from both is equally halfway. Their vectors cancel out, so the tool falls back to a plain average of the numbers, which is a placeholder rather than a meaningful answer. Nearly antipodal sets swing wildly with tiny input changes.
Can I weight some locations more than others?
There is no weight field; every valid row counts once. To give a location more pull, enter its coordinates in several rows — three identical rows for an office with three attendees, for example — and the centroid shifts toward it in proportion.
Why isn't the centroid of two coordinates just the average of their latitudes and longitudes?
A flat average is only correct very close to the equator, where a degree of longitude is roughly the same physical width as a degree of latitude. Everywhere else that width shrinks toward the poles, so a naive average drifts off the true midpoint, and it fails outright for points on opposite sides of the antimeridian — which is why this tool works through unit vectors on a sphere instead.
Are the randomly generated points around a center point cryptographically secure?
No. This generator uses the browser's ordinary Math.random by default, not a cryptographic random source, since it's meant for scattering realistic-looking test markers on a map rather than for anything security-sensitive. If unpredictability matters for your use case, this isn't the right random source.
Can I type in a city or place name instead of coordinates?
No — this tool works exclusively with decimal latitude and longitude values you provide directly, and it never calls a geocoding service to resolve an address or place name into coordinates. You'll need to look up the decimal coordinates elsewhere first.
What format is the GeoJSON export, and will mapping software open it?
It's a standard GeoJSON FeatureCollection with one Point feature per generated location, coordinates ordered [longitude, latitude] per the RFC 7946 specification. That's the format most mapping tools, including Turf.js-based pipelines and common GIS software, expect for point data out of the box.

Related tools on BrakeTools

Content reviewed 2026-09-27.