DuckDB Analytical Database File
Single-file vectorized OLAP database format storing compressed columnar row-groups in 4 KB / 256 KB block-managed pages.
Unlike SQLite, DuckDB places an 8-byte checksum preamble at `0x00..0x07` and writes its 4-byte ASCII magic `'DUCK'` (`44 55 43 4B`) at offset **`0x08`**, followed by `uint64_le` storage version!
Drop any .duckdb file (even 100 GB+) to inspect locally
Reads tiny File.slice() header/footer pages in a sandboxed Web Worker · 0 Bytes Uploaded
.duckdb Magic Bytes & Header Offset Map
4-byte 'DUCK' magic at offset 0x08 after 8-byte checksum
| Byte Offset | Length | Data Type | Field Name | Engineering Description |
|---|---|---|---|---|
| 0x00 - 0x07 | 8 B | uint64_le | checksum | 64-bit block checksum of main header |
| 0x08 - 0x0B | 4 B | char[4] | magic | ASCII 'DUCK' identifier |
| 0x0C - 0x13 | 8 B | uint64_le | version | DuckDB storage layout version (e.g. 64) |
.duckdb Security & Polyglot Risk Matrix
Open untrusted .duckdb files with enable_external_access=false and lock_configuration=true so embedded views cannot invoke read_parquet('http://...') SSRF.
Read .duckdb Header & Metadata Without Heavy Dependencies
import struct, sys
with open(sys.argv[1], "rb") as f:
csum, magic, ver = struct.unpack("<Q4sQ", f.read(20))
assert magic == b"DUCK"
print(f"DuckDB storage version={ver}")Deterministic .duckdb Sample Files & Edge Cases
minimal-v64.duckdb
Real single-table DuckDB database produced by duckdb.connect() — includes valid checksum preamble and DUCK magic.
curl -fsSL https://fileformat.co/fixtures/v1/duckdb/minimal-v64.duckdb -o minimal-v64.duckdb \
&& echo "465f054e7e501c946c263070389322a8f1f96195ab9bb115a1e80d34401298f5 minimal-v64.duckdb" | shasum -a 256 -canalytics-store.duckdb
Real DuckDB database with two tables, primary keys, and a secondary index.
curl -fsSL https://fileformat.co/fixtures/v1/duckdb/analytics-store.duckdb -o analytics-store.duckdb \
&& echo "92b98fd5e4954d171d464a36c6cfe175d15e12d09f8492382ed11458fdeb8278 analytics-store.duckdb" | shasum -a 256 -ctruncated-header.duckdb
First 20 bytes of a real DuckDB file — duckdb.connect() must raise 'not a valid DuckDB database file'.
curl -fsSL https://fileformat.co/fixtures/v1/duckdb/truncated-header.duckdb -o truncated-header.duckdb \
&& echo "b9fb1ef9dc5827bddb7c61b93433aea5cdbcb75d63941f72704906f6ddeb45b8 truncated-header.duckdb" | shasum -a 256 -cRelated Specifications & Alternatives
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`).
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.
Zero-copy in-memory columnar format serialized to disk with 8-byte aligned `ARROW1\x00\x00` framing and FlatBuffers schema/record-batch descriptors.