KunYu
epsgcoordinate-systemgis-basics

EPSG Codes Explained: What They Are and Why They Matter in GIS

Understand EPSG codes, how they identify coordinate reference systems, and learn to pick the right one for your GIS project.

KunYu TeamMarch 10, 20267 min read

You import a shapefile from a colleague, overlay it on your basemap, and the buildings are sitting in a field 200 meters east of where they should be. The .prj file says "GCS_WGS_1984" but the data was actually collected in NAD27. This kind of mismatch costs hours — and it comes down to one thing: EPSG codes.

An EPSG code is a numeric shorthand for a coordinate reference system (CRS). Say EPSG:4326 and any GIS engineer knows you mean WGS 84 — no ambiguity, no WKT string to parse. Getting this right is the first step to avoiding misaligned data.

Where Do EPSG Codes Come From?

EPSG stands for the European Petroleum Survey Group, founded in 1985. The backstory: multiple oil companies were doing offshore surveys in the same waters but couldn't merge their data because each company used different coordinate systems. Jean-Patrick Girbig, chief surveyor at Elf Aquitaine, convened geodesists from Agip, BP, Deminex, Shell, Statoil, and Total to fix this.

Their first task was a standardized CRS database, publicly released in 1993 with over 500 definitions. In 1995, the GeoTIFF v1.0 standard adopted EPSG codes as its CRS identifier, which brought EPSG out of the petroleum industry and into mainstream GIS.

In 2005, the EPSG working group was reorganized under IOGP (International Association of Oil & Gas Producers), but the EPSG brand name stuck. Today the EPSG dataset (v12.053) contains over 7,000 CRS definitions, 2,500 projection methods, and 2,500 coordinate transformations — more than 20,000 entries in total.

What Exactly Is an EPSG Code?

An EPSG code is a 4- to 5-digit numeric identifier (range 1024–32767) that uniquely identifies a CRS, datum, ellipsoid, or coordinate transformation method in the EPSG dataset. Its technical foundation is the ISO 19111 standard.

Standard Notation

The most common format is authority:code:

EPSG:4326

OGC also defines a URL format, often used in web services:

http://www.opengis.net/def/crs/EPSG/0/4326

What's Inside an EPSG Definition?

Each code maps to a complete CRS definition: ellipsoid parameters (semi-major axis, flattening), datum, coordinate axis directions and order, unit of measurement (degrees or meters), and the geographic area where it applies.

The most common pitfall is axis order. The EPSG:4326 standard definition specifies latitude first (lat, lng), but most GIS software actually passes longitude first (lng, lat). GeoJSON uses lng, lat; Leaflet's L.latLng() expects lat, lng — and the resulting bug looks like random point scattering across the map, not an obvious coordinate swap.

Most Commonly Used EPSG Codes

EPSG Code Name Type Unit Typical Use
4326 WGS 84 Geographic Degrees GPS, global data exchange
3857 Web Mercator Projected Meters Web maps (Google Maps, OSM)
4490 CGCS2000 Geographic Degrees China national standard
4269 NAD83 Geographic Degrees United States, Canada
32601–32660 UTM North zones Projected Meters Local high-precision surveys
32701–32760 UTM South zones Projected Meters Local high-precision surveys
2154 RGF93 / Lambert-93 Projected Meters France
27700 OSGB 1936 Projected Meters United Kingdom

EPSG:4326 vs EPSG:3857 — The Two Codes Everyone Confuses

EPSG:4326 (WGS 84) is a geographic CRS that represents positions in latitude/longitude degrees. Raw GPS output is WGS 84. It's the standard for data storage and exchange.

EPSG:3857 (Web Mercator) is a projected CRS that maps the earth onto a flat plane in meters. Google Maps adopted this projection at launch in 2005, and virtually every web map followed.

EPSG initially refused to register 3857. Their objection: it uses a spherical formula applied to an ellipsoidal datum, which is mathematically incorrect. Google shipped it anyway, and by the time EPSG relented and assigned the code in 2009, every web map on the planet was already using it. Despite its ubiquity, 3857 is not suitable for accurate area or distance measurements — roughly 0.33% scale error compared to standard Mercator.

Key rule: 4326 for storage, 3857 for display. KunYu's coordinate converter supports conversion between the two.

How to Find the Right EPSG Code

Scenario 1: You Know the CRS Name

If you know the name (e.g., "WGS 84" or "NAD83"), search directly in the EPSG Search tool. It supports searching 8,000+ EPSG definitions by code, name, and region.

Scenario 2: You Know the Location, Not the CRS

When you need a suitable projected CRS for a specific area, use the EPSG Finder tool — click or draw a box on the map, and it lists all EPSG codes whose area of use covers that region.

EPSG Search

Search and browse the EPSG coordinate reference system database.

Try it now

Scenario 3: You Received Data Without CRS Info

Check the metadata files that came with the data. Shapefiles have a .prj file (open it with any text editor) containing the CRS definition in WKT format. GeoTIFFs usually embed EPSG information in their metadata. With GDAL:

# Check the CRS of a GeoTIFF
gdalsrsinfo input.tif

# Read a Shapefile's .prj file
cat data.prj

Using EPSG Codes in GIS Software

QGIS: Project Properties → CRS panel lets you search and switch CRS by EPSG code. QGIS defaults to EPSG:4326.

GDAL/OGR: Specify the target CRS directly with an EPSG code:

# Reproject a Shapefile from NAD83 to WGS 84
ogr2ogr -s_srs EPSG:4269 -t_srs EPSG:4326 output.shp input.shp

PROJ: The open-source coordinate transformation engine. Its database (proj.db) integrates EPSG, IGNF, and ESRI CRS definitions.

In code, EPSG codes work the same way:

// Proj4js (JavaScript)
import proj4 from "proj4";

proj4.defs("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs");
const result = proj4("EPSG:4326", "EPSG:4490", [116.4074, 39.9042]);
# pyproj (Python)
from pyproj import Transformer

transformer = Transformer.from_crs("EPSG:4326", "EPSG:3857", always_xy=True)
x, y = transformer.transform(116.4074, 39.9042)

EPSG Finder

Find applicable EPSG codes by clicking or drawing on the map.

Try it now

FAQ

What's the Difference Between EPSG:4326 and CRS:84?

Both are WGS 84, but with different axis orders. EPSG:4326's standard definition is latitude first (lat, lng), while CRS:84 is longitude first (lng, lat). GeoJSON uses lng, lat, but Leaflet's L.latLng() expects lat, lng — mixing these up is a common bug.

My Data Is Offset by Tens to Hundreds of Meters. Why?

The most common cause is a wrong EPSG code. Mixing WGS 84 (EPSG:4326) with a local datum like NAD27 or Beijing 1954 produces systematic offsets ranging from a few meters to hundreds of meters. In China, mixing WGS 84 with GCJ-02 (the "Mars coordinate" system used by Amap/Tencent Maps) causes offsets of 100–700 meters depending on location.

Do EPSG Codes Expire?

They get updated but never deleted or reassigned. The IOGP geodesy subcommittee periodically updates the EPSG dataset. Deprecated codes are marked as such and point to their replacements.

What EPSG Code Does China's National Standard Use?

China's CGCS2000 coordinate system maps to EPSG:4490. Note that GCJ-02 (used by Amap/Tencent Maps) and BD-09 (used by Baidu Maps) are non-standard encrypted coordinate systems mandated by China's surveying regulations — they have no EPSG codes. If you need to convert between these systems, KunYu's coordinate converter includes GCJ-02 and BD-09 offset algorithms.

The Rule That Covers 90% of Cases

Remember the core rule: 4326 for storage and exchange, 3857 for web display. When in doubt, search by name with EPSG Search or by location with EPSG Finder.