ZERO-UPLOAD SANDBOX
.duckdb Tier 2 · Annotated Hex

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!

MIME Types application/vnd.duckdb, application/octet-stream
Byte Endianness little
0xFF

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

Binary Signature & Wire Layout

.duckdb Magic Bytes & Header Offset Map

Offset: 0x08 (8 B) ASCII: DUCK
44 55 43 4B

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)
Upload Gateway & AppSec Advisory

.duckdb Security & Polyglot Risk Matrix

Risk Level: medium
Arbitrary Code / Macros
NO (Inert Data)
Pickle Deserialization
SAFE (No Pickle VM)
XML External Entity (XXE)
NONE
Polyglot Prepend Risk
LOW (Strict 0x00 Magic)
Backend Upload Validation Recommendation

Open untrusted .duckdb files with enable_external_access=false and lock_configuration=true so embedded views cannot invoke read_parquet('http://...') SSRF.

Compiler-Verified Reference Code

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}")
CI/CD & Unit Test Fixtures

Deterministic .duckdb Sample Files & Edge Cases

Open Full .duckdb Sample Matrix & Mutator →
minimalexpect: valid

minimal-v64.duckdb

Real single-table DuckDB database produced by duckdb.connect() — includes valid checksum preamble and DUCK magic.

↓ Download (524.0 KB)
SHA-256: 465f054e7e501c946c263070389322a8f1f96195ab9bb115a1e80d34401298f5
Exact: 536,576 bytes
curl -fsSL https://fileformat.co/fixtures/v1/duckdb/minimal-v64.duckdb -o minimal-v64.duckdb \
  && echo "465f054e7e501c946c263070389322a8f1f96195ab9bb115a1e80d34401298f5  minimal-v64.duckdb" | shasum -a 256 -c
realisticexpect: valid

analytics-store.duckdb

Real DuckDB database with two tables, primary keys, and a secondary index.

↓ Download (1.51 MB)
SHA-256: 92b98fd5e4954d171d464a36c6cfe175d15e12d09f8492382ed11458fdeb8278
Exact: 1,585,152 bytes
curl -fsSL https://fileformat.co/fixtures/v1/duckdb/analytics-store.duckdb -o analytics-store.duckdb \
  && echo "92b98fd5e4954d171d464a36c6cfe175d15e12d09f8492382ed11458fdeb8278  analytics-store.duckdb" | shasum -a 256 -c
edge-caseUnaligned 20B Truncationexpect: parser_error

truncated-header.duckdb

First 20 bytes of a real DuckDB file — duckdb.connect() must raise 'not a valid DuckDB database file'.

↓ Download (20 B)
SHA-256: b9fb1ef9dc5827bddb7c61b93433aea5cdbcb75d63941f72704906f6ddeb45b8
Exact: 20 bytes
curl -fsSL https://fileformat.co/fixtures/v1/duckdb/truncated-header.duckdb -o truncated-header.duckdb \
  && echo "b9fb1ef9dc5827bddb7c61b93433aea5cdbcb75d63941f72704906f6ddeb45b8  truncated-header.duckdb" | shasum -a 256 -c

Related Specifications & Alternatives