Learn

What Is an XYZ Tile URL?

An XYZ tile URL is a template that inserts zoom, column and row values into a web address so a map client can request individual tiles for the current view.

Geobble
introductoryexplainerWeb Maps Tiles & Performance

Explain XYZ URL templates, z/x/y addressing, Web Mercator conventions, subdomains, tile-size assumptions and the difference between a URL template and the tileset itself.

What Is an XYZ Tile URL?

An XYZ tile URL is a web-address template used to request map tiles by zoom level, horizontal position and vertical position.

A typical template looks like:

https://example.com/tiles/{z}/{x}/{y}.png

The map client replaces {z}, {x} and {y} with the tile coordinates needed for the current viewport.

What z, x and y mean

In the conventional slippy-map scheme:

  • z is the zoom level;

  • x is the tile column from left to right;

  • y is the tile row from top to bottom.

At zoom 0, one tile represents the world in the usual global Web Mercator square. At zoom 1 there are two columns and two rows. Each increase in zoom doubles the number of tiles along each dimension.

That same addressing pattern is described in more depth in What Are Map Tiles?.

The URL is a request pattern, not the data model

An XYZ template does not tell you whether the underlying source began as Shapefile, GeoJSON, a spatial database or something else; it tells the client how to request the publication tiles.

The tile itself might be:

  • a PNG or JPEG raster image;

  • a vector tile such as Mapbox Vector Tile;

  • another tile payload understood by the client.

The extension in the URL can be informative, but it is not a universal guarantee about the server's internals.

XYZ usually assumes a known tiling scheme

Most web-map XYZ services use the familiar Web Mercator tile pyramid, but the URL syntax alone does not fully describe the coordinate reference system, tile size or coverage.

Two services can both use {z}/{x}/{y} while differing in:

  • available zoom levels;

  • tile dimensions;

  • format;

  • authentication;

  • geographic extent;

  • styling;

  • whether empty tiles exist.

A client needs those surrounding assumptions to use the template correctly.

XYZ and TMS can disagree about y

A common source of confusion is the vertical tile index.

XYZ convention normally numbers y from the top of the map downward. Traditional TMS conventions can number rows from the opposite origin.

If the client uses one convention and the service expects the other, the requested tiles can be vertically inverted or simply wrong. This is an addressing mismatch, not a projection problem.

Why some templates include subdomains

You may see templates such as:

https://{s}.example.com/{z}/{x}/{y}.png

where {s} is replaced by values such as a, b or c.

Historically, multiple hostnames were often used to increase parallel browser requests. Modern HTTP behaviour reduces the need for that pattern, but many services still expose it.

The important point is that {s} is not part of XYZ indexing itself, but an optional delivery convention layered on top.

Authentication can also be part of the template

Commercial or private services may require:

  • an API token;

  • signed URLs;

  • query parameters;

  • request headers;

  • referrer restrictions.

Do not publish a private token inside a public client application unless the provider explicitly designs it for that use.

The fact that a URL template works in a browser does not mean its credentials are safe to expose.

An XYZ URL does not provide metadata by itself

Unlike service protocols with formal capabilities documents, a bare XYZ template may not tell the client:

  • the layer title;

  • attribution requirements;

  • bounds;

  • supported zoom range;

  • tile format;

  • licence;

  • update cadence.

That information often needs to come from separate metadata or provider documentation.

This is one reason tile packages and service specifications frequently include metadata alongside the tile addresses.

When an XYZ URL is useful

XYZ is useful when you already know the tileset's conventions and need a simple, cache-friendly way to fetch tiles.

It is especially common for basemaps, raster overlays and custom tiled publications.

If you need richer discovery, multiple layers, queryable features or standardized capabilities, a WMS, WMTS, WFS or modern OGC API may be more appropriate depending on the task.

References

  1. OpenStreetMap Slippy Map Tilenames. Documents the familiar z/x/y scheme used by many web maps.

  2. OGC Two Dimensional Tile Matrix Set. Defines a broader standard model for tiled matrix sets and tile addressing.

Tile size is part of the client-server agreement

Many XYZ examples assume 256-pixel tiles, but some services use 512-pixel tiles or high-density variants.

The tile address can still look identical while the client interprets scale differently. Style engines may account for tile size internally, but a hand-built integration should not infer it solely from the {z}/{x}/{y} path.

Provider metadata or documentation remains the source of truth.

Bounds and zoom limits prevent wasteful requests

A tileset may cover one country rather than the whole world, or may only exist between zoom levels 5 and 14.

If the client does not know those limits, it can request thousands of nonexistent tiles. A robust integration records geographic bounds and minimum/maximum zoom alongside the template.

This metadata also improves user experience: the map can avoid zooming to scales where the tiles become empty or misleading.

Related content