Protobuf ↔ JSON Converter

Decode a hex/base64 protobuf message against a .proto schema, or preview the wire bytes for a JSON payload.

Open tool

Overview

Decode a hex or base64 protobuf message against a .proto schema to see the parsed JSON, or supply JSON plus a schema to preview the wire bytes that would result. Useful for inspecting captured RPC payloads, debugging unexpected field numbers, or hand-crafting a test message.

It's for developers working with gRPC, protocol buffers in microservice pipelines, or any system where binary protobuf encoding matters. Reach for it when correlating a protobuf hex dump with a service's .proto, when figuring out why a field isn't being deserialised, or when exploring the wire format itself.

How it works

Protocol Buffers (Google's binary message format, currently at proto3) uses tag-length-value encoding: each field is prefixed by a varint tag combining the field number and wire type, followed by the value (varint, length-delimited bytes, fixed32/64). The converter parses the .proto definition, walks the binary input, and produces JSON using the standard proto3 JSON mapping (camelCase field names, base64 for bytes fields, decimal for numbers).

The reverse direction is symmetric: given JSON conforming to the schema, the converter serialises it back to binary and shows the hex/base64. Wire bytes can be inspected byte-by-byte for debugging.

Examples

  • A simple schema:
    syntax = "proto3";
    message User {
      int32 id = 1;
      string name = 2;
    }
    
  • Binary to JSON:
    Hex:  08 01 12 04 4a 6f 68 6e
    JSON: {"id": 1, "name": "John"}
    
  • JSON to binary:
    JSON: {"id": 42}
    Hex:  08 2a
    
  • Wire-format breakdown:
    08 = tag (field 1, wire type 0 / varint)
    01 = value 1
    

FAQ

Does it support proto2?

The converter targets proto3 by default. Proto2's required/optional qualifiers and default values are slightly different - paste a proto2 schema and most parsers tolerate it, but JSON output may differ from a strict proto2 mapping.

What about Any and oneof?

oneof fields appear as the active variant in JSON. Any requires a registered type URL; the converter shows the raw type_url and value if it can't resolve.

Why does my decoded message show unknown fields?

The binary contains a field number not declared in your schema - either the schema is out of date or the encoder used a different version. Unknown fields are preserved in the output for inspection.

Can it handle gRPC framing?

gRPC adds a 5-byte length-prefixed frame around each message. Strip the framing before decoding, or supply unframed protobuf bytes.

Try Protobuf ↔ JSON Converter

An unhandled error has occurred. Reload ×