GeoJSON coordinates are reversed (lat/lng swapped)
Your points show up in the wrong place — often in the ocean, on the wrong continent, or mirrored across the equator. The data looks fine in a spreadsheet but lands nowhere near where it should on a map.
Why it happens
GeoJSON (RFC 7946) requires every position to be ordered [longitude, latitude] — longitude first. Humans, addresses, and most APIs say "latitude, longitude" instead. When data is built from a [lat, lng] source without flipping the order, every coordinate ends up reversed. A point in Berlin (lat 52.5, lng 13.4) written as [52.5, 13.4] is read by every GeoJSON tool as longitude 52.5, latitude 13.4 — out in Kazakhstan.
How to fix it
- Open the lat/lng swap checker and paste your GeoJSON or a few coordinate pairs.
- Check whether the first number in each position exceeds ±90. Latitude is bounded to ±90, so a first value larger than that is a sure sign the order is [lat, lng] and needs swapping.
- If the data is genuinely reversed, swap the two values in every position so the order becomes [longitude, latitude].
- Re-validate the output against RFC 7946 and confirm the points now land where you expect on the map preview.
Check for reversed coordinates
Frequently asked questions
Which comes first in GeoJSON, latitude or longitude?
Longitude first. RFC 7946 mandates [longitude, latitude] order for every position. This is the opposite of how coordinates are usually spoken or written ('lat, lng'), which is the single most common cause of swapped GeoJSON.
How can I tell if my coordinates are actually swapped?
Latitude is limited to the range -90 to 90, while longitude spans -180 to 180. If the first number in any position is greater than 90 or less than -90, it cannot be a valid longitude-first GeoJSON value, so the pair is almost certainly reversed.
Do all latitudes happen to be under 90, so the check can miss some?
Yes — near the equator and prime meridian both values are small, so the range check alone can't prove correctness. In that case, compare a known point against the map: if the whole dataset is mirrored, swap it.
Does KML have the same order as GeoJSON?
No. KML uses longitude,latitude,altitude inside its <coordinates> tag, which matches GeoJSON's longitude-first convention. The mismatch problem usually comes from CSV or API data that lists latitude first.