ViewAnyFile Logo
ViewAnyFileClient-Side File Studio
← All Engineering Guides

Querying SQLite Databases in Browser RAM: How SQL.js & WebAssembly Parse .sqlite and .db Files

Learn how SQLite 3 database files (.sqlite, .sqlite3, .db) store B-Tree pages on disk and how to inspect schemas, browse tables, and run SQL queries in your browser with SQL.js WASM.

AM
By Ahsan Mehmood — Lead Systems Engineer, XechTech
Reviewed for binary specification accuracy & client-side WebAssembly security

Quick Answer: To open a .sqlite, .sqlite3, or .db database file without installing DB Browser for SQLite, DBeaver, or command-line tools, drop the file into the ViewAnyFile SQLite Database Viewer. Powered by SQLite3 compiled to WebAssembly (sql.js), our viewer mounts the entire relational database in browser RAM so you can inspect table schemas, browse rows, and export results to CSV or JSON with zero server uploads.

Why SQLite Is the Most Deployed Database Engine on Earth

Unlike client-server relational databases (such as PostgreSQL, MySQL, or Oracle) that run over TCP sockets and scatter data across hundreds of internal directory files, SQLite stores an entire transactional SQL database—complete with tables, indices, triggers, views, and foreign-key constraints—inside a single, cross-platform binary file on disk. Because of this self-contained design, SQLite is embedded inside virtually every modern software environment:

  • Mobile Application Storage: iOS CoreData, Android Room, WhatsApp message backups (msgstore.db), and Signal/Telegram local caches.
  • Desktop & Browser Profiles: Chrome/Firefox browsing history (History, cookies.sqlite), macOS Photos libraries, and Adobe Lightroom catalogs (.lrcat).
  • Data Science & Embedded Engineering: Portable datasets, IoT telemetry logs, and geospatial GeoPackage (.gpkg) containers.

Inside the SQLite 3 Binary File Architecture

Every valid SQLite 3 database file begins at byte offset 0x00 with a 100-byte database header starting with the exact 16-byte ASCII magic signature 53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 ("SQLite format 3\0"). Following the header, the file is divided into fixed-size B-Tree Pages (configured at bytes 16..17 as a power of two between 512 and 65,536 bytes, defaulting to 4,096 bytes):

Header Byte Offset Size Field Description Forensic & Engineering Significance
0x00 – 0x0F (0–15) 16 Bytes Magic Header String Must equal SQLite format 3\0 for standard unencrypted databases.
0x10 – 0x11 (16–17) 2 Bytes Database Page Size Big-endian uint16 (normally 0x1000 = 4096 bytes per B-Tree page).
0x12 – 0x13 (18–19) 2 Bytes File Format Write/Read Version 1 = Legacy Rollback Journal; 2 = Write-Ahead Logging (WAL mode).
0x1C – 0x1F (28–31) 4 Bytes Total Page Count Multiplied by Page Size to verify the expected byte length of the database file.
0x38 – 0x3B (56–59) 4 Bytes Database Text Encoding 1 = UTF-8, 2 = UTF-16le, 3 = UTF-16be.

Page 1 and the sqlite_schema Catalog

Page 1 of a SQLite file is always the root page of the master catalog table, known as sqlite_schema (or sqlite_master). This table stores the literal CREATE TABLE, CREATE INDEX, and CREATE VIEW SQL DDL statements alongside the root page number where each table's B-Tree begins. When you open a file in our SQLite Viewer, our Emscripten-compiled sql.js engine mounts your local Uint8Array as a virtual POSIX file in WebAssembly RAM, queries SELECT name, sql FROM sqlite_schema WHERE type='table', and populates an interactive table switcher and data grid instantaneously.

Troubleshooting: Missing Recent Rows in Write-Ahead Logging (WAL) Mode

If you copy a live database.sqlite file from a running Node.js, Python, or Android app and notice that the most recent transactions appear missing, check whether the source folder also contains database.sqlite-wal and database.sqlite-shm files. When SQLite operates in PRAGMA journal_mode=WAL;, newly committed pages are appended to the companion -wal file until a checkpoint merges them back into the main database file. Running PRAGMA wal_checkpoint(FULL); (or cleanly closing the application before copying the .sqlite file) ensures all transactions are flushed into the primary file.

Related Technical Guides