Database formats

SQLite record byte layout

Calculate header and body size from SQLite record serial types.

Your inputs

Start with an example

Your inputs stay in your browser.

Your result

Example result

How it works

Sum serial-type data widths. The header includes each serial-type varint and its own size varint, so solve its length until stable.

Types 1,13,12 use a 4-byte header and 1 data byte: 5 payload bytes.

Limits

Types 10 and 11 are reserved. Input codes are limited to 1,000,000,000. This excludes cell/rowid/page framing.