LEB128 encoder
Encode integers to variable-length LEB128 bytes and decode them back, signed or unsigned.
LEB128 encoder
LEB128 ("Little Endian Base 128") is the variable-length integer format behind DWARF debug info, WebAssembly modules and Protocol Buffers. Small values take one byte; larger ones spill into more, seven bits at a time, with the top bit of each byte marking "more bytes follow." This tool encodes a list of integers into a LEB128 byte stream, or decodes a stream back into the integers behind it — paste one integer per line to encode, or a run of bytes to decode.
Turn on Signed (SLEB128) for negative numbers, via the sign-extended variant; leave it off for unsigned (ULEB128), which rejects negative input instead of guessing. Output byte format sets how encoded bytes are written — hex digits, decimal values, or raw characters, one per byte — and Input byte format tells the decoder which shape to expect. Keep zero padding pads every byte to a fixed width for a tidy result; turn it off for the shortest text. Wrap output breaks a long line into fixed-width rows for readability, without touching the underlying bytes.
Integers on separate lines are encoded back-to-back into one continuous stream with no separators, exactly as LEB128 is used in real binary formats — the continuation bit alone marks each value's boundary. Decoding reverses that, printing one integer per output line. A stream ending mid-value, a value running past ten bytes, a non-numeric line, a negative number in unsigned mode, or a character your chosen format can't hold each stop with a specific error rather than a silently wrong answer.
Everything runs locally in your browser — no integer or byte ever leaves your device. Copy the result, download it as a .txt file, or send the output back into the input to chain an encode into a decode, or the reverse.