When working with geographic data in QGIS or in web mapping applications, two coordinate systems appear very frequently: EPSG:4326 and EPSG:3857.
These two systems are used in many contexts, but they do not represent coordinates in the same way.
In this article, we will look at:
- what EPSG:4326 and EPSG:3857 are
- the differences between them
- when to use one or the other.
1. What Is an EPSG Code?
An EPSG code identifies a geographic coordinate reference system.
These codes are defined in the EPSG Geodetic Parameter Dataset, a reference database used in GIS software.
Each code corresponds to a specific coordinate system.
For example:
| Code | Description |
|---|---|
| EPSG:4326 | WGS84 – latitude and longitude |
| EPSG:3857 | Web Mercator – projection used for web maps |
| EPSG:2154 | Lambert 93 |
2. EPSG:4326: Latitude / Longitude Coordinates
The EPSG:4326 system is based on the WGS84 geodetic system.
Coordinates are expressed as:
- latitude
- longitude
The units are degrees.
Example:
Latitude : -20.3484
Longitude : 57.5522
This system is commonly used for:
- GPS devices
- many geographic databases
- GeoJSON files.
3. EPSG:3857: The Web Mercator Projection
The EPSG:3857 system is a projection known as Web Mercator.
Coordinates are expressed in meters.
Example:
X : 6404700
Y : -2309000
This projection is used by most web maps:
- OpenStreetMap
- Google Maps
- Leaflet
- OpenLayers.
4. The Main Differences
| EPSG:4326 | EPSG:3857 |
|---|---|
| coordinates in degrees | coordinates in meters |
| latitude / longitude | projected planar coordinates |
| used for GPS data | used for web maps |
| suitable for storing geographic coordinates | suitable for map display |
5. Usage in QGIS
In QGIS, these two systems are very common.
EPSG:4326
Often used for:
- importing GPS coordinates
- storing geographic data
- working with GeoJSON files.
EPSG:3857
Often used for:
- displaying web map basemaps
- working with OpenStreetMap
- publishing web maps.
QGIS can reproject layers on the fly so they display correctly together.
6. FAQ
Data does not align with the basemap
This usually means that:
- your layer is in EPSG:4326
- your project is in EPSG:3857.
QGIS can handle this automatically if on-the-fly reprojection is enabled.
The coordinates seem incorrect
For example:
X : -20
Y : 57
These values are likely latitude and longitude coordinates.
Conclusion
EPSG:4326 and EPSG:3857 are two coordinate systems widely used in GIS.
- EPSG:4326 is well suited for storing geographic coordinates.
- EPSG:3857 is mainly used for displaying web maps.
Understanding the difference between these two systems helps avoid many projection issues in QGIS and web mapping applications.