How to open a .db file, starting with what kind it is.

A .db file is a database, but the extension doesn't say which program made it. Most are SQLite databases, which a SQLite viewer opens in a minute. Check the first bytes of the file to be sure, then pick the right tool below.

Book a demo

Valv Desktop opens SQLite .db files on macOS, Windows, and Linux. Free for personal use. Check your file first.

Step 1

Find out what kind of .db file you have.

Every file format starts with its own bytes. One command shows them. Run it in the folder that holds the file.

On Mac or Linux

Open Terminal. The file command names the format for you.

$ file data.db
data.db: SQLite 3.x database, last written using SQLite version 3045001

On Windows

Open PowerShell and print the first 16 bytes. Read the text column on the right.

PS> Format-Hex .\data.db | Select-Object -First 1

SQLite format 3 at the start means it is a SQLite database.

The kinds of .db file you are likely to find
Kind First bytes What file says Where it comes from How to open it
SQLite database SQLite format 3 SQLite 3.x database Apps, browsers, phones, Python and Django projects. By far the most common .db. Valv Desktop, DB Browser for SQLite, or the sqlite3 command line tool.
Windows thumbnail cache D0 CF 11 E0 A1 B1 1A E1 Composite Document File V2 Document A file named Thumbs.db inside a Windows folder of pictures or videos. Nothing to open. It only holds preview images. Safe to delete.
Paradox table No readable signature Varies, often just data Old Borland or Corel business software, with .px (and often .mb or .val) files next to it. pxview (pxlib) can export it to CSV or SQLite. Then open the result in a viewer.
Berkeley DB Magic number at byte 12 Berkeley DB (Btree or Hash) Unix and Linux tools, older mail and package software. db_dump prints its keys and values as text.
Encrypted SQLite (SQLCipher) Random bytes data Messaging and password apps that encrypt their storage. DB Browser for SQLite with the key. Without the key it can't be read.

Microsoft Access files end in .accdb or .mdb, not .db. A .dbf file is a dBASE table, a different format again.

Step 2

Open a SQLite .db file.

There is no server, user, or password. You point a viewer at the file. Three ways, from easiest to most hands-on.

Valv Desktop

To look around and ask questions

Add a datasource, choose SQLite, click Open and pick the file. Any extension works. Tables show up in the sidebar: browse, sort, filter, and export rows to CSV. If you set up a coding agent, ask what is in the file and get answers with the query behind each number. Full walkthrough.

DB Browser for SQLite

To edit the data or the tables

Free and open source. Choose Open Database and pick the file. It can also change rows and table structure, and open SQLCipher-encrypted files if you have the key.

The sqlite3 command

If you know SQL

Preinstalled on macOS and most Linux systems. On Windows, download it from sqlite.org.

$ sqlite3 data.db
sqlite> .tables
sqlite> .schema users

Make sense of a file you didn't create.

App databases often have dozens of tables with cryptic names. In Valv, ask the agent instead of reading every table:

What does each table in this file store, and which ones hold the actual messages?

Valv works with the agent you already use, like Claude Code, Codex, or Cursor. The file is read on your machine and never uploaded to Valv.

If it won't open.

  • "Database is locked": the app that owns it is running. Quit it, or open a copy.
  • Recent data missing: copy the -wal file next to it along with the database.
  • "File is not a database": it is not SQLite, or it is encrypted. Go back to step 1.
  • Permission denied on macOS: folders like Messages and Safari are protected. Give the viewer Full Disk Access in System Settings, Privacy and Security.

Not SQLite

Opening the other kinds.

Thumbs.db

Windows stores folder previews here. There is nothing of yours to read. Delete it if it is in the way, for example when it blocks deleting a folder on a network drive. Windows makes a new one if it needs it.

Paradox

Keep the .db together with its .px, .mb, and .val files. The free pxview tool from pxlib exports a table to CSV or SQLite. A CSV opens in any spreadsheet, and the SQLite copy opens in any SQLite viewer.

Berkeley DB

It is a key-value store, not tables. Install the Berkeley DB utilities from your package manager and run db_dump -p file.db to print the contents as readable text.

Opening .db files, answered

What is a .db file?

A .db file is a database file. The extension only says that, not which program made it. Most .db files you find on a computer or phone are SQLite databases. Others are a Windows thumbnail cache (Thumbs.db), an old Paradox table, or a Berkeley DB file.

How do I open a .db file on Windows?

Windows has no program set up for .db files, so double-clicking does nothing useful. First check the type: run Format-Hex on the file in PowerShell and read the first line. If it starts with SQLite format 3, open it with a SQLite viewer such as Valv Desktop or DB Browser for SQLite.

How do I open a .db file on a Mac?

Run file on it in Terminal to see the type. For a SQLite database, open it with Valv Desktop or DB Browser for SQLite, or run sqlite3 on the file. macOS ships the sqlite3 command line tool.

Can Microsoft Access open a .db file?

Not directly. Access uses .accdb and .mdb files. A SQLite .db file can only be linked into Access through a SQLite ODBC driver, which is more setup than most people need. A SQLite viewer opens it in a minute.

Why does my .db file look like gibberish in Notepad?

A database file is binary, not text. A text editor shows the raw bytes. The first few characters are still useful though: SQLite format 3 at the very start means it is a SQLite database.

Is it safe to delete Thumbs.db?

Yes. Thumbs.db is a cache of folder thumbnails that Windows creates. Deleting it only means Windows rebuilds the previews. There is no data of yours inside.

Can I open an encrypted .db file?

Only with the key. Apps like Signal encrypt their SQLite databases with SQLCipher, and the file then looks like random bytes from the first byte on. DB Browser for SQLite can open SQLCipher files if you have the password. Valv Desktop does not support encrypted SQLite.

Will opening the file change it?

Valv has no tools that change your data: the table viewer is read-only and the agent has no insert, update, or delete tools. To be completely safe with another app's database, open a copy of the file.

Open your .db file.

Free for personal use, every feature included. Commercial use needs a seat at beta pricing. See pricing.

All downloads Other platforms and builds