EPSG:4326 to EPSG:3857 (Web Mercator) with ogr2ogr
How to reproject vector data from WGS84 (EPSG:4326) to Web Mercator (EPSG:3857) with ogr2ogr, with tested results.
The converters on this site do not reproject. This guide shows the ogr2ogr command, the operation PROJ uses and the resulting coordinates for four test points. Tested with GDAL 3.10.3 and PROJ 9.6.0.
Guide: run this conversion locally with GDAL
The GDAL worker behind this site converts formats but does not reproject. Run the command below with GDAL on your computer.
What the command does
- ogr2ogr transforms from the file's coordinate system to EPSG:3857 with -t_srs.
- PROJ 9.6.0 uses one operation: EPSG:3856 "Popular Visualisation Pseudo-Mercator" (stated accuracy 0 m, area of use: world), i.e. the webmerc projection on the WGS84 ellipsoid.
- The output coordinates are in metres; the GeoJSON gets the crs member urn:ogc:def:crs:EPSG::3857.
GDAL command to run locally
-s_srs EPSG:4326 is only needed for input without coordinate system (e.g. a Shapefile without .prj).
Tested with
| Test file | Result |
|---|---|
| Köln Hbf, 6.9583°E 50.943°N | x 774594.41, y 6611217.27 |
| München Marienplatz, 11.5755°E 48.1374°N | x 1288578.77, y 6129743.82 |
| Görlitz, 14.9872°E 51.1529°N | x 1668367.47, y 6648384.66 |
| Aachen Dom, 6.0839°E 50.7753°N | x 677256.65, y 6581642.73 |
Tested on 24 Sep 2026 with GDAL 3.10.3 and PROJ 9.6.0 (conda-forge build on Windows).
Limits
- Web Mercator metres are not ground metres. At Köln (51°N) PROJ gives a scale factor of about 1.58: 1 km on the ground measures about 1.58 km in EPSG:3857, areas come out about 2.5 times too large. For measurements use a UTM system such as EPSG:25832.
Frequently Asked Questions
Why is there no online converter on this page?
The GDAL worker behind this site only converts formats; it has no reprojection option.
What unit do EPSG:3857 coordinates have?
Metres on the Web Mercator plane, not on the ground. In the test Köln Hbf got x 774594.41, y 6611217.27; the scale factor there is about 1.58.