Tile to Bing Maps quadkey
Get the Bing Maps quadkey for any tile: column 3, row 5 at zoom 3 gives 213, the same digits that real tile addresses and cache keys use. Zoom levels from 1 to 23 are accepted. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Tile column
- 3
- Tile row
- 5
- Zoom
- 3
- Quadkey
- 213
- Length
- 3
- Max index
- 7
Bing Maps and many Azure Maps tile pipelines identify each square on the Web Mercator grid with a compact base-4 string called a quadkey. Given integer tile column X, tile row Y, and a zoom level of detail, this capability builds that string with the same bit-folding rules published in Microsoft’s Bing Maps Tile System documentation, so the digits you get match production tile URLs and cache keys. Out-of-range tile indices for the chosen zoom fail with a clear invalid input error instead of inventing a silent wrap.
How a quadkey folds X and Y into one string
A quadkey is a short string of digits from 0 to 3 that names one square on the Web Mercator tile grid used by Bing Maps and Azure Maps. Picture the world split into four quadrants, then each quadrant split into four again, once per zoom level. Each digit records which quarter was chosen at that step: 0 for the northwest child, 1 for the northeast, 2 for the southwest and 3 for the southeast. The encoder reads the bits of the column and the row from the highest zoom level down to the lowest and combines one bit of each into every digit. That is why the string always has as many digits as the zoom level, and column 3, row 5 at zoom 3 becomes 213.
When to use it and the mistakes it catches
Use it when you build tile addresses for Bing or Azure Maps, when you need the same key a tile cache uses, or when you check coursework on tile systems. The most common mistake is a column or row that does not exist at the chosen zoom level. At zoom 3 both must be between 0 and 7, and anything larger is refused instead of being wrapped around silently. Negative numbers and values with decimals are refused too, and the zoom must be a whole number from 1 to 23. Because the result depends only on the three numbers you enter, the same tile always gives the same key.
What a Bing Maps quadkey is and which X, Y, zoom to send
A quadkey is a string of digits zero through three whose length equals the zoom level. Each digit encodes one step of a recursive quadrant split of the world: zero is the northwest child, one the northeast, two the southwest, and three the southeast, matching the interleaving of tile X and Y bits from the most significant zoom bit down to the least significant.
Send required integer fields x and y for the tile column and row in the Bing Maps grid, and zoom for the level of detail between one and twenty-three. At zoom z the valid range for both x and y is the closed interval from zero through two to the power z minus one. That is the same bound every compliant tile server enforces before building a URL path.
What you can do with it
Bing and Azure tile URL builders
Backends that assemble Bing Maps or Azure Maps tile paths convert integer X/Y/zoom into a quadkey string that matches production CDN keys and cache partitions.
FAQ
How do I convert tile X, Y, and zoom to a Bing Maps quadkey?
The response includes the quadkey string (213 for that classic example).
What happens if the tile index is outside the valid range?
For zoom z both x and y must lie in [0, 2^z − 1]. Out-of-range indices are rejected and not charged.
Is the tile to Bing Maps quadkey tool free?
The browser tool runs free on your device.
Does this match Microsoft’s TileXYToQuadKey?
Yes. Encoding follows the Bing Maps Tile System bit-folding rules: for each zoom bit, add 1 if X has the bit and add 2 if Y has the bit.
Which zoom levels can I use?
Any whole number from 1 to 23. At each zoom, X and Y must stay between 0 and 2 to the power of the zoom minus 1, so at zoom 3 the largest allowed index is 7.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/quadkey-encode \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x":3,"y":5,"zoom":3}'const res = await fetch("https://api.kit.forhosting.com/geo/quadkey-encode", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x": 3,
"y": 5,
"zoom": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/quadkey-encode",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x": 3,
"y": 5,
"zoom": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/quadkey-encode", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x":3,"y":5,"zoom":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x":3,"y":5,"zoom":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/quadkey-encode", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x": 3,
"y": 5,
"zoom": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.quadkey_encode",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Students, GIS engineers, and backend services can pin the deterministic JSON in tests without embedding a full mapping SDK.
What a Bing Maps quadkey is and which X, Y, zoom to send
Aliases tile_x, tileX, and col are accepted for x; tile_y, tileY, and row for y; and z, level, level_of_detail, or lod for zoom when your client already uses those names. Missing fields, non-integers, zoom outside one to twenty-three, and negative or oversized tile indices all fail with invalid_input so homework checkers and pipelines never accept a silently clipped coordinate. Identical inputs always produce identical JSON because the path is pure bit arithmetic with no network, no random seed, and no wall clock.
Reading the quadkey response and validating tile bounds
Prefer the structured fields over parsing the quadkey yourself when you only need bounds metadata; keep the string when you must build Bing or Azure tile paths that embed the key directly. On success the response echoes normalized x, y, and zoom, returns the quadkey string, sets length equal to zoom so clients can assert digit count without counting characters by hand, and includes max_index equal to two to the power zoom minus one as the inclusive upper bound that was applied during validation. The method label is always bing_maps_tile_xy_to_quadkey so downstream code can branch without sniffing shapes when you mix this encoder with geohash or other spatial keys. When a request fails because x or y falls outside zero through max_index, the error message names the bad axis and the valid range for that zoom, which makes debugging off-by-one mistakes in lat-lon to tile converters straightforward.
API usage, pricing, map workflows, and practical limits
Send a JSON body with the required integers x, y, and zoom. Call the free in-browser tile to Bing Maps quadkey tool for lecture demos, quick mental checks of TMS coordinates, and local verification without installing a maps SDK. Use the prepaid API when a tile cache, CDN purger, GIS ETL job, mobile offline packager, or educational platform needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Zoom is capped at twenty-three to cover practical map levels of detail while keeping the bit loop bounded on a Worker isolate. Authors shipping SDKs can map the quadkey field directly into URL templates of the form path slash quadkey period image format used by classic Bing tile endpoints.
Integration use cases
GIS pipeline fixtures and CI oracles
Teams pin known tiles such as x=3, y=5, zoom=3 → 213 so projection and TMS refactors cannot silently change spatial addressing.
Teaching the Bing Maps Tile System
Instructors and students encode small zoom levels by hand, compare against the API, and learn how X and Y bits fold into base-4 digits.
Technical questions
Which zoom levels are supported?
Zoom (aliases z, level, level_of_detail, lod) must be an integer from 1 through 23. The quadkey length always equals the zoom.