Latitude is the Y coordinate. On any standard map or graph where the horizontal axis runs east-west and the vertical axis runs north-south, latitude measures your position along the vertical (Y) axis, while longitude measures your position along the horizontal (X) axis. That sounds simple enough, but the reason this question gets asked so often is that real-world coordinate systems, GPS readouts, and software standards cannot seem to agree on which number comes first, and the resulting confusion has launched a thousand misplaced map pins.
Why Latitude Maps to Y and Longitude Maps to X
Think of a globe flattened into a rectangle, the way most wall maps present the world. The equator stretches across the middle as a horizontal line, and the North and South Poles sit at the top and bottom. Latitude tells you how far north or south you are from the equator, which means it measures vertical position. On a graph, vertical position is the Y axis. Longitude tells you how far east or west you are from the Prime Meridian, which means it measures horizontal position, the X axis.
The ranges reinforce this. Latitude runs from −90° (South Pole) to +90° (North Pole), a relatively short span that corresponds to the shorter vertical dimension of most map projections. Longitude runs from −180° to +180°, spanning the full horizontal width. If you were to plot a point using the familiar (X, Y) notation from math class, you would write it as (longitude, latitude). And that is exactly where the trouble starts.
The Ordering Problem That Confuses Everyone
In everyday speech and most GPS displays, people say “latitude and longitude” in that order. Your phone might show your location as something like 40.7128° N, 74.0060° W, with latitude first. Navigation charts, aviation references, and geography textbooks almost universally put latitude before longitude. That means the convention in geography is (Y, X), the reverse of what math and computer graphics use.
This is not a trivial mismatch. When a programmer builds a mapping application and receives coordinates as a pair of numbers, the order determines whether a point lands in the right country or in the middle of the ocean. Latitude-first conventions place the Y value before the X value, which breaks the assumption most graphing and rendering systems make. It is one of the most common sources of bugs in geospatial software, and seasoned developers still trip over it regularly.
How Software Standards Handle Coordinate Order
Different standards have made different choices about whether to follow the geographic tradition of latitude-first or the mathematical tradition of X-first. The lack of a single universal convention is arguably the root cause of the entire “is latitude X or Y” question.
The GeoJSON format, one of the most widely used standards for encoding geographic data on the web, explicitly requires longitude before latitude. The specification states that in a GeoJSON position array, the first two elements are longitude and latitude, in that order, using decimal numbers.1RFC Editor. The GeoJSON Format This follows the mathematical (X, Y) convention, so a point in New York City would be encoded as roughly [−74.006, 40.713], not [40.713, −74.006].
Google Maps and many other consumer mapping APIs, on the other hand, accept latitude first. If you paste “40.7128, −74.0060” into Google Maps, it correctly identifies New York. Swap those numbers and you end up somewhere in the ocean south of Africa. The KML format used by Google Earth also puts latitude first. Meanwhile, the Well-Known Text (WKT) format used in many GIS databases puts longitude (X) first. PostGIS, a popular geospatial database extension, also uses (longitude, latitude) internally.
If you work with the ISO 6709 standard for representing geographic point locations, coordinates go latitude-first. But if you work with the OGC (Open Geospatial Consortium) standards, many of those use X-first. The situation is, to put it mildly, a mess. There is no single “correct” order across all systems, only the question of which convention a particular system follows. The one thing every system agrees on is what latitude and longitude represent: latitude is the north-south (vertical/Y) value and longitude is the east-west (horizontal/X) value. The disagreement is solely about which to list first when writing them as a pair.
Practical Consequences of Getting the Order Wrong
Swapping latitude and longitude in software does not just produce a slightly wrong result. It can produce a wildly wrong one. Latitude values are constrained between −90 and +90, while longitude values range from −180 to +180. If you accidentally feed a longitude value of −122 (San Francisco) into a latitude field, most systems will either reject it as out of range or try to interpret it in some mangled way. But if both values happen to fall within the overlapping range of −90 to +90, the swap goes undetected and the point silently lands in the wrong location.
This class of error has real-world consequences in logistics, ride-sharing, emergency dispatch, and any service that routes based on coordinates. Monitoring the accuracy of coordinate transformations across different systems is a recognized concern in geospatial engineering, where even small software inconsistencies in converting between coordinate systems can cascade into significant positional errors.2E3S Web of Conferences. Monitoring of spatial data coordinate basis integrity using coordinate transformations A developer who assumes all incoming data arrives as (latitude, longitude) and receives GeoJSON data, which uses (longitude, latitude), will flip every single point in the dataset.
A useful sanity check: if you are plotting locations in the continental United States, latitude values should roughly be between 25 and 50, and longitude values should roughly be between −65 and −125. If you see a coordinate pair and the larger-magnitude number is in the latitude slot, something has probably been swapped.
Why the Geographic Convention Puts Y Before X
The latitude-first tradition predates Cartesian graphing by centuries. Sailors and astronomers measured latitude long before longitude was practical to determine. Latitude can be calculated by observing the angle of the sun or a known star above the horizon, a technique ancient navigators used routinely. Longitude, by contrast, required accurate timekeeping to measure, and reliable marine chronometers did not exist until the eighteenth century. Because latitude came first historically, it naturally came first verbally and in notation.
By the time mathematicians standardized the (X, Y) convention for Cartesian coordinates, the geographic community had been writing (latitude, longitude) for hundreds of years. Neither group changed to match the other, and we have been living with the collision ever since. The geographic convention is not “wrong” in any absolute sense. It is simply a different ordering convention rooted in a different history, and treating either tradition as the universal default is what causes errors.
When Latitude and Longitude Are Not X and Y at All
Mapping latitude to Y and longitude to X works well on a flat map, but the Earth is not flat. Latitude and longitude are angular measurements on a curved surface, measured in degrees. The X and Y axes of a Cartesian grid, meanwhile, are straight lines measured in linear units like meters or pixels. Converting between the two requires a map projection, a mathematical transformation that stretches and distorts the sphere to fit a flat surface. Every map projection makes trade-offs: some preserve area, some preserve shape, some preserve direction, and none preserve everything.
On a Mercator projection, which is what most web maps use, the relationship between latitude and Y is not even linear. Near the equator, a degree of latitude corresponds to a certain number of pixels on screen. Near the poles, that same degree of latitude gets stretched into far more pixels, which is why Greenland looks enormous on Google Maps despite being smaller than the Congo. So while it is correct to say latitude is the Y coordinate in a general conceptual sense, the actual numerical relationship between a latitude value and a Y pixel position depends entirely on the projection being used and the zoom level of the map.
In three-dimensional systems used by GPS satellites and aerospace engineering, the Earth’s surface is not described with a flat X-Y grid at all. Instead, positions are often expressed in Earth-Centered, Earth-Fixed (ECEF) coordinates, where X, Y, and Z are linear distances from the center of the Earth. In that system, latitude and longitude get converted into three Cartesian values, and the X axis points toward the intersection of the Prime Meridian and the equator, not “east.” So the X in ECEF has nothing to do with the X you would associate with longitude on a flat map. Context determines everything.
Not All Latitudes Are the Same
Another layer of complexity that most people never encounter is that “latitude” is not a single concept. The latitude displayed on your phone is geodetic latitude, which is defined as the angle between the equatorial plane and a line perpendicular to the surface of a reference ellipsoid (a slightly squashed sphere that approximates the Earth’s shape). But there is also geocentric latitude, which is the angle measured from the Earth’s center. Because the Earth bulges at the equator, these two values differ slightly at most locations.
The difference between geodetic and geocentric latitude is small, generally less than about 0.2°, which translates to roughly 20 kilometers on the ground. For everyday navigation, this is handled invisibly by your GPS receiver and the coordinate reference system it uses. But in geodesy, surveying, and satellite positioning, the distinction matters. Mathematical expansions relating these different latitude types to each other have been a topic of ongoing refinement, with researchers working to produce more uniform and accurate conversion formulas based on the properties of the reference ellipsoid.3Applied Sciences. Simplified Expansions of Common Latitudes with Geodetic Latitude and Geocentric Latitude as Variables A programmer who mixes geodetic and geocentric latitude values without converting between them will introduce a positional error that varies with location, being zero at the equator and poles and largest at mid-latitudes around 45°.
How People Actually Think About Maps
Beyond software and math, there is a human-cognition dimension to why the X-versus-Y question trips people up. Research on spatial cognition has found that people do not naturally orient their mental maps according to cardinal directions at all. In experiments where pedestrians navigated a familiar real-world environment, participants had difficulty pointing north accurately. Instead, their estimates of north tended to align with local features like roads and building edges rather than the actual cardinal axis.4PubMed Central. The Map in Our Head Is Not Oriented North: Evidence from a Real-World Environment. When recalling locations from memory, people were fastest and most accurate when mentally aligned with streets rather than with a north-south axis.
This matters because the entire latitude-is-Y framework assumes a north-up map orientation, which is a convention rather than a cognitive default. People relate to maps through landmarks and routes, not through abstract axes. That is partly why the question “is latitude X or Y” feels unintuitive even after you learn the answer: your brain does not naturally parse the world into a Cartesian grid, so the mapping of geographic coordinates to graph axes never quite sticks on its own. It has to be remembered as a rule, not grasped as something visually obvious.
Quick Rules for Keeping Coordinates Straight
If you deal with coordinates in any practical context, a few habits can save you from the most common errors:
- Read the documentation: Every API, file format, and database has a specified coordinate order. Never assume it matches what you used last time. GeoJSON uses (longitude, latitude). Google Maps uses (latitude, longitude). Check every time.
- Label your axes: When storing coordinates in a spreadsheet or database, name the columns “latitude” and “longitude,” not “x” and “y.” The ambiguity of x and y is exactly the problem you are trying to avoid.
- Sanity-check ranges: Latitude must be between −90 and +90. Longitude must be between −180 and +180. If a “latitude” value is −122, it has been swapped.
- Use named parameters: When calling a function that takes coordinates, pass values as named arguments (latitude=40.7, longitude=−74.0) rather than positional arguments (40.7, −74.0). Named parameters eliminate ordering ambiguity entirely.
These habits sound obvious in isolation, but the frequency with which experienced engineers make coordinate-swap mistakes suggests that “obvious” and “automatic” are not the same thing. The underlying conceptual answer never changes: latitude is vertical, Y; longitude is horizontal, X. The operational headache is that the world has agreed on the definition but not on the notation, and probably never will.
Negative Coordinates and Hemisphere Conventions
A related point of confusion involves the sign of latitude and longitude values. In the signed decimal format used by most software, northern latitudes are positive and southern latitudes are negative. Eastern longitudes are positive and western longitudes are negative. So Buenos Aires at roughly 34.6°S, 58.4°W becomes (−34.6, −58.4) in latitude-longitude order, or (−58.4, −34.6) in longitude-latitude order. Both numbers are negative, so the range check described above still works: −34.6 is a valid latitude, and −58.4 is a valid longitude, but not vice versa.
Some older formats and certain aviation and maritime systems use a different convention: degrees, minutes, and seconds with a hemisphere letter (like 34°36′S, 58°22′W). These formats are unambiguous about which value is latitude and which is longitude, because the N/S/E/W suffix tells you. But they are harder to feed into software that expects plain decimal numbers, so conversion is often needed. During that conversion, dropping a negative sign or misassigning the hemisphere letter to the wrong number is another classic source of location errors. The core principle remains the same: latitude is always the north-south measurement, always the Y-axis equivalent, regardless of what format wraps around it.