WGS 84 (EPSG:4326) to Web Mercator (EPSG:3857) Converter
Reproject global GPS coordinates for use in standard interactive web maps.
Web Mercator is the standard projection used by global online map systems. Reprojecting datasets to this standard project makes them compatible with modern web maps, eliminating loading lag caused by client-side calculations.
Indirect Mapping Execution Required
Because database connection attributes or local attributes parsing is required, direct web streams are disabled. Use the GDAL CLI script below for precise terminal conversions.
Specification Rules
- Prepare spatial layers for interactive web map dashboards
- Pre-calculate coordinates to optimize client-side performance
- Align datasets with Google Maps overlay layers
- The projection distorts scale near polar regions
- Not suitable for precise surveyor measurements
- Coordinates values convert to large metric structures
GDAL Direct Equivalent Terminal Command
When to use this conversion
Use this reprojection when preparing data for tile-based web maps (Google Maps, Mapbox, OpenStreetMap raster tiles, vector tiles). Web Mercator is the projection every tile-based web map uses — pre-reprojecting saves per-frame computation in the browser.
Technical Details
File size is essentially unchanged. Coordinate string length may grow slightly because metric values have more digits than degrees, but the effect is under 10%.
Common Errors & Fixes
- Used for analysis: areas and distances in Web Mercator are not accurate. Fix: never compute metrics in EPSG:3857 — reproject to a local UTM or equal-area CRS first.
- Coordinates explode in magnitude: 8-digit metre values surprise tools expecting lat/lon. Fix: verify your downstream tool understands EPSG:3857 explicitly.
- Source data needs reprojection: the input is in a regional CRS, not WGS 84. Fix: first reproject to EPSG:4326, then to EPSG:3857, or do both in one ogr2ogr call with -s_srs and -t_srs.
- Antimeridian discontinuity: data crossing 180° longitude breaks at the Mercator wrap. Fix: split geometries at the antimeridian before projecting.
Alternative Tools
- PROJ CLI: cs2cs +init=epsg:4326 +to +init=epsg:3857
- QGIS: Export → Save Features As with Target CRS = EPSG:3857
- PostGIS: ST_Transform(geom, 3857)
- tippecanoe (which expects EPSG:4326 input but handles the projection internally when generating tiles)
Frequently Asked Questions
Why is Web Mercator the standard for web maps?
Web Mercator uses a square coordinate grid, which simplifies map tile generation and calculations at various zoom levels.
How are the coordinate values formatted?
Coordinates are represented in meters relative to the Equator rather than standard latitudinal degrees.
Will this tool automatically detect the source projection?
The command line uses internal lookups to match standard projections, but raw coordinates must have clear definitions to convert correctly.