Developer Tools

    SQLite DB Viewer: Open, Inspect, and Query SQLite Databases in Your Browser

    Written by Parimal Nakrani
    15 min read
    SQLite DB Viewer: Open, Inspect, and Query SQLite Databases in Your Browser

    Learn how to open, inspect, analyze, and query SQLite database files (.db, .sqlite, .sqlite3) directly in your browser with zero server uploads, 100% privacy, WebAssembly performance, and instant CSV/JSON exports.

    SQLite is arguably the most widely deployed database engine in the world. It runs on billions of smartphones powering iOS and Android applications, operates silently inside web browsers to store history and cookies, and provides persistent storage for desktop applications like VS Code, Slack, and Discord. Modern edge architectures—such as Cloudflare D1 and Turso—have also made SQLite a first-class citizen in serverless computing.

    Yet, despite its ubiquity, inspecting the contents of an SQLite database file remains frustratingly friction-heavy.

    Every developer, QA engineer, and data analyst knows the drill: you pull a .db, .sqlite, or .sqlite3 file from an emulator, download a production cache dump, or export an offline diagnostic database. Inspecting it typically forces an inconvenient choice:

    1. Install heavy desktop software like DB Browser for SQLite (sqlitebrowser) or DBeaver. On corporate machines, installing native software often requires IT approval tickets.
    2. Use terminal CLI tools like sqlite3 app.db, memorizing dot-commands (.mode table, .schema, .headers on) just to view tables that wrap messily in terminal windows.
    3. Use a generic online database viewer, which uploads your database to a third-party server—creating critical security, GDPR, and privacy hazards if the file contains API keys, customer emails, or authentication tokens.

    The Tooltri SQLite DB Viewer solves this problem cleanly.

    By combining browser file APIs with an in-memory SQLite engine compiled to WebAssembly (WASM) running in a dedicated Web Worker, Tooltri lets you open, explore, sort, filter, and export SQLite databases directly inside your browser. No installation, no plugins, and zero data sent across the network.


    The Internal Anatomy of an SQLite Database File

    To understand how client-side database inspection works, it helps to review how SQLite organizes data on disk. Unlike client-server databases like PostgreSQL or MySQL—which run persistent daemon processes across complex directory structures—SQLite is an in-process, serverless engine.

    The entire database—including table schemas, indexes, views, triggers, and row data—is serialized into a single binary file.

    DIAGRAM
    +-------------------------------------------------------------+ | SQLite File Layout | +-------------------------------------------------------------+ | 100-Byte File Header (Magic Bytes, Page Size, Flags) | +-------------------------------------------------------------+ | Page 1: Root Page (Contains sqlite_master / sqlite_schema) | +-------------------------------------------------------------+ | Page 2: Table B-Tree Internal Node | +-------------------------------------------------------------+ | Page 3: Table B-Tree Leaf Node (Actual Row Payloads) | +-------------------------------------------------------------+ | Page 4: Index B-Tree Node | +-------------------------------------------------------------+ | ... Additional B-Tree & Freelist Pages | +-------------------------------------------------------------+

    1. The 100-Byte File Header

    Every valid SQLite version 3 database begins with a strictly formatted 100-byte file header:

    • Bytes 0–15: The ASCII magic string "SQLite format 3\000" (terminated by a null byte). This header signature allows parsers to identify the file format instantly without relying on the file extension.
    • Bytes 16–17: The database page size in bytes. In modern SQLite databases, this is almost always 4,096 bytes (4 KB), though it can range from 512 bytes up to 65,536 bytes.
    • Bytes 24–27: The file change counter. This 32-bit integer increments every time a transaction commits changes.
    • Bytes 32–35: The page number of the first freelist trunk page, tracking unallocated pages released by deleted records.
    • Bytes 56–59: The database text encoding (1 for UTF-8, 2 for UTF-16le, 3 for UTF-16be).

    Because this 100-byte header defines how the rest of the file must be interpreted, corrupting even a single byte in this section will prevent parsers from opening the file.

    2. B-Tree Page Organization

    SQLite structures its storage around fixed-size pages organized as balanced trees (B-Trees):

    • Table B-Trees (B+Trees): Table records are stored in B+Trees. Interior pages act as navigation routers containing 32-bit pointers to child pages, while leaf pages store the actual row data (the payload). Because rows are keyed by their 64-bit row ID (ROWID), SQLite can locate any row in $O(\log N)$ time.
    • Index B-Trees: Indexes are stored in classic B-Trees where both interior and leaf pages contain key data, mapping indexed values back to the corresponding table row ID.
    • Freelist Pages: When records are deleted, SQLite marks the freed pages as reusable freelist pages rather than immediately shrinking the physical file on disk.

    3. The Schema Catalog (sqlite_master)

    SQLite enforces a relational schema tracked inside an internal catalog table named sqlite_master (aliased as sqlite_schema). Occupying page 1 of every database, it stores five core columns:

    SQL
    CREATE TABLE sqlite_master ( type TEXT, -- 'table', 'index', 'view', or 'trigger' name TEXT, -- Name of the database object tbl_name TEXT, -- Associated table name rootpage INTEGER, -- Root page number where the B-Tree starts sql TEXT -- The original DDL statement used to create it );

    When Tooltri opens your database, it queries sqlite_master to retrieve all table definitions, column types, and views directly from the source DDL.

    4. Dynamic Typing and Record Payloads

    SQLite uses dynamic typing with type affinity. A column declared as INTEGER can store text or floating-point values. Within each leaf page, column types are encoded using variable-length integers (varints):

    Serial Type CodeStorage ClassDescription
    0NULLValue is NULL (0 bytes of payload)
    18-bit IntegerValues from -128 to 127 (1 byte)
    216-bit IntegerValues from -32,768 to 32,767 (2 bytes)
    324-bit IntegerValues up to $\pm 8,388,607$ (3 bytes)
    432-bit IntegerValues up to $\pm 2,147,483,647$ (4 bytes)
    548-bit IntegerValues up to $\pm 140,737,488,355,327$ (6 bytes)
    664-bit IntegerStandard 8-byte signed integer
    7FloatIEEE 754-2008 floating-point real (8 bytes)
    8 / 9ConstantsRepresents numeric 0 and 1 (0 bytes of payload)
    $N \ge 12$ and EvenBLOBRaw binary data of length $(N-12)/2$
    $N \ge 13$ and OddTEXTUTF-8 encoded string of length $(N-13)/2$

    Why Traditional Online Database Viewers Are a Security Hazard

    Before client-side WebAssembly tools existed, web database viewers required uploading files to a remote backend server. The server stored the database in a temporary folder, queried it using Python or Node.js, and sent HTML or JSON snippets back to your browser.

    In professional environments, this pattern creates major security vulnerabilities:

    1. Exposing Confidential Data: Application databases frequently contain user profiles, password hashes, session cookies, OAuth tokens, financial transactions, and private customer communications. Uploading these to third-party web servers violates fundamental security practices.
    2. Regulatory Non-Compliance (GDPR, HIPAA, SOC 2): Transmitting personal data to an unvetted third-party server can violate GDPR data transfer restrictions, HIPAA privacy rules, and corporate SOC 2 policies.
    3. Data Retention Concerns: Even if a service claims to delete files after an hour, there is no guarantee that server backups, crash logs, or telemetry pipelines do not retain copies.

    The Tooltri Guarantee: 100% Client-Side Privacy

    Tooltri's SQLite DB Viewer is designed from the ground up for strict privacy:

    • Zero Network Requests: Your file never leaves your computer. Open your browser's Developer Tools (F12), check the Network tab, and load a file—you will see zero outbound upload requests.
    • In-Memory Sandboxing: The database is loaded into your browser tab's volatile memory via the HTML5 FileReader API.
    • Zero Persistence: Nothing is saved to remote servers or local browser storage. Closing the tab or clicking "Reset" immediately frees the allocated memory.
    • Offline Operation: Because all application assets and WebAssembly binaries are cached by your browser, you can disconnect from the internet and inspect databases completely offline.

    Under the Hood: WebAssembly & Web Worker Architecture

    How does a web browser execute a native C database engine at near-native speeds without a backend server? The answer lies in WebAssembly (WASM) and HTML5 Web Workers.

    DIAGRAM
    +-------------------------------------------------------------+ | Browser Tab | | | | +-------------------------------------------------------+ | | | Main Thread (React / UI) | | | | | | | | * Drag & Drop File Input | | | | * Schema Navigation Tree | | | | * Responsive Data Grid UI | | | | * Modals and Export Triggers | | | +---------------------------+---------------------------+ | | | postMessage({ query }) | | | onmessage({ results }) | | +---------------------------v---------------------------+ | | | Web Worker Thread (Off-Thread) | | | | | | | | * ArrayBuffer Virtual Disk | | | | * sql.js / SQLite C Engine compiled to WASM | | | | * B-Tree traversal and SQL query execution | | | | * In-Engine Pagination (LIMIT / OFFSET) | | | +-------------------------------------------------------+ | +-------------------------------------------------------------+

    1. Compiling SQLite C to WebAssembly

    Tooltri utilizes sql.js, an optimized build of SQLite compiled to WebAssembly via the Emscripten compiler toolchain:

    1. The official SQLite C source code (sqlite3.c) is compiled into a .wasm binary module.
    2. Emscripten provides a virtualized C runtime, mapping standard C memory allocations (malloc, free) to a contiguous WebAssembly memory buffer.
    3. When you select a database file, the browser reads it as an ArrayBuffer and passes it directly to the WebAssembly virtual machine.
    4. SQLite mounts this memory buffer as an in-memory virtual filesystem, executing standard SQL queries directly against the binary data.

    2. Off-Thread Execution with Web Workers

    Running database queries on the browser's main thread is risky. Querying large tables can block the thread, causing interface freezes, dropped frames, and "Page Unresponsive" warnings.

    Tooltri avoids this by executing all database logic inside a dedicated background Web Worker:

    • Smooth UI: The main UI thread remains completely free to handle mouse movements, scrolling, and animations at 60 fps.
    • Asynchronous Messaging: User actions (selecting a table, sorting a column, searching) send lightweight messages via postMessage(). The worker executes the query and returns formatted rows to the interface.
    • Graceful Handling: Heavy queries execute without freezing the page, providing a reliable and responsive user experience.

    Tooltri SQLite DB Viewer: Core Features

    Tooltri provides a streamlined, developer-centric interface for exploring SQLite databases:

    1. Universal File Support

    Drag and drop any .db, .sqlite, .sqlite3, or .sqlitedb file onto the dropzone, or use the file picker. The viewer verifies the SQLite magic header and mounts the database in milliseconds.

    2. Interactive Schema Explorer

    The left-hand navigation sidebar displays the database structure:

    • Tables & Views: Categorizes standard physical tables and virtual SQL views, complete with live row count badges.
    • Column Manifest: Expanding a table shows every column's name, declared type, NOT NULL constraint, and default values.
    • Primary & Foreign Keys: Highlights primary keys with a key icon and displays foreign key relations via PRAGMA foreign_key_list.
    • DDL SQL Viewer: Click the schema icon to view and copy the original CREATE TABLE statement stored in sqlite_master.
    SQL
    CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, email TEXT NOT NULL UNIQUE, full_name TEXT, role TEXT DEFAULT 'viewer', created_at DATETIME DEFAULT CURRENT_TIMESTAMP );

    3. High-Performance Serverless Data Grid

    Rendering thousands of rows at once can crash web browsers. Tooltri solves this with native SQL windowing:

    • SQL Pagination: Queries only the active page using LIMIT and OFFSET (e.g., 25, 50, 100, or 500 rows), ensuring low memory consumption.
    • In-Engine Sorting: Clicking column headers executes native ORDER BY sorting in SQLite's C engine rather than slow JavaScript array sorting.
    • Global Table Search: Filter records across all columns using parameterized LIKE expressions, with real-time recalculation of total matching rows.
    • Sticky Headers: Keep your column context visible while scrolling through wide tables.

    4. Specialized Data Type Inspectors

    • NULL vs. Empty String: Distinguish missing values (NULL badge) from explicit empty strings ("") with dedicated visual styling.
    • Binary BLOB Hex Inspector: Identifies binary data, displays byte size badges (BLOB (64 B)), and opens an interactive hexadecimal viewer modal on click.
    • Cell Content Inspector: Long text payloads (JSON strings, logs, UUIDs) truncate gracefully in the grid. Clicking any cell opens an inspector modal with the full unformatted string and a copy button.

    5. Instant Data Export

    • Copy Page as JSON: Exports visible records as a formatted JSON array.
    • Copy Page as CSV: Copies RFC 4180 compliant CSV text to your clipboard.
    • Export Full Table as CSV: Streams every row in the selected table from the WebAssembly database directly into a downloadable CSV file.
    • Copy Schema DDL: Grab the exact table creation SQL with a single click.

    Real-World Use Cases

    Where does an in-browser SQLite viewer fit into your everyday developer toolkit?

    • Mobile App Debugging: Pull local SQLite databases from an Android emulator (adb pull .../databases/app.db) or iOS Simulator container to inspect Room or CoreData state immediately.
    • Desktop & Web State: Examine local SQLite stores inside Electron applications (Slack, VS Code) or inspect Chromium user profile files (History, Cookies).
    • Edge & Serverless Backups: Download backup snapshots from Cloudflare D1 or Turso and inspect production replicas locally without running server processes.
    • AI & Local Vector Stores: Browse chunk metadata, document mappings, and configuration tables stored in SQLite by local AI tools like ChromaDB or sqlite-vec.
    • Forensic Audits & QA: Inspect diagnostic databases attached to bug reports without sending proprietary customer data to external cloud tools.

    Tooltri vs. Traditional SQLite Inspection Tools

    Feature / MetricTooltri SQLite DB ViewerDB Browser for SQLiteDBeaver / DataGripSQLite CLI (sqlite3)Cloud Upload Viewers
    Installation RequiredNone (Instant web access)Yes (Native installer)Yes (Heavy JVM)Yes (CLI binary)None (Web access)
    Data Privacy100% Client-Side100% Local100% Local100% LocalUploaded to server
    Cross-PlatformAny OS (Win, Mac, Linux, iPad, Android)Desktop onlyDesktop onlyDesktop / Server onlyAny OS
    Enterprise FriendlyYes (No admin rights needed)Requires IT installRequires IT installRequires terminal access❌ Often blocked
    Visual Schema ExplorerYes (Tree + DDL)YesYes (ER diagrams)No (Text .schema)Varies
    BLOB Hex ViewerYes (Modal)YesYesNoRare
    Export FormatsJSON & CSVCSV export wizardMulti-step wizardCustom .mode configVaries
    Offline SupportYes (Cached)YesYesYes❌ No

    While heavy IDEs like DBeaver and DataGrip excel at managing live database servers and executing complex multi-table migrations, they consume hundreds of megabytes of RAM and require configuration. When you simply need to inspect, search, and export an SQLite database file quickly, Tooltri offers the fastest and most convenient workflow.


    Technical Limits and Best Practices

    When working with client-side SQLite in the browser, keep these considerations in mind:

    • File Size Recommendations: Because the database is loaded into WebAssembly memory, the viewer performs best with files ranging from a few kilobytes up to 250 MB. For multi-gigabyte files, native 64-bit desktop CLI tools are better suited.
    • WAL Mode Checkpoints: If your database uses Write-Ahead Logging (journal_mode=WAL), recent transactions may reside in the -wal file. Ensure your application closed cleanly or checkpoint the database (PRAGMA wal_checkpoint(TRUNCATE);) before opening the .db file.
    • Encrypted Databases (SQLCipher): Tooltri supports standard SQLite 3 databases. Files encrypted using SQLCipher must be decrypted using the SQLCipher CLI before loading.

    Frequently Asked Questions

    Is it safe to open databases containing sensitive data?

    Yes. All processing occurs 100% in your browser using WebAssembly. No database content, schema definitions, or queries are ever sent to Tooltri servers. You can confirm this in the browser's Network tab or run the tool offline.

    What file extensions are supported?

    The viewer opens any valid SQLite 3 database file, including .db, .sqlite, .sqlite3, .sqlitedb, and extensionless SQLite files (such as Chrome's History file).

    Do I need to install SQLite or any browser extensions?

    No. Tooltri runs entirely within standard web browsers using WebAssembly. No installations or extensions are needed.

    Can I run custom SQL queries or edit records?

    Tooltri SQLite DB Viewer is designed as a fast, read-only inspection and export tool. It provides column sorting, search filtering, and exports without risking accidental edits or corruption to your original database.

    Why does a table column display BLOB?

    A BLOB (Binary Large Object) represents raw binary bytes (such as images, encryption keys, or protobufs). Tooltri displays the byte size and provides an interactive Hex Inspector modal to examine the raw hexadecimal data.

    How do I export an entire table to CSV?

    Select the table from the sidebar and click the Export CSV button in the top toolbar. The viewer streams all rows from the WebAssembly database directly to a downloadable CSV file.

    Does the tool work offline?

    Yes. Once loaded in your browser, the WebAssembly engine and interface are cached. You can disconnect your internet connection and continue inspecting files without interruption.


    Conclusion

    Developers no longer need to install bulky desktop software or run complex terminal commands just to inspect a local database.

    The Tooltri SQLite DB Viewer provides a modern, secure, and instant way to explore SQLite databases:

    • Zero installation and zero setup.
    • 100% client-side privacy with WebAssembly.
    • Intuitive schema browsing, column inspection, and DDL extraction.
    • High-performance data grid with sorting, search, and hex previews.
    • Fast exports to JSON and CSV.

    Try Tooltri SQLite DB Viewer the next time you need to open an SQLite database file.

    Parimal Nakrani
    Parimal NakraniSoftware Developer & Founder
    More about the author
    Share this article: