Database formats

SQLite varint encoder

Encode a decimal unsigned bit pattern as a 1–9-byte SQLite varint.

Your inputs

Start with an example

Your inputs stay in your browser.

Your result

Example result

How it works

The first eight bytes carry seven payload bits each. A ninth byte, when needed, carries eight bits. This is not LEB128 or ZigZag.

128 encodes as 81 00. The maximum unsigned 64-bit value uses nine FF bytes.

Limits

Accepts unsigned bit patterns through 2⁶⁴−1. Signed database fields may interpret the same bits differently.