SQLite 3 Database File
Ubiquitous single-file ACID relational B-tree database with a big-endian 100-byte header at offset 0x00 and full SQL DDL catalog stored in Root Page 1 (`sqlite_schema`).
Header fields are big-endian! `page_size` at 0x10 equals 65536 when stored as 0x0001. Root B-tree leaf table cells on Page 1 contain raw `CREATE TABLE` / `CREATE INDEX` statements.
Drop any .sqlite file (even 100 GB+) to inspect locally
Reads tiny File.slice() header/footer pages in a sandboxed Web Worker · 0 Bytes Uploaded
.sqlite Magic Bytes & Header Offset Map
16-byte null-terminated SQLite 3 header string
| Byte Offset | Length | Data Type | Field Name | Engineering Description |
|---|---|---|---|---|
| 0x00 - 0x0F | 16 B | char[16] | header_string | 'SQLite format 3\0' |
| 0x10 - 0x11 | 2 B | uint16_be | page_size | Database page size in bytes (1 means 65536) |
| 0x12 - 0x13 | 2 B | uint8[2] | journal_versions | 1=Rollback journal, 2=WAL mode |
| 0x1C - 0x1F | 4 B | uint32_be | page_count | Total pages in database file |
| 0x38 - 0x3B | 4 B | uint32_be | text_encoding | 1=UTF-8, 2=UTF-16le, 3=UTF-16be |
.sqlite Security & Polyglot Risk Matrix
Disable load_extension() and defensive=ON when opening untrusted SQLite files; corrupted shadow tables (FTS3/RTREE) have historically triggered memory corruption in older libsqlite3 builds.
Read .sqlite Header & Metadata Without Heavy Dependencies
import struct, sys
with open(sys.argv[1], "rb") as f:
hdr = f.read(100)
assert hdr[:16] == b"SQLite format 3\x00"
psize = struct.unpack(">H", hdr[16:18])[0] or 65536
pages, enc = struct.unpack(">I", hdr[28:32])[0], struct.unpack(">I", hdr[56:60])[0]
print(f"SQLite3 page_size={psize}B, pages={pages}, encoding={enc}")Deterministic .sqlite Sample Files & Edge Cases
minimal-users.sqlite
Valid 4096-byte single-page SQLite 3 database with a `users` table and two UTF-8 rows.
curl -fsSL https://fileformat.co/fixtures/v1/sqlite/minimal-users.sqlite -o minimal-users.sqlite \
&& echo "dee45e02f67ee69f23295ad0de07601253ad41c8da4dfb9cb173e5ebb3b71e50 minimal-users.sqlite" | shasum -a 256 -capp-telemetry-schema.sqlite
SQLite 3 database whose sqlite_schema B-tree spans interior (0x05) pages across 42 tables plus a ~6KB CHECK-constraint DDL stored on an overflow-page chain.
curl -fsSL https://fileformat.co/fixtures/v1/sqlite/app-telemetry-schema.sqlite -o app-telemetry-schema.sqlite \
&& echo "0ea395a85610cdf41278eff1b123008b580dfd0d5732e96eb419eab56e8e4bc1 app-telemetry-schema.sqlite" | shasum -a 256 -ctruncated-half-page.sqlite
Valid 100-byte SQLite header whose first B-tree page is truncated mid-page.
curl -fsSL https://fileformat.co/fixtures/v1/sqlite/truncated-half-page.sqlite -o truncated-half-page.sqlite \
&& echo "3f7627faa065ed6cd65c4fcccd2cbb8493f9d7330fadd9a68b4ca6fccb0e041c truncated-half-page.sqlite" | shasum -a 256 -cRelated Specifications & Alternatives
Single-file vectorized OLAP database format storing compressed columnar row-groups in 4 KB / 256 KB block-managed pages.
De-facto standard hybrid columnar storage format for modern data lakes (Iceberg, Delta, DuckDB, Spark), placing Thrift Compact Protocol schema and statistics in the file trailer.
Row-oriented binary data serialization container widely used in Kafka/Confluent event streaming and Iceberg manifest lists, embedding full JSON writer schema in the file header.