Location technology
Latitude First or Longitude First? Coordinate Order
Which comes first in a coordinate pair? Learn why latitude-longitude and longitude-latitude both exist, and how to spot swapped values.
Updated 14 October 2026 · 3 min read
In everyday speech and most consumer apps, latitude comes first and longitude second: 48.8566, 2.3522. Many software formats and libraries do the opposite and put longitude first, because they treat the pair as x and y on a map. Both orders are common, which is why swapped coordinates are one of the most frequent mapping bugs.
Why two orders exist
Latitude is the north-south value and longitude the east-west value. When geographers and sailors write a position by hand, they traditionally say latitude first. Mathematics and computer graphics, on the other hand, write points as x then y. Longitude runs east-west like the x axis and latitude runs north-south like the y axis, so a system built around x and y naturally writes longitude then latitude.
Where you will meet each order
- Latitude, then longitude: phone map apps, most search boxes, GPS devices, and many REST APIs that name the fields explicitly.
- Longitude, then latitude: GeoJSON, many spatial databases and several mapping libraries when coordinates are passed as arrays.
When a service accepts named fields such as lat and lng, order does not matter, which is the safest way to pass values. When it accepts an array or a single comma-separated string, read the documentation carefully.
How to catch a swap
- Check the range. Latitude cannot be larger than 90 in absolute value. If the first number is 120, it is a longitude.
- Plot it. Paste the pair into a map. A point in the middle of the ocean, or in Antarctica when you expected a city, usually means a swap.
- Compare with a known place. If other points in your data set are correct, see which order matches them.
A tricky case is a place where both values are below 90, such as parts of Europe. Here the range check cannot help, so you need to plot or compare.
Habits that prevent mistakes
- Store latitude and longitude in separate, clearly named fields rather than in one string.
- Document the order wherever you pass pairs between systems.
- Validate input ranges when data is imported.
- Remember that signs matter too, as covered in positive and negative coordinates.
If you are new to the two values themselves, read what latitude and longitude are first. UPCS API calls name the fields latitude and longitude (or lat and lng), which removes the ambiguity entirely.
Frequently asked questions
How can I tell if my coordinates are swapped?
Plot the point and see whether it lands where you expect. A latitude can never exceed 90 in absolute value, so any first value above 90 means the pair is reversed.
Does GeoJSON use latitude first?
No. GeoJSON lists longitude first, then latitude.
