Protobuf Decoder

Decode Protocol Buffers binary data without schema

Wire Types

0 - Varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum
1 - 64-bit: fixed64, sfixed64, double
2 - Length-delimited: string, bytes, embedded messages, packed repeated
5 - 32-bit: fixed32, sfixed32, float

Note

  • • Decodes without .proto schema file
  • • Field names are unknown (shows field numbers)
  • • Embedded messages shown as bytes
  • • Use protoc --decode_raw for verification

Protocol Buffers Guide

What is Protocol Buffers?

Protocol Buffers (protobuf) is Google's language-neutral, platform-neutral extensible mechanism for serializing structured data. It's smaller, faster, and simpler than XML or JSON, commonly used with gRPC.

Wire Format

Protobuf uses a compact binary format. Each field is encoded as a tag (field number + wire type) followed by the value.

Tag = (field_number << 3) | wire_type

Example: Field 1, string type = (1 << 3) | 2 = 0x0A

Encoding Examples

Varint (int32, int64, bool)

150 → 96 01 (0x9601)

Each byte uses 7 bits for data, MSB indicates continuation

String

"Hello" → 0A 05 48 65 6C 6C 6F

Tag (0A) + Length (05) + UTF-8 bytes

Signed Integer (ZigZag)

-1 → 01, -2 → 03, 1 → 02, 2 → 04

ZigZag encoding: (n << 1) ^ (n >> 31)

Getting Protobuf Data

# Capture gRPC traffic with grpcurl

grpcurl -plaintext -d '{"id": 1}' localhost:50051 myservice.MyMethod

# Encode with protoc

echo 'name: "test"' | protoc --encode=MyMessage message.proto | xxd -p

# Decode with protoc

cat data.bin | protoc --decode_raw

Related Tools

Developer Tools

Explore 80+ free online tools for developers. Base64, JSON, JWT, Regex, and more essentials in one place.

Quick Links

Developer Tools © 2025. All rights reserved.

Most tools run in the browser; tools that require network access only send data when you run them.

Protocol Buffers Decoder - Protobuf Viewer | Developer Tools