— Developer Tools

Free SQLite Viewer

Open a SQLite database file to see its tables, run SQL against it and save the results as CSV, without installing anything or uploading the file.

— Samples
Valid
Live

What is a SQLite Viewer?

SQLite stores a whole database in one file, which is why apps, phones and browsers use it everywhere. This viewer opens such a file and lets you look inside with SQL, the same way the sqlite3 command line would.

It runs the real SQLite engine, compiled to WebAssembly, inside your browser. You can list tables and views, run any statement and save the results as CSV, and read the file header for its page size, journal mode, version and application ID. Changes stay in memory and never touch your file.

Key Features

Real SQLite

Queries run in SQLite itself via sql.js, so functions, joins, views and PRAGMAs work as they do in the sqlite3 shell.

Schema at a Glance

Every table with its columns, types and row count, plus views, indexes and triggers.

Results as CSV

Query results show in a table and download as CSV, up to 10,000 rows.

File Header Details

Page size, page count, WAL or rollback journal, text encoding, user_version and the app that made the file.

Your File Stays Put

The database is opened in your browser’s memory. Nothing is uploaded and the original file isn’t changed.

Perfect for everyone

  • Developers inspecting app databases
  • Analysts given a .db file
  • Anyone curious about what an app stores

How to Use the SQLite Viewer

Open the file, then look around with the three modes. Nothing needs installing, and the file stays on your computer throughout.

1

Open the Database

Choose Open database and pick a .db, .sqlite, .sqlite3, .gpkg or .mbtiles file.

2

See What’s Inside

Schema lists tables, columns and row counts, so you know what to query.

3

Run SQL

Write a statement in the SQL box. Results update as you type, and errors name the problem.

4

Save the Results

Download the result as CSV, or switch to File info for the header details.

Worked Examples

Queries Against a Real File

Each row runs against shop.db, the sample database the Query a view button loads: customers, orders, an index and a view. The file name comes first, then the SQL after the dashes, and every answer is this tool’s output.

REF_001Querying a view

“shop.db --- SELECT name, orders, spent FROM order_totals ORDER BY spent DESC”

REF_002Grouping orders by status

“shop.db --- SELECT status, COUNT(*) AS orders, SUM(total_cents) / 100.0 AS total FROM orders GROUP BY status ORDER BY total DESC”

REF_003Schema of the shop database

“shop.db”

REF_004File header

“shop.db”

REF_005Header of a WAL-mode file

“shop-wal.db”

REF_006Foreign keys through a PRAGMA

“shop.db --- PRAGMA foreign_key_list(orders)”

REF_007A table that doesn’t exist

“shop.db --- SELECT * FROM shipments”

REF_008A misspelled column

“shop.db --- SELECT nme FROM customers”

REF_009A delete that stays in memory

“shop.db --- DELETE FROM orders WHERE status = 'refunded'; SELECT COUNT(*) AS remaining FROM orders”

REF_010A PNG opened as a database

“photo.png”

File Header

What the First 100 Bytes Say

Every SQLite file starts with a 100-byte header. These ten fields are the ones File info reads.

01 / MAGIC

Magic String

Bytes 0–15 are “SQLite format 3” and a zero byte, which is how any tool recognises the file.

“How many bytes is the magic string?”

02 / PAGE

Page Size

Bytes 16–17 hold the page size, a power of two from 512 to 65,536. The value 1 means 65,536.

“What does a stored 1 mean?”

03 / JOURNAL

Journal Mode

Bytes 18 and 19 are 1 for a rollback journal and 2 for write-ahead logging.

“Which value means WAL?”

04 / FILE

File Change Counter

Bytes 24–27 count changes in rollback mode, so other processes know to reread their cache.

“Does WAL mode update it?”

05 / PAGE

Page Count

Bytes 28–31 give the database size in pages, so pages times page size is the file size.

“How do you get the size in bytes?”

06 / FREELIST

Freelist

Bytes 36–39 count unused pages, space a VACUUM would give back.

“What reclaims free pages?”

07 / TEXT

Text Encoding

Bytes 56–59: 1 is UTF-8, 2 is UTF-16 little-endian and 3 is UTF-16 big-endian.

“What’s the usual encoding?”

08 / USERVERSION

user_version

Bytes 60–63, free for apps to use. Many store their schema version here for migrations.

“Which PRAGMA sets it?”

09 / APPLICATIONID

application_id

Bytes 68–71 identify the file’s format, such as GPKG for GeoPackage or MPBX for MBTiles.

“Which format uses GPKG?”

10 / SQLITE

SQLite Version

Bytes 96–99 record the version of SQLite that last wrote the file, as a number like 3045001.

“What version is 3045001?”

Queries Worth Knowing

A handful of statements answer most questions about an unfamiliar database. Paste any of these into the SQL box, replacing the table and column names with your own, and adjust from there.

List Every Table

SELECT name, type FROM sqlite_master ORDER BY type, name lists tables, views, indexes and triggers with the SQL that created each.

Look at a Few Rows

SELECT * FROM customers LIMIT 20 shows the first rows of a table without pulling the whole thing into memory.

Count Rows Per Group

SELECT status, COUNT(*) FROM orders GROUP BY status ORDER BY 2 DESC shows how values are spread across a column.

Find Duplicates

SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1 lists values that appear more than once.

Check Real Types

SELECT typeof(price), COUNT(*) FROM products GROUP BY 1 reveals text hiding in a numeric column.

Read JSON Columns

json_extract(data, '$.address.city') pulls one value out of a JSON text column, using SQLite’s built-in JSON functions.

Work With Dates

date(placed_at, 'start of month') and strftime('%Y-%W', placed_at) group text dates by month or week.

Join Two Tables

SELECT c.name, o.total_cents FROM orders o JOIN customers c ON c.id = o.customer_id matches rows across tables by key.

PRAGMAs That Explain a Database

PRAGMA statements ask SQLite about the file itself rather than its data. These run in Query mode and return their answer as rows you can copy or download.

Tip 01

PRAGMA table_info(name)

Lists a table’s columns with their declared type, NOT NULL flag, default value and primary key position.

Tip 02

PRAGMA foreign_key_list(name)

Shows which columns point at other tables and what happens on update or delete.

Tip 03

PRAGMA index_list(name)

Lists the indexes on a table and whether each one is unique, which explains why some queries are fast.

Tip 04

PRAGMA integrity_check

Walks the whole file and reports damage. A healthy database returns a single row saying ok.

Tip 05

PRAGMA user_version

Returns the number apps store for their own schema version, the same value File info reads from the header.

Tip 06

PRAGMA journal_mode

Reports how changes are journalled. In this viewer it always says memory, because the file is opened as an in-memory copy.

Tip 07

PRAGMA compile_options

Lists the options this build of SQLite was compiled with, such as the JSON and full-text search extensions.

Where SQLite Files Turn Up

SQLite is likely the most deployed database in the world, and its files sit in many places you might not expect, often under names that don’t end in .db.

Mobile Apps

iOS and Android apps keep their local data in SQLite files inside the app’s sandbox.

Browsers

Chrome and Firefox store history, cookies and bookmarks in SQLite files in the profile folder.

Desktop Apps

Apps from Lightroom catalogues to password managers and chat clients use SQLite.

Maps

GeoPackage and MBTiles files are SQLite databases with a defined set of tables.

Web Development

Django, Rails and Laravel use a SQLite file as the default development database.

Data Sharing

Datasets are often published as one .db file because anyone can query it with SQL.

SQLite File Pitfalls

Common reasons a database looks wrong or won’t open, and what to do about each before assuming the file is damaged.

Tip 01

Missing WAL File

In WAL mode, recent changes live in a separate -wal file. Open the database alone and the newest rows may be missing, so checkpoint first.

Tip 02

Copying a Live Database

Copying a file while an app writes to it can produce a damaged copy. Close the app or use the .backup command.

Tip 03

Encrypted Databases

SQLCipher and similar tools encrypt the whole file, header included, so it won’t open without the key.

Tip 04

Reserved Words as Names

A table called order or group must be written as "order" in SQL, or SQLite reports a syntax error.

Tip 05

Loose Column Types

SQLite lets any column hold any value, so a TEXT column may hold numbers. Check with typeof().

Tip 06

Large Files in the Browser

The whole file is loaded into memory. Very large databases are better opened with the sqlite3 shell.

When to Use the SQLite Viewer

Whenever you have a .db file and want answers from it quickly, without installing a database client or importing the data anywhere first.

Inspecting an App’s Data

See what an app on your computer or phone backup actually stores.

Answering a Quick Question

Count, filter or group the rows of a shared .db file without installing a database client.

Checking a Migration

Confirm a migration added the right tables and columns, and that user_version moved on.

Exporting to a Spreadsheet

Run a query and download the result as CSV for Excel or Google Sheets.

Identifying a Mystery File

Read the header to learn whether a .db file is a GeoPackage, MBTiles or plain SQLite.

Frequently Asked Questions