geoprimsField-grade geospatial math

Map tile to quadkey and back

Converts a map tile between zoom/x/y and the Bing Maps quadkey, a string of one digit per zoom level.

0320011120011

The quadkey is 0320011120011, for tile 13/2275/3088.

XYZ
Zoom
Provenance
Computed by
indexing.tile.tile-quadkey 1.0.0, core 0.1.0
Model
S2 geometry and Web Mercator tile arithmetic, as the general S2 and tile tools compute them
Accuracy
Exact for indexes and tokens; S2 areas to the precision of the cell's spherical polygon
Notes
None
Cites
OpenStreetMap Wiki, Slippy map tilenames; Microsoft, Bing Maps Tile System

Something look off?

Your values

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

Loading…

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

Model: S2 geometry and Web Mercator tile arithmetic, as the general S2 and tile tools compute them

Accuracy: Exact for indexes and tokens; S2 areas to the precision of the cell's spherical polygon

When to use this: Use this with Bing Maps, Azure Maps, or any system that keys tiles by quadkey, or to get a sortable key in which a tile's quadkey begins with its parent's. Enter the tile as zoom/x/y, or paste a quadkey to get the tile back. The tool returns both forms and the zoom, which is the quadkey's length.

Limitations: Quadkeys always count rows from the north, so a TMS tile is flipped first; say which scheme the tile is in. Zoom 0 has an empty quadkey. Digits interleave the column and row bits, so neighboring tiles can have very different quadkeys at tile edges.

Worked example: A zoom 13 tile over Pittsburgh. Source: S2 and slippy-map conventions, computed by the core. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Tile
13/2275/3088

You get

Quadkey
0320011120011
XYZ
13/2275/3088
Zoom
13

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.0, core 0.1.0. See this tool in the verification report.

Changes

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

Sources

Terms

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