Protobuf to JSON
Convert Protocol Buffers schema to sample JSON, or decode Protobuf binary data to JSON. Supports proto3 syntax, nested messages, and enums. Browser-based, no data sent to server.
How to Use
Schema → Sample JSON (default mode)
- Paste your
.protoschema in the left panel. - The tool auto-detects all message types and populates the dropdown.
- Select a message type and click Generate JSON.
- A sample JSON with default field values appears on the right.
Binary → JSON mode
- Switch to the Binary → JSON mode using the toggle.
- Paste your
.protoschema in the top textarea. - Paste your encoded binary data (hex or base64) in the second textarea.
- Select the message type and click Decode Binary.
Proto3 Syntax Quick Reference
syntax = "proto3";
package myapp;
message User {
string id = 1;
string name = 2;
int32 age = 3;
repeated string roles = 4;
Address address = 5;
UserStatus status = 6;
}
message Address {
string street = 1;
string city = 2;
string country_code = 3;
}
enum UserStatus {
UNKNOWN = 0;
ACTIVE = 1;
INACTIVE = 2;
}
Field Types Reference
- Scalar types:
double,float,int32,int64,uint32,uint64,bool,string,bytes - Repeated fields: prefix any field with
repeated— maps to JSON arrays - Nested messages: use another message type as a field type
- Enums: define with
enum, first value must be 0 - oneof: only one field in a group can be set at a time
Privacy
All processing is client-side. Your schema and binary data are never uploaded or stored.
FAQ
What is Protocol Buffers (Protobuf)?
Protocol Buffers is Google's language-neutral, platform-neutral mechanism for serializing structured data — think of it as a faster, smaller alternative to JSON or XML. You define your data structure once in a .proto file, then use generated code to read and write that data.
Is my data sent to a server?
No. All parsing and decoding happens entirely in your browser using the protobufjs library. Your schema and binary data never leave your machine.
What is Schema → Sample JSON mode?
Paste a .proto schema, select a message type, and the tool generates a sample JSON object with default values — empty strings, zero numbers, and empty arrays. Useful for understanding the structure of a message without having real data.
What formats does Binary → JSON accept?
The tool accepts both hexadecimal (e.g. 0a 05 41 6c 69 63 65) and Base64-encoded Protobuf binary data. Whitespace and colons between hex pairs are ignored.
Which proto syntax is supported?
proto3 is the primary target. Basic proto2 syntax is also handled by the underlying protobufjs library, but proto3 is recommended.