Recently a fellow developer mentioned that while working on a Leaflet project, they noticed OpenStreetMap claims to use WGS 84, yet Leaflet defaults to EPSG:3857. Which EPSG code is actually used as the coordinate system in WebGIS? You may have encountered similar confusion, so today I’ll try to explain it.
The Difference Between EPSG:3857 and EPSG:4326
Let’s first check the official EPSG descriptions. As shown below, start with 4326:

Now look at 3857:

Notice the key difference? EPSG:4326 is a geographic coordinate system based on WGS 84, while EPSG:3857 is a projected coordinate system. When we develop 2D WebGIS applications, the computer screen is flat—it’s already projected—so naturally we use EPSG:3857. In short, basemap tiles use EPSG:3857, while business data is commonly stored with EPSG:4326 latitude and longitude. The API handles the conversion behind the scenes.
Why the Confusion Happens
This kind of confusion usually isn’t because some software is wrong, but rather because people mix up the coordinate system used to store data and the coordinate system used to display the map. WGS 84 is a datum, and EPSG:4326 is the geographic coordinate system code that uses latitude and longitude. EPSG:3857 is a projected coordinate system based on the same WGS 84 ellipsoid, projecting the spherical Earth onto a flat surface using Web Mercator, with units in meters. Both share the same underlying datum, but their coordinate form and usage scenarios are completely different.
If you haven’t studied GIS systematically, you can easily get confused by different products. For example, Google Earth uses geographic coordinates (WGS 84, corresponding to EPSG:4326), while Google Maps online uses projected coordinates (Web Mercator, EPSG:3857). Similarly, the OpenStreetMap vector database stores latitude and longitude (EPSG:4326), but OpenStreetMap tile services and WMS output maps in EPSG:3857. That’s why you might see the same project mention both WGS 84 and EPSG:3857. If you still haven’t sorted out datum versus projection, you might want to check my earlier post “[GIS Tutorial] Understanding Projections and Datums: The First Lesson in Coordinate Systems” (https://malagis.com/gis-tutorial-projection-vs-datum.html).
How to Quickly Tell 4326 and 3857 Apart
Simply look at the magnitude and unit. EPSG:4326 uses degrees, with latitude and longitude typically ranging between ±180 and ±90, often having many decimal places. For instance, Paris is roughly latitude 48.8589506, longitude 2.2768485. EPSG:3857 uses meters, and the numbers are much larger. The same location after projection becomes roughly X ≈ 253457, Y ≈ 6250962.
When you see a pair of coordinates with values in the range of a few degrees or tens of degrees, you can be fairly certain it’s EPSG:4326. If the numbers reach six or seven digits, it’s very likely EPSG:3857. Of course, you can convert between them. See “Methods for Converting Between Mercator Coordinates and Longitude/Latitude”.
Final Thoughts
One more thing to add: When building WebGIS applications for China, the default Web Mercator causes significant area distortion at high latitudes, and China’s territory can appear slightly “tilted downward.” If you’re creating a nationwide thematic dashboard or a statistical map that emphasizes area comparison, you may want to consider using the Albers equal-area conic projection instead of sticking to EPSG:3857, as I demonstrated in “How to Render GeoJSON Data with the Albers Projection on the Web”.

Doesn’t that map look much better? Keep in mind, though, that Leaflet’s support for custom projections is not ideal; OpenLayers is recommended. You’ll also need to reproject the corresponding tile data when using it.