CalcWorldHub
Free online calculator · no signup

Web Mercator XYZ tile and pixel coordinates calculator

Convert a geographic point to spherical Web Mercator metres, XYZ tile indices, and its pixel offset in a 256-pixel tile.

4,000 tools
Web Mercator XYZ tile and pixel coordinates calculator — Latitude (degrees), Longitude (degrees east), Integer map zoom and calculation method
Web Mercator XYZ tile and pixel coordinates calculator: inputs and calculation method.

How to use this calculator

Convert a geographic point to spherical Web Mercator metres, XYZ tile indices, and its pixel offset in a 256-pixel tile.

  1. Enter Latitude (degrees), Longitude (degrees east), Integer map zoom. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Web Mercator XYZ tile and pixel coordinates explained

XYZ tile coordinates locate a latitude and longitude within a zoom-dependent grid on spherical Web Mercator. The calculator reports integer tile indices, offsets inside a 256-pixel tile, and projected meters. These are map coordinates, with north at the top of the tile grid.

Inputs, symbols, and units

lat — Latitude (degrees)
Angle in degrees, converted internally to radians.
lon — Longitude (degrees east)
Longitude angle east of Greenwich, in degrees. The XYZ convention wraps the dateline; it is not a unitless tuning parameter.
zoom — Integer map zoom
Whole XYZ zoom level from zero through twenty-four. This computes coordinates and does not guarantee a provider serves that level. Enter a whole number.

Formula and method

xtile=2^z(λ+π)/(2π); ytile=2^z[1−asinh(tanφ)/π]/2; integer tile indices use floor.

XYZ places the origin at the northwest corner and y increases southward. Longitude wraps at the dateline so +180 degrees maps to −180. Pixel offsets use the fractional tile coordinate. Projected metre coordinates use radius 6378137 m.

A worked scenario

Latitude (degrees) = 49.84; Longitude (degrees east) = 24.03; Integer map zoom = 10.

  • XYZ tile x: 580
  • XYZ tile y: 347
  • Pixel x within 256px tile: 90.112 pixels
  • Pixel y within 256px tile: 253.72205486 pixels
  • Web Mercator x: 2675007.363762 m
  • Web Mercator y: 6418612.629765 m

At zoom ten the world is 1,024 tiles wide. The point’s fractional position within its tile determines the two pixel offsets, independent of a particular map provider.

Assumptions and edge cases

Spherical Web Mercator and 256-pixel XYZ tiles, not ellipsoidal Mercator or TMS reversed-y numbering. Finite latitude bounds are enforced. Zoom availability and tile-server policies are not inferred; no map tiles are requested.

Reading the outputs

Projected metres are map-plane coordinates with latitude-dependent scale distortion. They should not be read as undistorted ground distances.

Frequently asked questions

Is TMS y the same?

No. Standard TMS reverses the vertical numbering relative to XYZ.

Why are the poles excluded?

Mercator y diverges at ±90 degrees.

Does zoom 24 guarantee imagery exists?

No. This computes coordinates only; providers choose their available zoom levels.

How do I use the Web Mercator XYZ tile and pixel coordinates calculator?

Enter Latitude (degrees), Longitude (degrees east), Integer map zoom. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Web Mercator XYZ tile and pixel coordinates?

Latitude (degrees) = 49.84; Longitude (degrees east) = 24.03; Integer map zoom = 10. XYZ tile x: 580 XYZ tile y: 347 Pixel x within 256px tile: 90.112 pixels Pixel y within 256px tile: 253.72205486 pixels Web Mercator x: 2675007.363762 m Web Mercator y: 6418612.629765 m At zoom ten the world is 1,024 tiles wide. The point’s fractional position within its tile determines the two pixel offsets, independent of a particular map provider.