Skip to content
uencoder

Protobuf Wire Format

The Protobuf wire format is the binary encoding scheme of Protocol Buffers: fields are serialized compactly as a (field_number, wire_type) tag plus a variable-length value.

Purpose

It provides efficient, backward-compatible structured data serialization inside Google and in gRPC.

Mechanism

Each field is encoded as a Varint tag (field_number<<3 | wire_type) followed by the value. The wire type determines the value encoding: 0 = Varint, 1 = 64-bit, 2 = length-delimited, 5 = 32-bit. Unknown fields are preserved to support schema evolution.

Use cases

  • gRPC transport encoding
  • Structured data storage
  • Mobile communication

Related tools

References