What Is a .db File and How Do You Open It?
You spotted a file ending in .db and you’re not sure what it is. Maybe it came from a phone backup, an app folder, or a colleague. Maybe Windows just asked which program should open it.
Here’s the short answer. A .db file is a database file. It stores structured data, like tables of contacts, messages or settings. Most of the time it’s a SQLite database, and you can open it for free in your browser.
This guide explains what .db files are, how to check which kind you have, and how to open one on any device.
What does .db stand for?
The extension .db simply means “database.” It isn’t tied to one company or format. Any developer can save a database with a .db ending. That’s why you’ll find .db files in so many places.
In practice, though, the large majority of .db files you’ll meet are SQLite databases. SQLite is the most widely deployed database engine in the world. It’s built into Android, iOS, macOS, Windows, and every major web browser.
Where .db files come from
You might find .db files in any of these places:
- Android apps. Apps store data in files like
contacts2.dbormsgstore.db. - iPhone and Mac apps. Many use SQLite, sometimes with a .db or .sqlite extension.
- Desktop programs. Media players, note apps and games often keep a .db library.
- Developer tools. Test databases, caches and local app data.
- Windows itself.
Thumbs.dbis a thumbnail cache in some folders. It’s not SQLite.
That last one matters. Not every .db file is SQLite. So it’s worth checking.
How to tell if a .db file is SQLite
Every SQLite 3 database begins with the same 16 bytes. The first 15 are the plain text:
SQLite format 3You can check this a few ways.
The easy way
Drop the file into our online SQLite viewer. It checks the header automatically. If the file is SQLite, your tables appear. If not, you’ll see a clear message saying it isn’t a SQLite 3 database.
With a text editor
Open the file in Notepad, TextEdit or VS Code. Ignore the gibberish. Look at the very first characters. If they read “SQLite format 3,” it’s SQLite.
On Mac or Linux
Open a terminal and run:
head -c 16 myfile.dbOr use the file command:
file myfile.dbIt will say something like “SQLite 3.x database” if it’s SQLite.
Other kinds of .db files
If your file isn’t SQLite, it could be one of these:
| File | What it is | How to open |
|---|---|---|
| Thumbs.db | Windows thumbnail cache | Not meant to be opened. Safe to ignore. |
| Encrypted .db | A SQLite file protected with a key | Needs the key and a tool that supports encryption |
| Berkeley DB | An older key-value database | Specialist tools |
| Paradox .db | Very old desktop database format | Legacy database software |
| App-specific .db | A custom format | Usually only the app that made it |
For most people, the only realistic cases are SQLite and encrypted SQLite. If yours is encrypted, see our guide on the file is not a database error.
How to open a .db file
Once you know it’s SQLite, you have several choices.
Option 1: Open it in your browser
- Go to our free SQLite viewer.
- Drag the .db file onto the page, or click Choose file.
- Browse the tables on the left.
It works on Windows, Mac, Linux, Android and iPhone. The file stays on your device.
Option 2: Use a desktop app
DB Browser for SQLite is free for Windows, Mac and Linux. SQLiteStudio is another free option. Install one, then use Open Database. Our list of the best SQLite viewers compares them.
Option 3: Use the command line
On a Mac, the sqlite3 tool is built in:
sqlite3 myfile.db
.tablesOn Windows, download the tools from sqlite.org first. Our Windows guide shows each step, and the Mac guide covers Terminal in detail.
What you’ll see inside
A SQLite .db file contains tables. Each table has columns and rows. For example, a notes app might have:
noteswith the title, body and date of each notefolderswith folder namestagsandnote_tagslinking notes to tags
Our guide on how to view a SQLite DB file explains how to find your way around tables, read dates, and handle binary data.
.db vs .sqlite vs .sqlite3
These extensions usually hold exactly the same format. The name is just the developer’s choice.
- .db is short and generic.
- .sqlite makes the format obvious.
- .sqlite3 points to SQLite version 3, which is what everyone uses today.
Our viewer reads the contents, not the extension, so all three open the same way. You can learn more about the .sqlite3 file and the .sqlitedb file in their own guides.
Can I change a .db file?
Yes, but be careful. If the file belongs to an app, editing it can break the app or lose data. Always:
- Close the app.
- Copy the .db file.
- Edit the copy.
- Keep the original as a backup.
In our viewer, you can run UPDATE or DELETE statements in the Run SQL tab, then click Download .db to save the changed version.
Can I convert a .db file to Excel?
Yes. Open it in the viewer, pick a table, and click Export CSV. Excel opens CSV files directly. See our step-by-step SQLite to Excel guide for tips on keeping special characters and dates intact.
Real examples of .db files
To make this concrete, here are some .db files people often find, and what’s inside each one.
- contacts2.db on older Android phones holds your contacts, phone numbers and call log in several related tables.
- mmssms.db on Android holds text messages. The
smstable has the message body, the number and a date in milliseconds. - msgstore.db is WhatsApp’s message database on Android. The live copy sits in the app’s private folder, and backups are encrypted. Our msgstore.db guide explains what you can and can’t open.
- places.sqlite and History are browser history files. They use SQLite even though one says .sqlite and the other has no extension at all.
- Game save files sometimes use .db to store progress, inventory and settings.
- Photo and music libraries in desktop apps often keep their catalog in a .db file, while the actual photos or songs sit elsewhere on disk.
Notice the pattern. The .db file holds structured information about things, not the things themselves. A photo library’s .db lists your photos and albums. It usually doesn’t contain the full images.
How big can a .db file get?
SQLite databases can grow very large. The format supports sizes far beyond anything a normal app needs. In real life, most app databases are between a few kilobytes and a few hundred megabytes.
Size matters when you choose a tool. Our browser viewer loads the whole file into memory. That’s fast and private, and it works well up to a few hundred megabytes on a typical laptop. For multi-gigabyte files, a desktop app or the sqlite3 command line is more comfortable.
Is it safe to delete a .db file?
It depends on where it lives. Deleting an app’s database usually wipes that app’s data, like chats or settings. Thumbs.db is safe to delete, since Windows rebuilds it. When in doubt, move the file somewhere else instead of deleting it, then check the app still works.
Quick checklist before you open a .db file
Run through this list and you’ll avoid almost every problem people hit:
- Copy it first. Never work on the only copy.
- Close the app that made it. This flushes recent changes into the file.
- Grab the side files. If there’s a matching -wal or -shm file, copy it too.
- Check the size. A file of 0 bytes or a few bytes is empty or a placeholder.
- Check the header. Look for “SQLite format 3” at the start.
- Use a private tool. Pick a viewer that doesn’t upload your data.
Want the technical detail? See the official SQLite article on SQLite as an application file format.
Frequently asked questions
Why won’t my .db file open when I double-click it?
Windows and macOS don’t include a SQLite viewer. There’s no default app linked to .db files. Use a SQLite viewer instead.
Can I open a .db file on my phone?
Yes. Open our viewer in your mobile browser and choose the file from your Files app. The Android guide walks through it.
Is a .db file a virus?
A .db file is data, not a program. It can’t run by itself. Still, only open files from sources you trust, as with any file.
What if my .db file is encrypted?
You’ll need the encryption key and a tool that supports it. A normal SQLite viewer can’t read encrypted databases.
Summary
A .db file is a database, and in most cases it’s SQLite. Check the first bytes for “SQLite format 3,” then open it with a SQLite viewer. The quickest option is our free online SQLite viewer, which runs in your browser and never uploads your file.







