Skip to content
100% local

Elias delta encoding

Encode positive integers with the Elias delta universal code, and decode them back.

Input
Output

Elias delta encoding

Elias delta coding is a universal code for positive integers: every number becomes a self-delimiting run of bits, so a whole sequence of codes packs together with no separators and still reads back unambiguously. It is used in data compression and in algorithms that need compact, prefix-free integer codes. This tool encodes a list of numbers into an Elias delta bit stream, and decodes a bit stream back into numbers, entirely in your browser.

Pick Encode or decode. For encoding, type numbers separated by spaces, commas or line breaks — the input format lets you write them as decimal text, as hexadecimal, or switch to bytes, which treats the whole input as ordinary text and encodes its raw UTF-8 bytes, so any string, accented letters and emoji included, round-trips losslessly. The output format controls how the resulting bits are shown: raw 0s and 1s, packed hexadecimal, or a list of decimal byte values. Decoding reverses the same options: input format describes the bit stream you paste in, output format describes how the recovered numbers, or reconstructed text with bytes, are written.

Wrap long lines at a fixed width to keep results readable, and use keep padding to control whether text output is right-padded to a whole byte and whether trailing zero bits are tolerated when decoding. Malformed input — a number below 1, a stray character, an odd count of hex digits, a truncated code — is caught and explained with a specific message rather than a silent wrong answer.

Everything runs locally: your numbers and text never leave the browser. Copy the result, download it as a .txt file, or send the output back into the input to chain another round.

FAQ

What is Elias delta coding used for?
It is a universal code for positive integers used in data compression and in algorithms that store many small numbers compactly — each code is self-delimiting, so no separators are needed between them.
Why does the tool reject 0?
Elias delta coding only represents positive integers (1 or greater). To encode a byte value that can be 0, switch the input format to bytes, which shifts every byte by one internally.
What's the difference between the text, hex and bytes formats?
Text and hex both read or write a list of numbers (decimal or hexadecimal). Bytes treats the box as ordinary text on the number side, or as a packed list of byte values on the bit-stream side.
What does "Keep padding" do?
When encoding to text, it pads the bit output to a whole byte. When decoding, it tells the tool to ignore a trailing run of zero bits left after the last code instead of reporting an error.
Is my data uploaded anywhere?
No. Encoding and decoding run entirely in your browser — nothing you type is sent to a server.