Coordinate systems · 7 min read
EPSG:4326 vs EPSG:3857
These two codes cover most of the coordinates on the internet. One is what your phone's GPS reports; the other is what almost every web map draws on. They look interchangeable, and treating them that way is how a site boundary ends up twice its real size.
What an EPSG code is
EPSG codes are ID numbers from a public registry of coordinate systems, first compiled by the European Petroleum Survey Group and now maintained by IOGP. Instead of describing a datum, ellipsoid and projection in full, software can just say "4326" and every GIS on the planet knows what it means.
EPSG:4326 — WGS 84, in degrees
4326 is a geographic system: positions are angles on the WGS 84 ellipsoid, given as latitude and longitude in degrees. It is what GPS receivers use, what GeoJSON requires, and what most people mean by "coordinates". Johannesburg is at roughly 26.20° S, 28.05° E.
Because the units are degrees, 4326 is not flat. A degree of latitude is always about 111 km, but a degree of longitude shrinks as you move away from the equator — about 100 km in Johannesburg, and zero at the poles. You cannot measure distance or area by treating degrees as if they were a grid.
One trap: the official definition of 4326 lists latitude first, but GeoJSON, most web libraries and most GIS software write longitude first. If points appear mirrored across the diagonal — in Somalia instead of South Africa, say — axis order is the likely culprit.
EPSG:3857 — Web Mercator, in metres
3857 is a projected system: it flattens the globe onto a square so that it can be cut into map tiles. Google Maps popularised it around 2005, and today OpenStreetMap, Bing, Esri's web basemaps, Leaflet and MapLibre all use it. Units are "metres" — Johannesburg is at about x 3,122,000, y −3,022,000.
To make the world square, Web Mercator stops at about 85.05° north and south. And to keep the maths fast, it treats the Earth as a sphere while using WGS 84 coordinates, which is why purists call it a pseudo-projection.
Why you must never measure in 3857
Mercator keeps angles and local shapes true, which is ideal for panning a street map. The price is scale. Distances are stretched by a factor of 1 ÷ cos(latitude), and areas by the square of that.
| Place | Latitude | Length stretch | Area stretch |
|---|---|---|---|
| Nairobi | 1° S | 1.00× | 1.00× |
| Johannesburg | 26° S | 1.11× | 1.24× |
| Cape Town | 34° S | 1.21× | 1.46× |
| London | 51.5° N | 1.61× | 2.59× |
| Oslo | 60° N | 2.00× | 4.00× |
So a farm boundary measured in 3857 near Cape Town reports almost 50% more hectares than it really has. That is why Greenland looks the size of Africa on a web map when Africa is about fourteen times bigger.
What to use for measurement
For lengths and areas, use a projection designed for your region. For most of the world, the right UTM zone works well: in South Africa that is UTM 34S (EPSG:32734) west of 24° E and UTM 35S (EPSG:32735) east of it. For legal and cadastral work in South Africa, use the national Lo system on the Hartebeesthoek94 datum, in the 2°-wide belt that covers your site.
A simple rule
- Store and exchange in 4326 — it is universal and lossless.
- Display on the web in 3857 — your map library does this for you.
- Measure and analyse in a local projected system — UTM or Lo.
Reproject converts between 4326, 3857, every UTM zone and more, then transforms the result back again to prove nothing drifted. Type a place name and it suggests the right zone.
Open ReprojectPublished by RICE, a LocalID Pty Ltd product. Questions or corrections: info@cartesiasa.com.
