Web Mercator projection calculator
Latitude 40.7128 and longitude -74.006 project to X -8238310.235647004 m and Y 4970071.579142427 m on the EPSG:3857 plane behind most online maps. Enter degrees and get metres you can use for tiles, overlays and map checks. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Latitude
- 40.7128
- Longitude
- -74.006
- X
- -8,238,310.235647004
- Y
- 4,970,071.579142427
- Epsg
- EPSG:3857
- Radius m
- 6,378,137
This Web Mercator projection calculator converts WGS84 latitude and longitude into EPSG:3857 X and Y coordinates in meters, the plane used by Google Maps, OpenStreetMap, Leaflet, Mapbox, and most web tile stacks. The engine applies the spherical Mercator formulas with radius R equals 6,378,137 meters: X is R times longitude in radians, and Y is R times the inverse hyperbolic tangent of the sine of latitude. Results are fully deterministic with no network calls, no sampling, and no date-dependent shortcuts. Latitude is clamped to the classic Mercator bound near plus or minus 85.06 degrees because poles cannot be represented with a finite Y.
What Web Mercator returns and how EPSG:3857 is defined
Web Mercator, registered as EPSG:3857, is a spherical Mercator projection of WGS84 geographic coordinates onto a flat meter plane centered at the equator and prime meridian. X increases eastward and Y northward; the origin is the intersection of the equator and the Greenwich meridian, so latitude zero and longitude zero project to X equals zero and Y equals zero. The half-world extent on each axis is R times pi, about 20,037,508.34 meters, which is the familiar origin shift used by slippy-map tile schemes.
There is no ellipsoidal transverse Mercator path and no datum shift: the path is the industry-standard spherical model that web maps actually use.
Where projected meters fit in maps, tiles, and software
Developers meet Web Mercator when a tile URL, a canvas overlay, or a vector layer expects meter coordinates instead of geographic degrees. GIS students use the projection when a lab asks for X and Y on the EPSG:3857 plane, when comparing a city pin against a basemap extent, or when checking that a drawn polygon sits inside the valid Mercator latitude band. Teachers can pre-generate answer keys for modest lat-lon pairs without trusting opaque calculator apps that silently switch to UTM or ellipsoidal formulas.
Product teams call the same contract from scripts to seed deterministic test vectors for map renderers, to normalize user-entered coordinates before tile math, or to satisfy programming-challenge statements that demand meter X and Y rather than a hand-waved sketch. Contest and interview practice often needs a fast, offline source of projected points so solutions can be checked without spinning up a full GIS stack under time pressure.
What you can do with it
Map and tile debugging
Convert a lat/lon pin to EPSG:3857 meters to verify overlays, extents, and slippy-map tile math against a basemap.
Teaching and homework keys
Project textbook city coordinates into Web Mercator for labs, answer keys, and classroom demos without a full GIS suite.
FAQ
What does the Web Mercator projection calculator cost?
It is free in your browser on this page.
Why is latitude limited to about ±85.06°?
Mercator Y goes to infinity at the poles. Web Mercator caps latitude at ±atan(sinh(π)) ≈ ±85.05112878° so X and Y stay finite.
Is this the same as UTM?
No. UTM is a transverse Mercator split into 6° zones with different false eastings. This tool projects to a single global Web Mercator plane (EPSG:3857).
Why are results rounded to a precision?
Default precision is 10 decimal places; you can set precision from 0 to 15.
Where do X and Y both equal zero?
At the point where the equator meets the Greenwich meridian, so latitude 0 and longitude 0 project to zero metres on both axes. From there X grows toward the east and Y toward the north.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/web-mercator-project \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"latitude":40.7128,"longitude":-74.006}'const res = await fetch("https://api.kit.forhosting.com/geo/web-mercator-project", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"latitude": 40.7128,
"longitude": -74.006
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/web-mercator-project",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"latitude": 40.7128,
"longitude": -74.006
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/web-mercator-project", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"latitude":40.7128,"longitude":-74.006}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"latitude":40.7128,"longitude":-74.006}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/web-mercator-project", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"latitude": 40.7128,
"longitude": -74.006
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.web_mercator_project",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_latitude | 85.05112878 |
min_longitude | -180 |
max_longitude | 180 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What Web Mercator returns and how EPSG:3857 is defined
This calculator returns the input latitude and longitude (echoed and rounded), the projected X and Y in meters, the EPSG code string, the radius used, the maximum absolute latitude accepted, the origin-shift magnitude, the precision applied, a short formula reminder, and the method tag web_mercator_project. Rejected cases include missing latitude or longitude, non-finite values, longitude outside the closed interval from negative one hundred eighty to positive one hundred eighty degrees, and any latitude whose absolute value exceeds atan of sinh of pi, approximately 85.05112878 degrees.
How latitude and longitude are read and how X and Y stay reproducible
Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong meter coordinate. Latitude must stay within the Web Mercator limit of about plus or minus 85.05112878 degrees: beyond that bound, the Mercator Y tends to infinity and cannot be represented as a finite meter value on the projected plane. The preferred fields are latitude and longitude in decimal degrees, but aliases lat, y, and phi for latitude and lon, lng, long, x, and lambda for longitude are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Longitude must lie in the inclusive range from negative one hundred eighty through positive one hundred eighty; values outside that band fail with invalid_input rather than silently wrapping. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for latitude, longitude, X, and Y, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing EPSG:3857 yourself.
Where projected meters fit in maps, tiles, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with tile-to-latlon or UTM converters when you need related coordinate tools, and with other geo endpoints when you are building a small lab of free, deterministic geospatial helpers.
Integration use cases
Deterministic GIS fixtures
Generate reproducible X and Y meter coordinates for unit tests, CI assertions, and property checks on map code.
Technical questions
Which formulas define X and Y?
With R = 6378137 m, x = R · lon_rad and y = R · atanh(sin(lat_rad)). This is the spherical Web Mercator model used as EPSG:3857.