Skip to main content

Network & Web

VarInt Decoder

Decode one unsigned Protobuf VarInt from Hex bytes to exact decimal text. Inspect each continuation bit, payload, shifted contribution, and running total.

Tool workspace

Your input stays in this browser.

Add the required input to continue.

Needs input

Run the tool when your input is ready.

Paste one unsigned Protobuf VarInt as Hex bytes, such as 96 01. Do not include a field tag.

Your result appears here

Decode one unsigned Protobuf VarInt from Hex bytes to exact decimal text. Inspect each continuation bit, payload, shifted contribution, and running total.

This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.

Each byte contributes seven payload bits, with the lowest group first. Its high bit indicates whether another byte follows.

The result contains an exact unsigned decimal integer and a table of byte contributions.

  • Check an unsigned field value after locating its byte range in a Protobuf capture.

Sources: Protocol Buffers: base 128 varints

Decode 96 01 as an unsigned integer

Input: 96 01

Settings: Hex bytes; one unsigned VarInt; no field tag.

Result: 150

Remove the continuation bit: 0x16 + (0x01 × 128) = 150. The engine returns the decimal string.

Check continuation bits and the terminating byte

  1. Paste the integer’s Hex bytes.
  2. Remove any Protobuf field tag first.
  3. Run the decoder and apply the field schema’s interpretation separately.
  • Input must contain one shortest-form value without trailing bytes.
  • The decoder does not apply ZigZag or signed LEB128 interpretation.
  • A signed field can appear as a large unsigned result.