MapTools
developer toolsDevFree · No signup

QuadKey Converter (Bing Maps & Tile Pyramid)

Convert Slippy Map XYZ coordinates to Bing Maps QuadKey hierarchical spatial indices and back with visual quadtree breakdown.

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

    Interleaves the binary bits of tile X and tile Y coordinates.

  2. 2

    Converts the interleaved binary string into a base-4 string (digits 0, 1, 2, 3).

  3. 3

    Decodes QuadKeys back into bounding box coordinates and hierarchical quadtree nodes.

Common uses

  • Spatial indexing and range querying in high-throughput NoSQL databases.
  • Hierarchical geospatial data partitioning in big data pipelines.
  • Tile caching and CDN distribution key generation.

Frequently asked questions

Because QuadKeys preserve spatial locality on a one-dimensional space-filling Peano curve, neighboring tiles share common string prefixes.

More in Developer Tools

View all →
Worked example

Turning a London Map Tile into a Bing Maps Quadkey

A data analyst in Manchester stores map tile references in a database that also feeds a Bing Maps dashboard, and the dashboard wants quadkeys instead of the usual X and Y tile numbers. For a tile over central London at zoom level 10, her other tools give X 511 and Y 340. At London's latitude that single tile stretches roughly 15 miles (about 24 kilometers) across, taking in the whole city center and a good ring of suburbs around it. She opens the QuadKey Converter to translate that one tile and to understand what the string means before converting ten thousand more. Her table covers the whole country at several zoom levels, so one misunderstood digit would not be a single wrong tile but a wrong system repeated ten thousand times.

A quadkey is built by interleaving the bits of X and Y, one zoom level at a time, starting from the top. Each digit is the X bit plus twice the Y bit, so every digit lands between 0 and 3. Reading the bits of 511 and 340 from the most significant down gives the digit sequence 0, 3, 1, 3, 1, 3, 1, 3, 1, 1, so the quadkey is 0313131311. The converter confirms it and shows the quadtree breakdown level by level. The first digit passes a common-sense test before she even checks the rest: London sits in the northwest quadrant of the world at zoom 1, so both leading bits are 0 and the key correctly begins with 0.

Two properties make the string genuinely useful in her database. First, the quadkey's length always equals the zoom level, ten digits for zoom 10, so the zoom is never a separate thing to store. Second, parent tiles are prefixes: the zoom-9 tile covering the same ground is simply the first nine digits, 031313131, and nearby tiles share long prefixes, which makes 'find everything in this area' a fast text-prefix search. She uses exactly that trick the same week, pulling every tile inside one London borough with a single prefix query and no geometry code at all.

She converts the full table, spot-checks three tiles by converting them back to X and Y, and gets exactly the numbers she started with. The round trip is the proof she wanted before the dashboard goes live on Monday. She finishes by setting the database column to text on purpose and noting why in the schema, so the next person to import data cannot quietly turn her keys back into numbers.

Common mistakes to avoid

  • Storing quadkeys as numbers. Quadkeys are text. Store 0313131311 in a numeric column and the database drops the leading zero, producing a shorter key that points at a different tile or none at all. This is probably the most common quadkey bug of all, and spreadsheets will commit it automatically if you let them format the column.
  • Swapping X and Y before converting. Interleaving the bits in the wrong order still produces a tidy string of digits between 0 and 3, so nothing looks broken, but the key describes a tile somewhere else entirely. Follow the tool's labeled direction, X first, and prove it with a round-trip conversion.
  • Thinking the digits are X and Y written out. A quadkey is not the coordinates concatenated. Each digit mixes one bit from X and one bit from Y, which is why a single digit can locate the tile within its parent quadrant, and why the first digit alone names the quadrant of the world the tile sits in.

Pro tips

  • Convert one converted value back to X and Y as a round-trip check before batch-converting a whole table.
  • To find the parent tile at one zoom lower, just remove the last digit; no calculation needed, and the grandparent is simply two digits shorter.
  • Keep quadkeys in a text or varchar column and index it, so prefix searches for neighboring tiles stay fast enough to replace real geometry queries.
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 QuadKey Converter (Bing Maps & Tile Pyramid) 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 →