.mbtiles

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.

Category
Data
Type
Binary
Is a .mbtiles file safe to open? Safe. An .mbtiles file is a database of map images and metadata; it does not execute.

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.

How to open 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. For a step-by-step walkthrough, see how to open a .mbtiles file.

Windows

  • QGIS
  • tileserver-gl
  • DB Browser for SQLite (inspect)

macOS

  • QGIS
  • tileserver-gl
  • DB Browser for SQLite

Linux

  • QGIS
  • tileserver-gl
  • sqlite3

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.

.mbtiles file signature (magic bytes)

Programs recognise a .mbtiles file by the bytes at the start of the file, not by its name. These are the signatures for MBTiles. For a full breakdown, see the MBTiles file signature page.

Hex signatureOffsetNote
53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 000SQLite 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: