geoprimsField-grade geospatial math

Map tile for a point (XYZ, TMS, quadkey)

The web map tile containing a point at a zoom: , , and quadkey, with the ground resolution.

Go the other way: Map tile bounds →

A published result changed on 2026-09-19: The geohash encoder, map tile for a point, tile bounds, H3 grid disk, and haversine distance are now stable, so their results no longer carry the EXPERIMENTAL_TOOL warning; the Web Mercator clamp and pentagon warnings moved to the first position. Each matches published worked examples (Wikipedia, the mercantile README, the Bing Maps Tile System, H3 C, and Rosetta Code) and agrees with a separately written library on 250 to 1,000 cases. No numbers changed. Changelog

12/1137/1544

The tile is 12/1137/1544, quadkey 032001112001.

x
y (XYZ)
y (TMS)
Quadkey
Ground resolution (per pixel)
Provenance
Computed by
indexing.tile.from-point 1.0.1, core 0.1.0
Model
Spherical Web Mercator (EPSG:3857) tile grid
Accuracy
Exact tile; resolution on the Web Mercator sphere
Notes
None
Cites
OpenStreetMap Wiki, Slippy map tilenames; Microsoft, Bing Maps Tile System

Something look off?

Your values

Showing an example. Change anything.
More options 1
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: Spherical Web Mercator (EPSG:3857) tile grid

Show your work

  1. Tiles across the map

    n=2zoom

    2^12 = 4,096

  2. Column

    x=(lon+180)/360×n

    ⌊(-79.982222 + 180) / 360 × 4,096⌋ = 1,137

  3. Row

    y=(1ln(tanφ+secφ)/π)/2×n

    from latitude 40.446111° at zoom 12 = 1,544

  4. Tile

    tile = zoom/x/y

    12/1137/1544 = 12/1137/1544

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Exact tile; resolution on the Web Mercator sphere

When to use this: Use this to find which web map tile a point falls in at a zoom level, in XYZ, TMS, and quadkey form, with the ground resolution at that point. It is how a coordinate is turned into a tile request, a cache key, or a pyramid lookup. It is also how a point is matched to the imagery or terrain tile that covers it, which is the first step in reading a value out of a tiled raster.

Limitations: Web Mercator distorts with latitude, so a tile covers far less ground near the poles than at the equator, and the projection stops short of the poles themselves. The tile is an area containing the point, and the y convention matters: XYZ and TMS number rows in opposite directions. At high zooms the tile numbers grow large, and a coordinate outside Web Mercator's latitude limits has no tile at all rather than one at the edge.

Worked example: Pittsburgh at zoom 12. Source: add-spatial-indexing-and-raster scenario: 12/1137/1544, TMS y 2551, quadkey 032001112001, about 29.08 m/px. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Latitude
40.446111 deg
Longitude
-79.982222 deg
Zoom
12

You get

XYZ tile
12/1137/1544
x
1137
y (XYZ)
1544
y (TMS)
2551
Quadkey
032001112001
Ground resolution (per pixel)
29.08 m

Review: Not yet independently reviewed by a GIS professional.

Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.1, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 25 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

TMS: Tile Map Service
A web map tile numbering like XYZ, but with rows counted from the south edge. Source: Slippy map tilenames
XYZ: XYZ web map tiles
The common web map tile numbering, zoom/x/y, with rows counted from the north edge. Source: Slippy map tilenames

TMS — Tile Map Service

A web map tile numbering like XYZ, but with rows counted from the south edge.

Source: Slippy map tilenames

XYZ — XYZ web map tiles

The common web map tile numbering, zoom/x/y, with rows counted from the north edge.

Source: Slippy map tilenames