How to open a .db file
Database file · Database
A .db file is a database, and most of the time it is SQLite. DB Browser for SQLite opens those for free. Check the first bytes first: a real SQLite file begins with the text "SQLite format 3".
What a .db file actually is
The extension says "database" and nothing more, but in practice SQLite dominates it. Phone apps, browsers, desktop programs and countless embedded systems all store their data in a single SQLite .db file.
Some programs use .db for their own proprietary store, so the header check matters before you assume.
Why it will not open
Nothing on Windows or macOS opens a database by double-clicking. And a .db that is not SQLite will not open in a SQLite tool no matter what you try, which is why identifying it first saves time.
Step by step
Windows
- 01Identify it: open the file in HxD and look at the first 16 bytes. "SQLite format 3" in readable text confirms SQLite.
- 02Install DB Browser for SQLite, which is free, and open the file. Tables appear in a browsable list.
- 03Work on a copy. If the program that owns the database is running, opening the live file can lock it or, worse, corrupt it.
- 04If the header shows something else, the format is proprietary and only the program that created it will read it.
macOS
- 01DB Browser for SQLite has a macOS build.
- 02In Terminal, "sqlite3 file.db" then ".tables" lists the contents with nothing installed, since macOS ships sqlite3.
- 03Run "file yourfile.db" first to confirm what it actually is.
What usually goes wrong
Look for -wal and -shm files
SQLite in write-ahead mode keeps recent changes in companion files named database.db-wal and database.db-shm. Copying only the .db leaves the newest data behind. Copy all three together.
Programs that open .db
Our pick, in order. Every one links to the publisher's official download URL and the SHA-256 hash of the installer, so you can check the file before you run it.
Common questions
- How do I open a .db file for free?
- DB Browser for SQLite opens SQLite databases on Windows, macOS and Linux at no cost. On macOS the built-in sqlite3 command works too. Confirm first that the file really is SQLite by checking its header.
- How do I know if a .db file is SQLite?
- Open it in a hex editor and read the first bytes. A SQLite database starts with the readable text "SQLite format 3". On macOS the "file" command reports it directly.