SQLite Database Inspector
A SQLite database is a single file whose first 100 bytes are a header describing the whole database, and whose catalogue — every table, index, view and trigger — lives in a built-in table called sqlite_master on page 1. Pick a .db file here and read that header field by field, list the full schema with exact row counts, and get a 0–100 file-health score — all locally, with no query ever run against your data. The companion article SQLite database inspection: what is actually inside a .db file explains the format in plain words. For other local file inspectors, see the IPA Analyzer and the ASN.1 / DER Explorer.
Last updated:
What is inside this .db file — its tables, its shape, its health — before you open it?
Drop a file here or pick one. It is parsed in this tab only — nothing is uploaded, and no row data is ever shown.
Results
Database header (100 bytes)
Schema — sqlite_master
Pages and storage
Findings
How this inspector reads a SQLite file
The parser starts with the 100-byte header: the “SQLite format 3” magic, the page size, how many pages the database claims to have, the schema cookie and format, the text encoding and the application ID. It then walks the schema table rooted at page 1 — a table b-tree like any other — decoding each record (varints and serial types) to list every table, index, view and trigger with its CREATE SQL. Finally it walks each table’s own b-tree and counts leaf cells, which is the exact row count; the walk is capped, and a capped count is reported as “at least N”.
The health score starts at 100. A file shorter than its header claims (truncated) loses 40; a size mismatch loses 20; a UTF-16 text encoding loses 5; a freelist larger than half the file loses 10. Freelist pages are pages the database has emptied but not returned to the filesystem — a large freelist share means a VACUUM would shrink the file. Nothing here is a security judgement: the score describes the file’s structural health only.
What this inspector does not do
It does not run queries and does not display row data — only the schema, header fields and row counts. Your data rows stay private by design.
It does not repair, recover or VACUUM anything. A truncated or corrupt file gets an honest report, not a fix, and damaged pages are skipped rather than guessed at.
Row counts are exact up to a walk cap of 200,000 cells per table; beyond that the count is reported as “at least N”. Very large files (over about 200 MB) can be slow or memory-heavy in a browser tab — you are warned first.
SQLite file terms, in plain words
| Page | The fixed-size block the whole file is built from — 512 bytes to 64 KB, set when the database is created. Everything in a SQLite file lives on numbered pages. |
| B-tree | The tree of pages that stores a table or index. Interior pages point at child pages; leaf pages hold the actual records. Counting leaf cells counts rows. |
| sqlite_master | The built-in catalogue table rooted at page 1. One row per table, index, view and trigger, holding its name, root page and CREATE SQL. |
| Freelist | Pages that held data once and are now empty but still inside the file. They are reused before the file grows; a big freelist means the file on disk is larger than the data inside it. |
| VACUUM | A SQLite command that rebuilds the database into a fresh file, returning freelist pages to the filesystem and shrinking the file. |
| Schema cookie | A counter in the header that increments on every schema change. Readers compare it to detect that the schema changed under them. |
| Official reference | The format is documented by the SQLite project: sqlite.org/fileformat2.html. |
Frequently asked questions
Is my database file uploaded anywhere?
No. The file is read with the browser’s File API and parsed by JavaScript in this tab. Nothing is sent to a server, and the inspector never displays row data — only the header, the schema and row counts leave the parser, and they stay on this page.
How are the row counts computed if no query runs?
By walking each table’s b-tree and counting the cells on its leaf pages — the same structures SQLite itself maintains. One leaf cell is one row, so the count is exact. The walk is capped at 200,000 cells per table to keep a huge file from freezing the tab; a capped result is shown as “at least N” instead of a false exact figure.
What does the health score actually measure?
Structural health only: whether the file is as long as its header claims, whether the sizes agree, whether the text encoding is the usual UTF-8, and how much of the file is empty freelist space. It says nothing about whether the data inside is correct, safe or sensible — a perfectly healthy file can hold terrible data, and this tool would never know, because it never reads the rows.