What is a .mbtiles file?
MBTiles Map Tileset · Data · Mapbox · 2011
An .mbtiles file packs a whole map into one file: thousands or millions of map tiles stored in an SQLite database. Offline map apps and tile servers use it to ship complete tilesets.
What is a .mbtiles file used for?
MBTiles is a clever reuse of SQLite: a tiles table keyed by zoom, column and row holds the images (raster PNG/JPG) or vector tiles (gzipped PBF), plus a metadata table describing the set. One file replaces a folder tree of millions of tiny tiles.
It is the standard container for offline maps in mobile apps and for serving self-hosted maps with tools like tileserver-gl and MapLibre. Because it is literally an SQLite database, any SQLite browser can peek inside.
What opens a .mbtiles file?
The .mbtiles format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.
Windows
- QGIS
- tileserver-gl
- DB Browser for SQLite (inspect)
macOS
- QGIS
- tileserver-gl
- DB Browser for SQLite
Linux
- QGIS
- tileserver-gl
- sqlite3
Open a .mbtiles file step by step
- Confirm the file really is a .mbtiles. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
- On Windows, open it with QGIS or tileserver-gl.
- On Mac, use QGIS or tileserver-gl.
- On Linux, try QGIS or tileserver-gl.
- Still stuck? Convert the .mbtiles to png/jpg tiles (extract), which opens more widely.
Why can't I open my .mbtiles file?
Almost always because no installed app understands MBTiles. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.
The other possibility is that the file is not really a .mbtiles at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.
How to convert a .mbtiles file
You can convert a .mbtiles file to png/jpg tiles (extract), pmtiles using a conversion tool or the export menu of an app that opens it.
What is the .mbtiles file signature (magic bytes)?
A .mbtiles file starts with the hex bytes 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00, which read as SQLite format 3\0 in ASCII. Programs identify MBTiles by those bytes, not by the filename, so a renamed file still gives itself away.
These are the documented signatures for MBTiles. For a full breakdown, see the SQLite file signature page.
| Hex signature | Offset | ASCII | Note |
|---|---|---|---|
| 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 | 0 | SQLite format 3\0 | SQLite database container |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .mbtiles file?
An .mbtiles file packs a whole map into one file: thousands or millions of map tiles stored in an SQLite database. Offline map apps and tile servers use it to ship complete tilesets.
How do I open an .mbtiles file?
QGIS opens it directly as a raster or vector tile layer. To serve it as a live map, point tileserver-gl or a MapLibre-based viewer at the file.
Why does my .mbtiles map look upside down or misplaced?
MBTiles stores rows in TMS order (flipped Y) while many web tools expect XYZ. Viewers that ignore the difference draw tiles at mirrored positions; use a tool that handles the scheme.
Can I look inside an .mbtiles file?
Yes, it is an SQLite database: open it in DB Browser for SQLite and query the metadata and tiles tables directly.
Related formats
Sources
Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.