JSON to Protobuf
Convert JSON to Protobuf and download the result. Your input stays in your browser.
For the reverse conversion, use Protobuf to JSON.
- Use it when
- Encode a ProtoJSON object as a binary Protocol Buffers message.
- Keep in mind
- Provide the matching .proto definition and message type. ProtoJSON writes 64-bit integers as strings.
JSON input
{
"contacts": [
{"id": 42, "name": "Avery"},
{"id": 51, "name": "Ellis"}
]
}Protobuf output
Example binary Protobuf Contacts message. Input limit: 5 MiB
Input limit: 5 MiB
Protobuf file
Your file will be available to download after conversion.
Your input stays in this browser. We don’t upload it. How we handle your data .
How to convert JSON to Protobuf
Paste JSON or open a local file. Provide the schema shown in the workspace. Select Convert to Protobuf, then download the result.
Frequently asked questions
How can I convert a list of records to one Protobuf message?
Use a message type with a repeated field and put the JSON array under that field’s name. The sample wraps its array in the contacts field of the Contacts message.
How should I enter a 64-bit ID?
Use a quoted decimal value for an int64 or uint64 field, especially if the number is too large for JavaScript to carry exactly. The output stores the integer in the binary message.