You have a .db or .sqlite file and you need to see what is inside. No code required. Grab DB Browser for SQLite, a free, open-source tool that runs on Windows, macOS and Linux. You will open the file read-only so nothing changes, browse tables and rows, export everything to a spreadsheet, and understand the error messages that appear when a file is damaged.
What is DB Browser for SQLite
DB Browser for SQLite (DB4S for short) is a graphical viewer for SQLite stores. It runs on Windows, macOS and Linux. You do not need to know a single programming command. If you want a free sqlite viewer, this is the one to install. Non-developers use it to open an sqlite file without code and inspect the data straight away.
Download and Install DB4S
Go to the official DB Browser for SQLite site and download the version for your operating system. The installer is straightforward. Open the application. You will see a window with menus: File, Edit, View, Help. The main toolbar has buttons for common tasks like opening a store or executing SQL.
How to Open a .db File Safely
When you open a file that belongs to another application, avoid accidental changes. DB Browser for SQLite has a dedicated read-only mode for exactly this.
- Launch DB Browser for SQLite.
- Click the File menu.
- Select Open Database Read Only... from the dropdown.
- In the file chooser, locate your .db or .sqlite file and click Open.
Using File > Open Database Read Only... opens a file with zero risk of changing it. This is the safest way to view content from an app you do not want to modify.
Viewing the Data Inside
Structure, Data and SQL Tabs
Once the file is open, you will see several tabs near the top of the window. The ones you need:
- Database Structure, Shows all tables, indexes and views in the file.
- Browse Data, Click this tab to see the actual rows. Pick a table from the dropdown on the left and its contents appear in a grid.
- Execute SQL, This tab lets you run queries. Type PRAGMA integrity_check; and click the play button to check if the store is healthy.
If the file contains multiple tables, switch between them in the Browse Data tab. The grid shows every column and row. Scroll through the data easily.
Exporting Data to a Spreadsheet
Inspected the data? Now get it into a spreadsheet. DB Browser for SQLite makes this simple.
- Make sure your store is open and you are on the Browse Data tab.
- Click the File menu.
- Hover over Export.
- Select Table(s) as CSV file....
- Choose which tables to export and where to save the CSV file.
You now have a CSV. Open it in Excel, Google Sheets, or any other spreadsheet application.
What If the File Does Not Open
Two Common Errors
Not every .db file is a SQLite store. A valid one always starts with the bytes "SQLite format 3". If you try to open something that is not SQLite, or if the file is damaged, DB Browser for SQLite shows an error message. The two you will see most often:
- "database disk image is malformed", The file is SQLite but its internal structure is corrupted or incomplete.
- "file is not a database", The file is either not SQLite at all, or the header bytes are missing or wrong.
Either error means the file is damaged or not SQLite. Always work on a copy of an app's store, never the original. You risk nothing. If the file is not SQLite, you need a different tool. If it is a corrupted SQLite file, online services such as sqlite.repair may recover the data.
Safety and Backups
Before you open any store that belongs to another program, make a copy. Keep the original untouched. Open the copy with DB Browser for SQLite. If something goes wrong, you still have the original file intact. The read-only mode described earlier adds another layer of safety. A backup is still the best practice.