Skip to content
QGIS
Guide

What Is a CRS (Coordinate Reference System)?

Published

A coordinate reference system (CRS) is the set of rules that ties a pair of coordinates to a real place on Earth. It tells the software which model of the Earth the numbers use, whether they are degrees or metres, and how the round Earth was flattened into a map. Every GIS layer has one, usually written as a short code such as EPSG:4326.

Without the CRS, 651000, 6862000 is just two numbers. With EPSG:2154, it is a point in Paris. With EPSG:4326 by mistake, the same numbers point nowhere, and QGIS draws the layer in the wrong place. That mismatch is behind most "my layer is in the ocean" questions. Below you'll find the fix step by step, and a test of AI Agent, the QGIS plugin we build, which found the right CRS from one message in 52 seconds.

Diagram of what a CRS is made of. Three cards joined by plus signs: 1, which Earth, the datum and ellipsoid, such as WGS 84, ETRS89, NAD83 or SIRGAS 2000; 2, angles or metres, the coordinate system; 3, how was it flattened, the projection, only for flat grids. An equals sign leads to a green card, the label: an EPSG code, with EPSG:4326 for WGS 84 in degrees, EPSG:3857 for Web Mercator in metres and EPSG:2154 for Lambert-93 in France. Below, a geographic CRS uses parts 1 and 2 with coordinates like 48.85, 2.35, and a projected CRS uses all three with coordinates like 652 000, 6 862 000.
A datum, a coordinate system and, for flat maps, a projection. The EPSG code names the combination.

The three parts of a CRS

Every CRS answers three questions. Get one wrong and your data moves.

  1. The datum: which Earth? The Earth is slightly flattened, not a perfect ball. A datum is a model of that shape, pinned to the planet. WGS 84, used by GPS, is one. ETRS89 in Europe and NAD83 in North America are others.
  2. The coordinate system: degrees or metres? A geographic CRS gives latitude and longitude in degrees. A projected CRS gives x and y in metres on a flat map.
  3. The projection: how was it flattened? A projection is the method that turns the round Earth into a flat map. You can't do that without stretching something, so each projection chooses what to keep right: areas, angles or distances.

Geographic vs projected CRS

Both kinds are correct. The difference decides whether a measurement means anything.

Geographic CRSProjected CRS
UnitsDegrees of latitude and longitudeMetres or feet
ExampleEPSG:4326 (WGS 84)EPSG:32643 (WGS 84 / UTM zone 43N, western India)
Good forStoring and exchanging global data, GPS positionsMeasuring areas and distances, engineering, national mapping
Bad forAreas and lengths: a degree of longitude is 111 km at the equator and 0 km at the polesAreas far from where the projection was designed to work

My rule: keep data in the CRS it came in, but measure in a projected CRS made for your area. An area computed in EPSG:4326 comes back in square degrees. It still looks like a number, which is why people ship it.

What an EPSG code is

An EPSG code is a short number that names one CRS exactly. The list started with the European Petroleum Survey Group, hence the name, and the International Association of Oil & Gas Producers keeps it today. It holds over 7,000 CRSs.

These are the codes I meet most often:

CodeNameWhere and why
EPSG:4326WGS 84GPS coordinates, GeoJSON, most global datasets
EPSG:3857WGS 84 / Pseudo-MercatorWeb map tiles: OpenStreetMap, Google, Bing, Esri basemaps
EPSG:2154RGF93 / Lambert-93The legal CRS for mainland France
EPSG:25832ETRS89 / UTM zone 32NGermany, Denmark, Norway and much of central Europe
EPSG:32643WGS 84 / UTM zone 43NWestern India, including Mumbai and Pune
EPSG:31983SIRGAS 2000 / UTM zone 23SSouth-east Brazil, including São Paulo state
EPSG:26918NAD83 / UTM zone 18NThe US east coast, including New York

One trap hides in the first row. The official EPSG:4326 puts latitude first, but most software, QGIS included, and GeoJSON read longitude first (GeoTools explains why). If your CSV points land in Antarctica or off Somalia, check for swapped columns first.

EPSG:4326 vs EPSG:3857

EPSG:4326 stores positions in degrees. EPSG:3857, called Web Mercator, turns them into a square grid in metres so a map can be cut into tiles. Google Maps adopted it in 2005, and nearly every online basemap followed. It's great for display and bad for measuring, because it stretches areas more and more as you move away from the equator.

World map in Web Mercator with six orange squares, each 500 by 500 kilometres on the ground. The square at Quito on the equator is small and labelled times 1.01. Mumbai is times 1.13, Madrid times 1.73, Berlin times 2.70, Oslo times 3.97, and the square at Tromsø above the Arctic Circle is drawn about eight times larger, labelled times 8.23.
Six squares of identical ground area, drawn in EPSG:3857 in QGIS. The labels are the measured area inflation.

I measured how much in QGIS, with a real 1 km² square at six cities:

CityLatitudeArea of 1 km² on a Web Mercator map
Quito0.2° S1.007 km²
Mumbai19.1° N1.126 km²
Madrid40.4° N1.727 km²
Berlin52.5° N2.696 km²
Oslo59.9° N3.966 km²
Tromsø69.7° N8.226 km²

The rule of thumb, 1 / cos²(latitude), lands within 0.6% of every measurement. Even on the equator, Web Mercator adds 0.67%, because it uses the formulas of a sphere on an Earth that isn't one.

How we measured this. On 26 September 2026, in QGIS 3.44, I drew each square at its true size (1.000000 km² on the WGS 84 ellipsoid, checked with $area). I then reprojected it to EPSG:3857 and read its flat area with area($geometry).

So a field measured on a Web Mercator layer in Oslo comes out about four times too big. Measure in the right CRS instead: your country's official CRS or your UTM zone gives areas right to within a fraction of a percent.

Datums: when the same coordinates are metres apart

Two CRSs can both say "latitude 40.7, longitude −74.0" and mean points metres apart, because they use different datums. How far apart depends on the pair:

FromToTypical shiftSource
NAD27NAD8310 to 100 m in the lower 48 US states, over 400 m in HawaiiUSGS
NAD83WGS 84About 1 to 2 m across most of the USNorth American Datum
ETRS89WGS 84About 90 cm today, growing 2.5 cm a yearEuroGeographics / EUREF, 2025

Europe is the surprising case. ETRS89 moves with the European tectonic plate, which drifts about 2.5 cm a year, and WGS 84 doesn't. So a point fixed in ETRS89 in 1989 now sits about 90 cm from its WGS 84 position, though nothing on the ground moved. On a basemap, nobody sees it. On a land survey, it matters.

When QGIS knows several ways to convert between two datums, it asks you to choose. Pick the most accurate one for your area instead of closing the dialog.

Why your layers don't line up in QGIS

QGIS reprojects on the fly: each layer keeps its own CRS, and QGIS converts them all to the project CRS for display. That works as long as each layer's CRS is declared correctly. If a label is wrong, QGIS converts from the wrong starting point.

To show it, I saved the 1,015 OpenStreetMap buildings of Bamberg's old town, in Germany, in metres (EPSG:25832), with a .prj file that wrongly says WGS 84, in degrees. QGIS believed the file. In a Web Mercator project, the layer is ticked but draws nowhere, because 635,460 degrees of longitude is not on the planet. Zoom to Layer in a WGS 84 project finds the buildings alone on a blank canvas.

Two QGIS views side by side. Left: a Web Mercator project with yellow building outlines on an aerial photo of Bamberg; the Layers panel lists a red copy declared as WGS 84, ticked but not drawn anywhere. Right: the same red buildings alone on a white canvas after Zoom to Layer in a WGS 84 project, at x 635,460 and y 5,528,260 read as degrees, with no basemap.
The same buildings, right and wrong. Metres labelled as degrees fall off the map entirely.

It's a common problem, and not only for beginners. Of 1,692 QGIS tutorials on YouTube, 155 (9.2%) have a comment asking about a CRS or layers that won't line up. On GIS Stack Exchange, the coordinate-system tag holds 8,402 questions.

The most repeated answer there comes from one experienced user: "In ca. 99% of cases, people simply use 'set CRS' instead of reprojecting, because they don't know the difference." The two tools do opposite things:

  • Set Layer CRS changes the label and keeps the numbers. Use it only when the label was wrong, for example a shapefile that lost its .prj file.
  • Reproject Layer keeps the place and changes the numbers. Use it when the label is right and you need the data in another CRS.

Using Set Layer CRS on a layer that was already right moves it to the wrong place. That's the classic "I reprojected and now it's worse".

How to fix a CRS problem in QGIS

Read what the layer claims

Right-click the layer, Properties > Information. The CRS line shows what QGIS thinks the coordinates are. The status bar at the bottom right shows the project CRS.

Look at the raw numbers

Click a feature with the Identify tool, or open the attribute table of a point CSV. Values between −180 and 180 are degrees. Values in the hundreds of thousands or millions are metres in a projected CRS. If the numbers don't match the claimed CRS, the label is wrong.

Fix the label, or convert the data

Wrong label: Layer > Set CRS of Layer(s), and pick the CRS the data was really made in. The supplier's notes or the country's standard CRS usually tell you. Right label, but you need another CRS: Processing Toolbox > Reproject layer.

Set the project CRS for your area

Click the CRS button in the status bar and pick a projected CRS that fits your area before you measure anything.

For the Bamberg layer, the label was the problem, so the fix was Set CRS of Layer(s): type 25832 in the filter and pick ETRS89 / UTM zone 32N.

The QGIS Set CRS dialog with 25832 typed in the filter. ETRS89 / UTM zone 32N, EPSG:25832, is selected under Projected, Universal Transverse Mercator. The details pane lists units in metres and the ETRS89 datum, and a small world map highlights the UTM zone 32N strip over central Europe.
Set CRS of Layer(s), filtered on the EPSG code. It changes the label and leaves every coordinate as it is.

Not a single coordinate changed. With the label now matching the numbers, all 1,015 outlines sat on their roofs.

QGIS map of Bamberg's old town with red building outlines sitting exactly on the roofs of an aerial photo, after the layer's CRS was set to EPSG:25832.
After Set CRS: the outlines line up with the aerial photo.

Let an agent diagnose it

We build AI Agent, a QGIS plugin, so this section is about our own tool. The manual route above is free and takes a few minutes once you know it. The hard part is knowing which CRS the data was really made in, so I tested whether an agent could work it out.

I reloaded the broken layer and sent one message: "My buildings layer doesn't line up with the basemap. Find out why and fix it." In 52 seconds, the agent read the .prj, saw the coordinates were metres, and picked EPSG:25832 by checking where the town hall landed on the aerial photo. It ruled out an older European CRS for the same area, which puts the building about 225 m off. It saved a corrected copy and left the original file untouched.

QGIS with the AI Agent panel docked on the right. The map shows Bamberg's buildings aligned on the aerial photo. The agent's answer says the Buildings shapefile declares EPSG:4326 but its coordinates are EPSG:25832, that it assigned the correct CRS to a copy without moving any geometry, that all 1,015 outlines now align with the orthophoto, and that the original is unchanged and hidden. Below: the saved GeoPackage, the layers it added or hid, 1 source, 11 actions and an Undo button.
One message, 52 seconds: the agent names the right CRS and fixes a copy.

It left one hidden temporary layer in the project to delete by hand. Like you, it needs a basemap or a reference layer to check against.

Try AI Agent free in QGIS, no card needed

Which CRS should you use?

You want toUseWhy
Show data on a web basemapEPSG:3857It's what the tiles are in
Store or exchange global dataEPSG:4326Universal, and what GeoJSON expects
Measure areas and lengths in a countryThe national CRS, or the local UTM zoneDesigned for that area, in metres
Measure across a continentAn equal-area CRS, such as EPSG:3035 for EuropeKeeps areas true over large extents
Deliver to a government clientTheir legal CRS, such as EPSG:2154 in FranceIt's usually in the contract

To change the project CRS, click the EPSG button at the bottom right of the QGIS window. It opens Project Properties > CRS, where you can search by code or name.

The QGIS status bar with the EPSG:3857 button highlighted, above the Project Properties window on its CRS tab. Recently used systems list EPSG:25832, 4326, 3857 and 2056; WGS 84 / Pseudo-Mercator is selected, with units in metres and a world map of its extent.
The project CRS button in the status bar opens Project Properties > CRS.

What to remember

A CRS ties coordinates to a place on Earth through a datum, a coordinate system and, for flat maps, a projection.

An EPSG code names one CRS exactly: EPSG:4326 is GPS latitude and longitude, EPSG:3857 is the Web Mercator grid of online basemaps.

Web Mercator inflates areas by about 1 / cos²(latitude). Measured in QGIS, a 1 km² square covers 1.73 km² at Madrid, 3.97 km² at Oslo and 8.23 km² at Tromsø. Measure in a national or UTM CRS instead.

When a layer doesn't line up, check the raw numbers before touching anything. Set Layer CRS fixes a wrong label, Reproject Layer converts correct data, and mixing them up moves the layer.

An AI agent inside QGIS can do the diagnosis for you: in our test, AI Agent named the right CRS and fixed a copy of the layer from one message.

Questions people ask

What is a CRS in GIS?

A coordinate reference system tells GIS software where a layer's coordinates are on Earth. It combines a datum (the model of the Earth's shape), a coordinate system (degrees or metres) and, for flat maps, a projection. Each layer has one, usually named by an EPSG code.

What is the difference between EPSG:4326 and EPSG:3857?

EPSG:4326 stores latitude and longitude in degrees on the WGS 84 ellipsoid. EPSG:3857 projects the same positions to metres on a square grid for web map tiles. Use 3857 to display a basemap and never to measure: it inflates areas by 1.7 times at 40° latitude and 4 times at 60°.

Is WGS 84 the same as EPSG:4326?

In everyday use, yes. Strictly, WGS 84 is the datum, and EPSG:4326 is the latitude and longitude CRS built on it. Other CRSs use WGS 84 too, such as EPSG:3857.

Why is my layer in the wrong place in QGIS?

Its declared CRS doesn't match the coordinates in the file. Common causes are a missing .prj file, a CSV with latitude and longitude swapped, or Set Layer CRS used where Reproject Layer was needed. Check the raw coordinates with the Identify tool, then correct the label with Set Layer CRS only if it was wrong.

What is the difference between Set CRS and Reproject in QGIS?

Set Layer CRS changes the CRS label and keeps the coordinate numbers, so it moves the layer unless the old label was wrong. Reproject Layer keeps the layer in place and recalculates the numbers into the new CRS. Use the first to repair metadata, the second to convert data.

Can QGIS find the right CRS automatically?

Not by itself. QGIS reads the CRS from the file, such as the .prj next to a shapefile, and asks when there is none. It doesn't check whether the coordinates fit. An AI agent plugin can. Ours, AI Agent, compares the coordinates with a basemap, finds the CRS and fixes a copy of the layer, from one message typed in QGIS.

Which CRS should I use for measuring area?

A projected CRS designed for your area: your country's official CRS, or the UTM zone you are in. For areas across a continent, use an equal-area CRS such as EPSG:3035 in Europe. Never measure area in EPSG:4326 (square degrees) or EPSG:3857 (inflated away from the equator).

The CRS is also where georeferencing a scanned map starts, since the points you place only mean something in a known system. What QGIS is covers the rest of the software, PyQGIS shows how to reproject in code, and AI Agent fixes a layer's CRS from one message typed in QGIS. The QGIS AI hub lists the other AI plugins by task.