Protocol bytes, explained

Protobuf decoder

Paste a raw message, then add a self-contained .proto only when you need declared names and types.

Protobuf decoder

Input

Optional .proto schema

Result

Bytes and schema are processed in this browser, without upload.

Options

Enter a wire message or varint.

A Protobuf decoder is useful when a log contains bytes but no readable field names. The wire stream still tells you where every field starts, how it is encoded, and exactly which bytes belong to it.

A protobuf wire decoder cannot infer whether a length-delimited value was a string, nested message or packed data. Compare tentative readings against the raw hex, or supply a schema before treating any value as typed.

Why use this Protobuf decoder?

Keep the evidence beside each interpretation.

Trace a field back to the payload

This Protobuf decoder shows field number, wire type, half-open byte offsets and the original hex together. A malformed length points to its first impossible byte instead of leaving you with an unexplained empty result.

A sequence of bytes branches into numbered fields, each connected to its own byte span.

Add meaning without losing the wire view

Paste a single .proto and choose a message to get typed JSON. The named result sits beside the same raw fields, so you can check where a declared string or integer came from.

A wire field tree remains visible beside a matching schema-shaped value tree.

Three checks before trusting a decoded value

01

Choose the byte format explicitly

Hex is the default and accepts spaces, colons and 0x prefixes. Switch to Base64 if that is what your capture contains; short strings can be valid in more than one encoding.

02

Treat raw readings as candidates

Wire type 0 carries unsigned bits that might represent signed integers, ZigZag values, booleans or enums. Wire type 2 can hold text, bytes, packed numbers or another message. Only a schema settles the intended type.

03

Check freshness and offsets

Automatic decoding waits 350 ms after an edit. Turn it off for Ctrl/Cmd + Enter. Any input or option change disables export until the new run finishes; offsets start at zero and the end excludes the next byte.

What the bytes reveal

Four common wire types

The Protobuf decoder reads varint, fixed64, length-delimited and fixed32 records. It rejects truncated keys, impossible lengths and deprecated group tags instead of silently skipping unknown spans.

A precise varint workbench

Use the protobuf varint decoder to read up to ten bytes as exact uint64 and optional sint64 ZigZag. Reverse direction to encode a decimal value; BigInt avoids JavaScript Number precision loss.

Schema-backed JSON

A self-contained .proto can name fields and decode repeated or nested values with protobuf.js. Select the root message when the file defines several; the raw wire tree remains visible if schema interpretation fails.

Hex that matches the input

The protobuf hex decoder exports normalized uppercase hex of the original payload. It never re-encodes a guessed message, so byte comparisons against the capture remain meaningful.

Where the wire format stops

Field names require a schema
A Protobuf decoder without schema can recover field numbers and wire types, not original names, enum labels or oneof intent. Guessed names would turn an ambiguity into a false fact.
Length-delimited remains ambiguous
Readable UTF-8 and a valid nested parse are both candidates, not proofs. Compare raw bytes with the source .proto before using either in application logic.
One local schema file
Imports, remote URLs and dependency fetching are outside this tool. Paste a self-contained proto2 or proto3 definition; syntax failures are reported with their line where available.
A payload, not a transport frame
The input is one raw wire message. The tool does not strip gRPC framing, decompress data or encode a complete JSON object back into Protobuf. Groups 3 and 4 are rejected explicitly.

Protobuf decoder questions

Can I decode protobuf without a .proto file?

Yes, for wire structure. You can see field numbers, wire types, offsets and raw values. Declared names and exact types require a matching .proto.

How do I decode a protobuf hex dump?

Choose Hex, paste pairs of digits, and inspect the numbered fields. An odd digit or truncated field produces an error rather than a partial success.

Why do I see multiple interpretations for one field?

The wire format stores only a small type code. The same bytes may legitimately be an unsigned integer, ZigZag integer, string, bytes or embedded message.

How do I use protoc to decode protobuf files?

protoc --decode_raw can inspect unknown wire data; protoc --decode needs a compiled message type. This browser tool offers a similar raw view and optional local schema.

How do I extract a varint from a serialized protobuf file?

A varint starts after a wire-0 field tag and ends at the first byte whose top bit is clear. The standalone Varint mode accepts that byte sequence directly.

Found a definition that should be supported?

Inspect the next Protobuf payload

Return to the Protobuf decoder when a captured message needs a byte-for-byte explanation. Keep the original hex and the declared schema together for the final review.