.sqlite.sqlite3.db.db3
SQLite file: what it is and how to open it
A SQLite file is a complete database in one file: tables of rows and columns that apps use to store messages, contacts, history and settings. Open one with DB Browser for SQLite on a computer, or with Universal File Opener on Android or Windows.
Drop your SQLite file here
Opens on this device. Nothing is uploaded. Any other file works too.
What is an SQLite file?
SQLite is a database engine that keeps a whole database, with its tables, indexes, views and triggers, in one ordinary file, with no server. D. Richard Hipp, still its lead developer, started the project in May 2000; the current file format arrived with SQLite 3.0 in 2004, and the code is public domain. The file format is documented, cross-platform and backward compatible.
The SQLite project calls it the most widely deployed database engine: it is in every Android phone, iPhone, Mac and Windows 10 or 11 PC, and in Firefox, Chrome and Safari. That is why .db files turn up in app folders, phone backups and data exports. The Library of Congress lists SQLite among its preferred formats for datasets.
The extension is only a hint. .sqlite, .sqlite3, .db and .db3 are all used, while other programs use .db for formats of their own, such as the hidden Thumbs.db thumbnail cache Windows writes. The first bytes settle it: every SQLite 3 database starts with the text SQLite format 3.
What is inside
The file is split into pages of equal size, from 512 bytes to 64 KB; new databases use 4 KB by default. Page 1 starts with a 100-byte header and holds the schema table, which lists every table, index, view and trigger with the SQL that created it. Each ordinary table is a B-tree whose leaves hold the rows, in order of a 64-bit row number, the rowid.
A database in use can have companion files. In the default mode a temporary name.db-journal appears while changes are written. In write-ahead log mode, name.db-wal holds recent changes not yet copied back into the main file and name.db-shm indexes them. A copy of the .db alone can miss those changes or look damaged, so copy the companions too, or close the app first.
contacts.dbpage 1header: SQLite format 3, page size, text encoding schema table: every table, index, view and triggerpage 2 …B-tree pages for each table, rows ordered by rowid index pages, and overflow pages for long values free pages, reused before the file growscontacts.db-walrecent changes not yet copied into the filecontacts.db-shmindex into the WAL for open connectionsHow to open an SQLite file
Windows
- DB Browser for SQLiteFree and open source. Browse and edit tables, run SQL and export tables to CSV. Opens SQLCipher-encrypted databases with their password.
- sqlite3 command-line shellFree from sqlite.org, in the command-line tools download. .tables lists the tables, .schema shows their structure and any SQL query runs.
- Universal File Opener for WindowsOursShows tables, schema and supported query results. Saving edits to eligible rows needs Pro.
Mac
- DB Browser for SQLiteFree. The same app as on Windows, as a Mac download.
- sqlite3 command-line shellFree from sqlite.org for Macs with Apple or Intel chips. Run it in Terminal.
Android
- Universal File OpenerOursBrowse, filter and sort tables, copy cells, run supported read-only queries and export a table as CSV, free. Saving edits to eligible rows needs Pro.
In a browser
- SQLite FiddleFrom the SQLite project. Load DB opens a database in your browser, on your device, to run SQL. Large files can run out of memory.
Won’t open?
It says file is not a database
The file is not SQLite (it should start with SQLite format 3), or it is encrypted, as some apps do with SQLCipher. An encrypted database opens only with its key, in a tool such as DB Browser for SQLite.
It says database is locked
Another program has the database open and is writing to it. Close that program, or copy the file together with its -wal and -shm files and open the copy.
Recent data is missing, or database disk image is malformed
The file was probably copied without its -wal file or while it was being written. Copy it again with its companions after closing the app. For real damage, the sqlite3 shell’s .recover command rescues what it can.
Double-clicking does nothing
Windows, macOS and Android have no SQLite viewer of their own. Install one of the apps above. If none of them accepts it, the .db file may belong to another program entirely.
An app misbehaves after I edited its database
Always work on a copy. Changing another app’s database, especially while it runs, can break that app even when the file itself stays valid.
Convert an SQLite file
- To CSVDB Browser for SQLite: File, Export, Table(s) as CSV file. In our Android app, Export CSV in the Data menu saves the table you are viewing.
- To SQL textIn the sqlite3 shell, .dump writes the whole database as SQL statements that rebuild it; .recover does the same for a damaged file.
SQLite files in our apps
Browse SQLite tables offline on Android and Windows and run supported read-only queries. On Android, filter, sort, copy cells and export a table as CSV for free. Pro saves edits to eligible rows. Work on a copy.
All Android tools and limits for SQLite files
- Browse every table with lazy loading for large databases.
- Filter, sort, and copy cell values with a tap.
- Edit cell values, insert rows or delete rows in eligible ordinary tables with row identifiers. Saving those edits needs Pro.
- Choose Tools, then SQL editor, to run a supported read-only query. Results appear in the grid and can be exported as CSV.
- Export CSV from the Data menu writes the table you are looking at as a CSV file, free.
- Reading position resumes per table.
Limits
- Editing requires a writable table with supported row identifiers. Views and unsupported schemas are read-only.
- Run one non-recursive SELECT or WITH query at a time. SQL statements that write data are unavailable.
Walkthrough: Edit text, code and data on Android