MapTools
developer toolsFree · No signup

Slippy Map XYZ Tile Coordinate & Bounding Box Calculator

Convert between latitude/longitude, zoom levels, and standard slippy map tile coordinates (X, Y, Z). Calculate geographic bounding boxes and URL patterns.

Embed HTML Code:
<iframe
  width="100%"
  height="450"
  style="border:0; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);"
  loading="lazy"
  allowfullscreen
  referrerpolicy="no-referrer-when-downgrade"
  src="https://maps.google.com/maps?q=Golden%20Gate%20Bridge%2C%20San%20Francisco%2C%20CA&t=m&z=14&ie=UTF8&iwloc=&output=embed"
></iframe>
Live Responsive Preview:

Runs entirely in your browser — your inputs never leave this page.

How this tool works

  1. 1

    Applies the Web Mercator projection formulas: x = floor((lon + 180) / 360 * 2^zoom), y = floor((1 - ln(tan(lat) + sec(lat)) / pi) / 2 * 2^zoom).

  2. 2

    Calculates NW and SE corners for bounding box bounds in EPSG:4326.

Common uses

  • Debugging vector tile servers and cache warming
  • Developing custom MapLibre/Leaflet tile layers
  • Bounding box spatial indexing

Frequently asked questions

At 85.051129° latitude, the Mercator projection becomes a perfect square, allowing map tiles to be exactly 256x256 or 512x512 pixels.

More in Developer Tools

View all →
Worked example

Scoping Map Tiles for a Denver Hiking App Before Writing Any Code

A developer in Boulder, Colorado is building a hiking app and wants offline maps for the Denver metro area. Map tiles are small images, usually requested by X, Y, and zoom level, and downloading too many wastes money and storage. Before writing any code, he opens the XYZ tile calculator and enters a bounding box around Denver to count exactly what his map area needs at each zoom level he is considering. Phone storage is precious to his users, many of them on older devices, so every megabyte of bundled map has to earn its place in the download.

First he learns the scale of the system. At zoom level 12, the world is split into 4,096 columns and 4,096 rows of tiles. Each tile covers about 0.088 degrees of longitude, which at the equator is roughly 6 miles (about 9.8 kilometers) wide. Denver sits near 40 degrees north, and longitude degrees shrink with latitude, so there a tile is closer to 4.7 miles wide. His hiking area is a box about 0.5 degrees wide and 0.5 degrees tall. Dividing 0.5 by 0.088 gives about 5.7 tiles in each direction, so rounding up, he needs about 6 by 6, or 36 tiles, for zoom 12. At a typical 20 kilobytes per tile, that is only about 720 kilobytes, a trivial download.

Then he tests what happens at zoom 14, where trails and contour details appear. Each extra zoom level cuts the tile width in half in both directions, so the count grows by about four times per level. At zoom 14 a tile spans about 0.022 degrees, and his 0.5-degree box needs about 23 by 23, or roughly 529 tiles, near 10 megabytes. Zoom 16 would jump again to roughly 8,000 tiles and well over 150 megabytes. This one calculation shapes his whole design: zooms 10 through 14 come bundled with the app, and anything higher downloads only when a user asks for a specific trailhead.

Finally he pastes his bounding box into the calculator and gets the exact starting and ending X and Y values for each zoom, plus the URL pattern his code will request, in the familiar z/x/y form. He tests one URL in a browser and sees a real tile of Denver pavement and parks, confirming the whole chain works. Instead of guessing a rectangle of tile numbers and hoping it lines up with Denver, he has a precise shopping list, and the app ships with maps that end exactly where he promised users they would.

Common mistakes to avoid

  • Forgetting that tile Y runs opposite to latitude. In the XYZ system, Y increases as you go south, while latitude increases going north. If you treat Y like latitude, your map loads a mirror-image region, often an ocean on the wrong side of the planet. It is the single most common beginner bug with slippy maps.
  • Underestimating how fast tile counts grow. Each zoom level multiplies the tile count by about four. A modest area that needs 36 tiles at zoom 12 can need thousands at zoom 16, which shocks people who skip the math and then face a huge bill or a phone full of map images.
  • Ignoring partial tiles at the box edges. Your bounding box almost never aligns with tile edges. You must include every tile the box touches, even slivers, or your finished map will have blank strips along the borders. Rounding the tile range down instead of outward is how those gaps happen.

Pro tips

  • Always count tiles for your highest zoom level first, because that number decides storage and download cost.
  • Remember zoom 0 is a single tile holding the whole world, and each level down quarters the area per tile.
  • Copy the URL pattern from the calculator into your code and test one tile in a browser before downloading thousands.
Geospatial Engineering Reference & Field Manual

Applied Geospatial: Aviation, Marine, Time & Map APIs

Where mapping meets the real world: how planes navigate the curve of the Earth, how ships measure the sea, how time zones really work, and how developers build on map tiles and APIs. Written for Slippy Map XYZ Tile Coordinate & Bounding Box Calculator and the everyday mapping tasks around it.

1

Great-Circle Navigation: Why Planes Arc

The shortest path between two points on a sphere is a great circle — the route you get slicing the planet through its center. On a flat map this looks like a dramatic arc, which is why New York to Tokyo flights swing near Alaska. The map is lying; the plane is flying straight.

Airlines do not fly perfect great circles. Jet streams — rivers of wind at 35,000 feet — can add 100 mph to ground speed or subtract it. Dispatchers nudge routes into favorable winds, trading a few extra miles for much faster trips. The planned track is a great circle bent by the weather.

For flight planning, distances come in flavors. Great-circle miles are the geometric minimum; filed flight plans run 3 to 7 percent longer for airways and maneuvering. Fuel planning adds reserves on top. When a tool reports 5,500 miles for a transatlantic hop, the airline plans for 5,800.

Airports are identified by two code systems. The 3-letter IATA codes (JFK, LHR, CDG) are for travelers; the 4-letter ICAO codes (KJFK, EGLL, LFPG) are for pilots and air traffic control, with the first letter naming the region. Both point to the same runways.

2

At Sea: Nautical Miles, Knots & Rhumb Lines

A nautical mile is one minute of latitude — about 1.15 land miles or 1.85 kilometers. Because it derives from the Earth's geometry, it is the natural unit for marine navigation: one minute of latitude traveled equals one nautical mile made good, anywhere on the planet.

Speed at sea is measured in knots — nautical miles per hour. The word comes from sailors tossing a knotted rope overboard and counting knots paid out against a sandglass. A container ship at 20 knots covers about 480 nautical miles a day, which is why your overseas order takes weeks.

Sailors historically steered rhumb lines: courses of constant compass bearing. A rhumb line spirals toward the pole and runs longer than the great circle, but it is trivially easy to follow — just hold the heading. Modern ships with GPS follow great circles, but the rhumb line remains the backup every navigator learns.

Ports are the fixed points of maritime geography. Each major harbor publishes exact coordinates for its harbor entrance, and shipping contracts price by port pair. A few miles of error in a port position can misroute a vessel into the wrong traffic lane — precision matters even on the open ocean.

This page shows the first two chapters. Read the complete this category field guide →