SQLite viewer: open .db and .sqlite files in your browser
Drop a SQLite database to see every table with its row count, the CREATE statement behind it, the rows in a grid you can scroll and sort, and a SQL box that can only read. It runs real SQLite (3.49.1, compiled to WebAssembly by sql.js 1.14.2) inside this tab.
The database is opened on your device. It is never uploaded.
What it shows
- Every table and view, each with its exact row count from
SELECT COUNT(*). - The schema: the CREATE statement exactly as SQLite stored it in
sqlite_schema, followed by that table's indexes and triggers. - The rows, loaded 100 at a time as you scroll, so a table with millions of rows opens as fast as a small one. Click a column name to sort (NULLs go last). Click a cell to see its full value. BLOBs show their size in bytes.
- File facts: page size and count, text encoding,
user_version(apps use it for their schema version) and journal mode.
The SQL box can only read
The database is opened with PRAGMA query_only = ON, so SQLite itself refuses any write. On top of that, the box accepts one statement at a time and only SELECT, WITH … SELECT, VALUES, EXPLAIN and reading PRAGMAs such as table_info and integrity_check. The engine works on a copy in memory anyway, so nothing typed here could change the file on your disk.
Queries worth knowing:
SELECT type, name FROM sqlite_schema ORDER BY type, namelists everything, including indexes and triggers.PRAGMA integrity_checkanswers "is this file damaged?". A healthy database saysok.SELECT * FROM pragma_foreign_key_list('books')shows what a table points to.
Files that are SQLite inside
viewhack goes by the file's first 16 bytes, not its extension, so these open too:
- Browser data: Firefox
places.sqlite(history and bookmarks) and Chrome'sHistoryfile, which has no extension. Close the browser first or open a copy: a running browser holds the file open and may not have written its latest changes into it yet. - Photo and study apps: Lightroom Classic catalogs (
.lrcat) and Anki collections (.anki2). - Maps: GeoPackage (
.gpkg) and MBTiles (.mbtiles). Geometry and tile images appear as BLOBs. - Phone app databases pulled from backups or with developer tools. These are often plain SQLite, but check the section below for encrypted ones.
Databases with a -wal file
A database in write-ahead-log mode does not write changes into its own file straight away. Each committed transaction is appended to a second file with the same name plus -wal (History and History-wal, notes.db and notes.db-wal), and only a checkpoint copies those pages back into the main file. By default SQLite checkpoints once the log reaches 1,000 pages (about 4 MB with 4 KB pages) or when the last connection closes cleanly (sqlite.org: Write-Ahead Logging). So a copy of a database taken while its app is running, from a browser profile, a chat app or a phone backup, can be missing everything written since the last checkpoint: new rows, new tables, deletions.
Drop the database and its -wal together, or choose both at once, or open the database first and press Add …-wal. The page reads the log the way SQLite's own recovery does, following the file-format document (sqlite.org: Database File Format, section 4):
- the 32-byte log header gives the page size, two random salt values and a checksum; each frame is a 24-byte header plus one page image;
- each frame's checksum carries on from the one before it, computed on 32-bit words in the byte order the header's magic number names. Reading stops at the first frame whose checksum or salt does not match, and the page says how many frames it ignored and why;
- only frames up to the last commit frame are used. Frames of a transaction that had not committed when the copy was made are left out, as SQLite would leave them out;
- the latest image of each page is patched into a copy of the database in memory. Both of your files stay as they are.
A banner then says how many frames were applied, and Row counts with and without the -wal puts each table's count from the main file alone beside its count with the log, so you can see what the log added or deleted. The -shm file next to them is only an index SQLite rebuilds from the log, and is not needed. A -wal dropped on its own is named as a log, and the page tells you which database file it belongs to. It cannot be read alone, because it only holds the pages that changed.
What it cannot open
- Encrypted databases (SQLCipher, used by Signal, and WhatsApp's
.crypt14backups) have no readable header. They show up as unrecognised data, and nothing can open them without the key. - Changes in a -wal you did not choose. viewhack reads only the files you give it. A WAL-mode database opened alone shows its state at the last checkpoint, and the page says so and offers to add the log.
- FTS5 full-text and R*Tree tables show their schema but not their rows. This SQLite build includes FTS3/FTS4 but not those two extensions.
- A -wal from another copy. The log does not record which database file it belongs to. The page checks that the page sizes match and that the main file is in WAL mode, and warns when the names do not pair up. A log dropped next to a different copy of the database, or one checkpointed since, can still produce wrong tables. Rollback journals (
-journal) are not applied: they hold the old pages of an unfinished transaction, and SQLite uses them to undo it. - Other databases: SQLite 2 files and MySQL or Postgres dumps, which are SQL text rather than database files. Microsoft Access .mdb and .accdb files open in the Access viewer.
- Integers above 9,007,199,254,740,991 (253 − 1) are shown rounded, because sql.js hands numbers to JavaScript as doubles. IDs from Twitter-style snowflake generators hit this.
Size limit
Unlike the CSV and Parquet viewers, which read the file piece by piece, SQLite here needs the whole database in memory. The file is read into the tab, then copied into a WebAssembly heap that cannot grow past 2 GB. The page warns above 300 MB. Databases of a few hundred MB usually open on a desktop. On a phone, 100 to 200 MB can already fail. If yours is bigger, the sqlite3 command-line tool opens it without loading it all.