geoprimsField-grade geospatial math

XYZ and TMS tile numbering

Converts a map tile's z/x/y between the scheme, which counts rows from the north, and , which counts them from the south.

TMS 14/4551/10207

That tile is TMS 14/4551/10207.

XYZ
TMS
Provenance
Computed by
indexing.tile.xyz-tms 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 when tiles move between systems that number rows differently: web maps and most tile servers use XYZ, while MBTiles files and older TMS servers count from the south. Enter the tile as zoom/x/y and say which scheme it is in. The tool returns it in the other scheme, and both forms side by side. Only the row number changes.

Limitations: The conversion flips the row within the zoom level, y' = 2^zoom − 1 − y, so the zoom must be right for the answer to be. It cannot tell which scheme a tile was written in; a tile that looks wrong on the map is often in the other one, which the tile bounds tool can show. A quadkey has no such ambiguity.

Worked example: An XYZ tile over Pittsburgh at zoom 14. 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

y convention of the input
xyz
Tile
14/4551/6176

You get

Converted tile
TMS 14/4551/10207
XYZ
14/4551/6176
TMS
14/4551/10207

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

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