Protobuf Decoder & Wire Inspector
Decode binary Protocol Buffer (.pb) files, Base64, or Hex into JSON, human-readable .pbtxt, or reverse-engineer a valid .proto schema. Color-coded byte wire inspector included.
| Offset | Type | Hex | Decoded Content |
|---|
Understanding Protobuf Binary Wire Format
Protocol Buffers serialize structured data into compact binary streams. Unlike JSON or XML, field names and whitespace are completely stripped during compilation and replaced by numerical field tags and 3-bit wire types.
🔍 Raw Wire Decoding
Even without the original .proto schema file, the wire format exposes field IDs, varints, strings, and submessages. This allows decoding gRPC payloads or binary dumps directly.
⚡ Reverse Engineering
The Inferred .proto generator inspects wire types and automatically generates an accurate Protobuf schema ready to compile in Go, Rust, or Python.
🔒 Total In-Browser Security
Private gRPC microservice traffic and confidential database BLOBs are decoded exclusively in browser memory. No data touches the wire.
Wire Type Reference Table
Every message field starts with a key encoded as (field_number << 3) | wire_type. The wire format recognizes the following physical types:
| Wire Type | Type Name | Supported Data Types | Wire Layout |
|---|---|---|---|
0 | Varint | int32, int64, uint32, uint64, sint32, sint64, bool, enum | 1 to 10 bytes using LEB128 bit-packing |
1 | Fixed64 | fixed64, sfixed64, double | Exact 8 bytes (64 bits, little-endian) |
2 | Length-Delimited | string, bytes, embedded message, packed repeated | Varint length prefix followed by \(N\) data bytes |
3 / 4 | Groups | Start group / End group | Deprecated in Proto2, forbidden in Proto3 |
5 | Fixed32 | fixed32, sfixed32, float | Exact 4 bytes (32 bits, little-endian) |
How LEB128 Varints Work
Little-Endian Base 128 allows integers to take variable width. The most significant bit (MSB, 0x80) indicates whether further bytes follow:
Byte 1: [1][0101100] (MSB = 1: more bytes follow, value = 44)
Byte 2: [0][0000001] (MSB = 0: terminating byte, value = 1)
Calculation: 44 + (1 << 7) = 44 + 128 = 172
For negative numbers, sint32 and sint64 use ZigZag encoding (n << 1) ^ (n >> 31) to map negative values to small positive integers, preventing standard two's complement 64-bit negative numbers from always consuming 10 bytes.
Schema-less Heuristic Submessage Detection
When our engine encounters a Length-Delimited field (Wire Type 2), it tests the payload with two competing heuristics:
- UTF-8 String Test: If all bytes decode into valid printable UTF-8 characters without control sequences, it is formatted as a string.
- Recursive Submessage Test: If the bytes cleanly unpack into valid tag/wire-type pairs where child field numbers are positive integers under 536,870,911 and sub-lengths match exactly with no leftover bytes, it is rendered as an embedded JSON object.
Frequently Asked Questions
Can you decode Protocol Buffers without the original .proto schema file?
What are the limitations of decoding Protobuf without a schema?
What is LEB128 Varint encoding in Protocol Buffers?
What wire types does Protobuf support?
Can I edit the decoded data and re-encode it back into a .pb binary file?
About This Tool
Paste Base64 or Hex, or drop a raw .pb file, and this decoder walks the Protobuf wire format
directly, reading tag/wire-type headers and LEB128 varints without needing the original .proto
file. It outputs JSON, an inferred .proto schema, and TextProto, plus a byte-level wire
inspector; an optional .proto schema drawer maps field numbers back to real names when you have one.
Since field names don't exist on the wire, type guesses (string vs. bytes vs. submessage) are heuristic, not guaranteed. If you only need to encode or decode a Base64 string with no Protobuf structure involved, use Base64 Converter instead.
Key Features
- Schema-less decoding: infers field structure from the wire format alone, no
.protorequired. - Four output views: JSON, Inferred .proto, TextProto (.pbtxt), and a color-coded Wire Inspector table.
- Optional .proto schema drawer: paste a schema to resolve field numbers to real field names.
- File or text input: drag-and-drop a raw
.pbbinary, or paste Base64/Hex directly. - 2-way re-encoder: edit the decoded JSON and export it back to Base64, Hex, or a binary
.pbdownload.