Explore modules

Elias Universal Integer Codes

Decode self-delimiting integer lengths and distinguish incomplete headers from valid messages.

Free theory article

Decode self-delimiting integer lengths and distinguish incomplete headers from valid messages.

Concept & interpretation

Elias universal codes (such as Gamma and Delta codes) are used to encode positive integers so that the resulting codewords are prefix-free. This self-delimiting property allows a receiver to decode a sequence of numbers without needing to know beforehand how many bits represent each number.

Interactive Experiment

You can test different integer values and encoding types using the Elias Universal Integer Codes module.

  1. Select the Code as "Delta".
  2. Set the Integer to 16. Observe the generated "Full codeword" 001010000 and how the bit trace separates the unary length from the binary size and payload.
  3. Change the Truncate setting to "Drop final bit".
  4. Observe that the status changes to "Truncated code" and the "Decoded integer" becomes "Unavailable", demonstrating that prefix codes rely on the complete sequence to be decodable.
Read the full free theory article