Generate random latitude and longitude pairs inside a bounding box, exported as plain text, CSV or GeoJSON. Handy for seeding map tests and spatial fixtures, with an honest note about how a rectangular draw differs from an equal-area draw on a sphere.
Settings
Recent results
Generated locally in your browser β your settings and results never leave this page.
Reading a coordinate pair
A coordinate names a point on a sphere with two angles. Latitude runs from -90 at the South Pole through 0 at the equator to 90 at the North Pole. Longitude runs from -180 to 180, measured east and west of the prime meridian, with the two extremes meeting at the antimeridian in the Pacific.
The sign convention matters and is easy to get wrong. Negative latitude is southern, negative longitude is western. A dropped minus sign moves a point to the opposite hemisphere, which is the kind of error that produces a map marker in the sea and no error message at all.
Precision and what it costs
Each additional decimal place multiplies precision by ten. A degree of latitude is close to 111 kilometres everywhere, so one decimal place resolves about 11 kilometres, three places about 111 metres, six places about 10 centimetres. Longitude behaves differently: a degree is 111 kilometres at the equator and shrinks toward the poles, reaching zero where the meridians meet.
More precision is not automatically better. Storing coordinates to eight decimal places implies a millimetre-level accuracy that no consumer positioning system delivers, and it wastes space while suggesting a confidence the data does not have. Six places is the usual choice in mapping datasets and is already generous.
Why a rectangular draw is not an equal-area draw
Drawing latitude uniformly between two bounds treats every degree band as equivalent. On a sphere they are not. The band between 0 and 1 degrees of latitude wraps the whole equator and covers an enormous area; the band between 89 and 90 degrees is a small cap around the pole. Uniform latitude therefore puts proportionally more points near the poles than an equal-area draw would.
The correction is to draw the sine of the latitude uniformly rather than the latitude itself. This tool does not, and says so in the note under the result, because for the common use β scattering points across a city, a country or a test region β the distortion is imperceptible, and the simpler behaviour is easier to reason about. If you are modelling something genuinely global where area matters, the distinction is real.
Land, sea and the absence of map data
A worldwide draw produces mostly ocean, because most of the surface is ocean. There is no map here and no way to filter for land: doing so would require a geographic dataset that the tool deliberately does not carry. Constraining the bounding box to the region you actually care about is both the simpler and the more useful approach, and it makes the resulting points relevant to whatever you are testing.
Coordinate order is a real bug source
People say “latitude, longitude”. GeoJSON writes longitude first. So does the underlying specification it inherits from, and so do several mapping libraries β while others use the spoken order. The result is a well-known category of bug where markers appear rotated into the wrong hemisphere, most visibly when a point meant for a European city lands in the ocean off Africa.
The GeoJSON export here follows the specification, longitude first. The CSV export names its columns, so there is nothing to infer. When integrating with any mapping library, checking the expected order against a known landmark is a minute well spent.
Testing the edges
Two boundaries reliably expose problems. The antimeridian at Β±180 degrees, where a region spanning it has a minimum longitude greater than its maximum, breaking naive range checks. And the poles, where longitude ceases to be meaningful and distance calculations can divide by zero. Generating points near both is a cheap way to find out whether your code handles them.
Privacy
Coordinates are generated in your browser. Nothing is transmitted, stored or logged, and no location data of yours is read.
How to use the Random Coordinates Generator
- Set the latitude and longitude bounds of the area you want, or leave them at the defaults for the whole world.
- Choose how many decimal places each value should carry.
- Set how many points to generate.
- Generate, then export as plain text, CSV or GeoJSON.
Frequently asked questions
What are latitude and longitude?
Latitude measures how far north or south a point is, from -90 at the South Pole to 90 at the North Pole. Longitude measures east or west from the prime meridian, from -180 to 180. Together they identify any point on the surface of the Earth.
What precision do I need?
A degree of latitude is about 111 kilometres. Four decimal places locates a point to roughly 11 metres, five to about a metre, six to around 10 centimetres. Six is the common default in mapping data and is far more precision than most applications can justify.
Are the points evenly spread over the globe?
They are evenly spread over the latitude/longitude rectangle, which is not the same thing. Lines of longitude converge toward the poles, so equal steps of latitude cover progressively smaller areas of real surface. The result is a mild clustering toward the poles compared with a true equal-area draw. Over a small region the difference is negligible.
Will the points be on land?
Most will not. Oceans cover roughly seven-tenths of the Earth, so a worldwide draw lands in water far more often than on land. The tool has no map data and cannot tell the difference. Narrowing the bounding box to a landmass is the practical way to get usable points.
What is GeoJSON and why does the order look reversed?
GeoJSON is the standard format for exchanging geographic data, understood by most mapping libraries. It specifies coordinates as longitude first, then latitude β the opposite of the latitude-first order people usually speak in. That reversal is a frequent source of bugs, so the tool emits the correct order and the CSV export labels its columns explicitly.
Can I use these to test a mapping application?
Yes, that is the main use. Generating points inside a bounding box lets you populate a map with markers, exercise clustering behaviour, and check that your code handles negative values and the boundaries at the poles and the antimeridian correctly.
What happens at the edges of the range?
Longitude wraps at 180 degrees, where east meets west, and code that assumes a straight numeric comparison often breaks on a region spanning that line. Latitude does not wrap β it stops at the poles. Generating values near both extremes is a quick way to find out whether your code copes.