macOS is a good place to work with SQLite: the command-line tool comes preinstalled, and many Mac apps store their data in SQLite files. Here are three ways to look inside one, from no setup at all to a full desktop app.

Option 1: In your browser (no install)

  1. Open opensqlite.com in Safari, Chrome or Firefox.
  2. Drag the database from Finder onto the drop zone, or click Open SQLite file and choose it.
  3. Pick a table to browse its rows. Click a column name to sort, search within the table, and click a row to see every field.

The file is read by SQLite running inside the browser tab and never uploaded. It’s opened read-only, so it can’t be changed.

Option 2: The sqlite3 tool in Terminal (already installed)

Every Mac includes the sqlite3 command-line shell. Open Terminal (in Applications → Utilities) and type sqlite3 -readonly , with a space at the end, then drag the database file from Finder into the Terminal window to paste its full path. Press Return.

sqlite3 -readonly ~/Downloads/chinook.db

-readonly makes sure nothing you type can modify the file. At the sqlite> prompt, try:

.tables
.schema Track
.mode box
SELECT * FROM Track LIMIT 10;
SELECT COUNT(*) FROM Track;
.quit
Command What it does
.tables Lists all tables
.schema Track Shows a table’s columns and types
.mode box Draws results as a neat table
SELECT * FROM Track LIMIT 10; Shows the first 10 rows
SELECT COUNT(*) FROM Track; Counts the rows
.quit Exits

The examples use Track, a table in the Chinook sample database; swap in your own table names. Lines starting with a dot are commands for the shell; everything else is SQL and must end with a semicolon. If a query prints more than fits on screen, add LIMIT to see fewer rows.

Option 3: DB Browser for SQLite (desktop app)

DB Browser for SQLite is a free, open-source app with a spreadsheet-like view, a SQL editor, editing and CSV export. Download it from the website, or install it with Homebrew:

brew install --cask db-browser-for-sqlite

To browse without risk of editing, use File → Open Database Read Only.

Where Mac apps keep their SQLite files

Many apps store data in SQLite files inside your Library folder, which Finder hides by default. To get there, choose Go → Go to Folder in Finder and type ~/Library. Places worth knowing:

Path What’s inside
~/Library/Application Support/<App name>/ Data for many third-party apps
~/Library/Containers/<app id>/Data/Library/ Data for sandboxed (App Store) apps
~/Library/Safari/History.db Safari browsing history
~/Library/Messages/chat.db Messages history

To find SQLite files anywhere in your home folder, ask Terminal:

find ~ \( -name "*.sqlite" -o -name "*.sqlite3" -o -name "*.db" \) 2>/dev/null

A few things to keep in mind:

  • Work on a copy. Quit the app first, then copy the database (with any -wal file next to it) to your Desktop and open the copy. Opening a live app’s database can show stale data or get in the app’s way. What the -wal and -shm files are.
  • Some folders are protected. macOS guards personal data such as Safari and Messages. If Terminal says “Operation not permitted”, either copy the file in Finder first, or give Terminal Full Disk Access in System Settings → Privacy & Security (and remove it again afterwards).
  • Photos and some Apple apps use packages. A .photoslibrary file is really a folder; right-click and choose Show Package Contents to see the databases inside. Treat them as read-only.

Which should you use?

  • Quick look, nothing installed: your browser.
  • Queries and scripting: sqlite3 in Terminal.
  • Editing, exporting or regular use: DB Browser for SQLite.

New to SQLite files? Start with how to open a .db file.