VarInt Decoder

Decodes a VarInt encoded integer. VarInt is an efficient way of encoding variable length integers and is commonly used with Protobuf.

Input: Text (UTF-8) or original file bytesResult: Text

Text input

Run to see the result

Examples

Turn the official three-byte Protobuf message into a named field — step 2

Show how 08 is a field tag and 96 01 represents 150; the schema supplies the field name.

Input

d01dda243abf602c-varint-150.bin

2 bytes

Download

Expected answer

150
A small field value

Input

4bf5122f344554c53bde2ebb.bin

1 bytes

Download

Expected answer

1
A 7-bit boundary

Input

620bfdaa346b088fb49998d9.bin

1 bytes

Download

Expected answer

127
The first two-byte value

Input

4f2e968b543c835e6648ddcc.bin

2 bytes

Download

Expected answer

128
The official Protobuf example

Input

d01dda243abf602c30136112.bin

2 bytes

Download

Expected answer

150
A counter of 300

Input

6ab5d0d823d6c395820281f3.bin

2 bytes

Download

Expected answer

300
A three-byte boundary

Input

893f4b7cac0109bc10726e83.bin

3 bytes

Download

Expected answer

16384

Format reference: VarInt Decode background and specification

Related tools

Browse networking tools