X is Longitude, Y is Latitude

Caitlin Dempsey

Major content update:

Minor updates:

Screenshot from QGIS showing the interface for adding a CSV file with a red circle around the dropdown menus for designated the X and Y fields.

Even though I’ve been working with GIS data for more than two decades, I still have moments when I stop and think, “Wait… is X longitude or latitude?” Usually I catch myself before assigning the fields, but every once in a while I don’t.

It’s one of those things that seems obvious until you’re staring at a CSV file with columns labeled X and Y and suddenly second-guess yourself. If you’ve ever loaded a dataset only to discover your points landed somewhere they definitely weren’t supposed to, you’re not alone.

Fortunately, the answer is simple:

  • X = Longitude
  • Y = Latitude

Here’s why that convention exists and a few tricks for remembering it.

What are latitude and longitude?

Understanding the difference between latitude and longitude makes it much easier to remember why GIS software stores longitude as the X coordinate and latitude as the Y coordinate.





Latitude measures how far north or south a location is from the Equator. Latitude values range from 0° at the Equator to 90° north or south at the poles. Lines of latitude, also called parallels, run east-west around the globe and remain the same distance apart.

Two globes of the world one with up and down arrows to point to lines of latitude and with with side to side arrows point to lines of latitude.
Geographic coordinates use positive and negative values to indicate position relative to the Equator and the Prime Meridian. Locations north of the Equator and east of the Prime Meridian have positive values, while locations south of the Equator and west of the Prime Meridian have negative values. Maps: Caitlin Dempsey.

Latitude values can be expressed as positive and negative numbers or as north and south of the Equator. Positive latitude values are in the Northern Hemisphere, while negative values are in the Southern Hemisphere.

Longitude measures how far east or west a location is from the Prime Meridian, the 0° line of longitude that runs from the North Pole to the South Pole through Greenwich, England. Longitude values extend to 180° east and 180° west. Lines of longitude are called meridians. Unlike lines of latitude, meridians converge at the poles and are farthest apart at the Equator.

Longitude values can be expressed as positive and negative numbers or as east and west of the Prime Meridian. Positive longitude values are east of the Prime Meridian, while negative values are west of it.

A map with text showing the four quadrants of the globe that are north or south of the Equator and East or West of the Prime Meridian.
X and Y values are either positive or negative depending on whether the location is north or south of the Equator and east or west of the Prime Meridian. Map: Caitlin Dempsey.

How geographic data is stored in GIS

A location on Earth can be described by a pair of geographic coordinates: latitude and longitude. In GIS, those coordinates are typically stored in separate fields within a dataset. Longitude values are stored in the X field and latitude values are stored in the Y field.

Depending on the dataset, these fields may be labeled Longitude and LatitudeX and Y, or something less obvious. Understanding which field contains each coordinate is essential when importing data into GIS software.

For example, the dataset below lists the highest point in every U.S. state. The highlighted columns contain the geographic coordinates for each location. Because every point is in the continental United States, Alaska, or Hawaii, all longitude values are negative since they lie west of the Prime Meridian. Most latitude values are positive because every location is north of the Equator.

A screenshot of a table of values.
The highlighted Longitude and Latitude fields contain the geographic coordinates for each location. Graphic: Caitlin Dempsey.

When importing a CSV or text file into software such as ArcGIS Pro or QGIS, you’ll often be asked to specify which fields contain the X and Y coordinates. This is where it’s easy to make a mistake. The X field should be assigned to the longitude values, while the Y field should be assigned to the latitude values.

If the fields are reversed, your data may still load, but the points will appear in the wrong location.

Quick check: If you’re mapping locations in the United States, longitude values should almost always be negative because they are west of the Prime Meridian. If your points appear on the opposite side of the world, one of the first things to check is whether the X and Y fields were assigned correctly.

Screenshot from QGIS showing the interface for adding a CSV file with a red circle around the dropdown menus for designated the X and Y fields.
When loading a CSV file into QGIS, you will need to indicate which field contains the X (longitude) values and which fields contains the Y (latitude values). Screenshot: Caitlin Dempsey.

Why is it confusing to remember that X is longitude and Y is latitude?

The confusion usually comes down to two things: the order in which coordinates are presented and the way GIS uses the Cartesian coordinate system.

Order of coordinates

The first source of confusion is the order in which coordinates are written. We usually refer to locations as latitude and longitude (Y, X). Most GIS software, however, expects coordinates in X, Y order, which means longitude first and latitude second.

Not every application follows the same convention. For example, Google Maps typically displays coordinates as latitude, longitude, making it easy to switch the two in your head.

Neither convention is wrong. The important thing is knowing which order your software expects.

Side by side screenshots showing QGIS and Google Maps.
QGIS (left) displays coordinates in X, Y order (longitude, latitude), while Google Maps (right) displays them in Y, X order (latitude, longitude). Graphic: Caitlin Dempsey.

Confusion with the Cartesian Coordinate System

Most of us learned the Cartesian coordinate system in school, where the X-axis represents the horizontal direction and the Y-axis the vertical direction. Since lines of longitude run north to south on a globe, it’s easy to assume they should correspond to the Y-axis. In GIS, however, longitude is still the X coordinate because it measures the east-west position, while latitude measures the north-south position.

How to remember X is longitude and Y is latitude

If you still find yourself hesitating when assigning X and Y fields, these memory tricks can help.

Memorization

Like many GIS skills, remembering that X = longitude and Y = latitude comes with repetition. After assigning coordinate fields enough times, the association eventually becomes automatic. Until then, the memory tricks below can help reinforce the correct order.

Sticky note method

Sometimes the simplest solution is the best one. If you regularly import CSV files, keep a sticky note on the edge of your monitor with X = longitude and Y = latitude. It may be low-tech, but it works surprisingly well.

A photo of a yellow sticky note that says x=long and y=lat with a screen that has a map displayed.
The low-tech way is to put a sticky note that says “x=long and y=lat” near your screen. Photo: Caitlin Dempsey.

Three ways to remember X = longitude and Y = latitude

One of my favorite memory tricks came from a Reddit user. The idea is simple:

  • Y has three endpoints and LAT has three letters.
  • X has four endpoints and LONG has four letters.
A large black X and Y with small red dots at the end points of each letter.
A simple visual trick for remembering that X corresponds to longitude and Y corresponds to latitude. Diagram: Caitlin Dempsey.

Another clever memory aid came from a Reddit discussion. Think of latitude as the rungs of a ladder and longitude as the side rails. To make it even easier to remember:

  • Y climbs the la[t]der and X just runs along.
A image of a globe in blue with a black ladder leaning against the globe.
Latitude forms the rungs of the ladder, while longitude runs along the rails.  Image: Caitlin Dempsey using Canva elements.

By regularly applying one of the memory aids listed above, you can condition your mind to associate X with longitude and Y with latitude.

What is the difference between latitude/longitude and Easting/Northing?

You may also come across the terms Easting and Northing when working with GIS data. Unlike latitude and longitude, which measure locations on a spherical Earth using degrees, Easting and Northing are planar coordinates measured in units such as meters or feet.

Easting and Northing are commonly used in projected coordinate systems such as the Universal Transverse Mercator (UTM) system and the British National Grid. In these systems, Easting corresponds to the X coordinate and Northing corresponds to the Y coordinate.

What to do if your GIS data points aren’t where you expect them to be on the map?

This happens to all of us. You assign what you think are the correct latitude and longitude fields, but when you zoom to your data, the points end up in the wrong place, sometimes even on the other side of the world.

The first thing to check is whether the X and Y fields were assigned correctly. Swapping latitude and longitude is one of the most common causes of misplaced points. If that doesn’t solve the problem, verify that you’re using the correct coordinate reference system (CRS) for your dataset.

While longitude = X and latitude = Y is the standard convention in most GIS software, there are exceptions. For example, Sweden’s national mapping authority notes that some Swedish datasets are oriented with the X-axis representing northing and the Y-axis representing easting. When working with data from another country, always check the documentation before assuming the coordinate order.

If that doesn’t help, check whether your coordinates are supposed to be positive or negative. For example, if your data points are mapping closer to Indonesia instead of the expected California locations, your longitude values are positive instead of negative.

Quick check: If your imported points appear in the ocean, on another continent, or thousands of miles from where you expect, first verify the X and Y field assignments. If they’re correct, the next thing to check is the dataset’s coordinate reference system (CRS).

Conclusion

Even after years of working with GIS, it’s still worth taking a second to verify that X is longitude and Y is latitude before loading a new dataset. A quick check of your coordinate fields can save a lot of frustration later.

Once you understand how latitude, longitude, projected coordinates, and coordinate reference systems work together, assigning X and Y fields becomes second nature. Until then, don’t feel bad about using a sticky note or one of the memory tricks above. We’ve all been there.

This article was originally written on November 24, 2023 and has since been updated.

Photo of author
Caitlin Dempsey

Caitlin Dempsey is a geographer, writer, and founder and editor of Geography Realm. She holds bachelor's and master's degrees in Geography from UCLA and a Master of Library and Information Science (MLIS) from San José State University.

For more than two decades, she has written about geography, maps, geographic information systems (GIS), remote sensing, satellite imagery, and environmental science. Her work focuses on making geography accessible to a broad audience through articles, tutorials, and educational resources.

LinkedIn | Instagram