JSON to Proto Converter
Paste a JSON object and get a Protocol Buffers (proto3) schema with messages, nested types, and repeated fields inferred automatically.
Last updated: May 26, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON to Proto Converter?
Protocol Buffers (protobuf) is Google's language- and platform-neutral schema format for serializing structured data. A `.proto` file declares message types with typed, numbered fields, and the protobuf compiler generates serialization code for many languages. Hand-writing a schema from an existing JSON document is tedious — you have to map each field's name to snake_case, pick the right scalar type, and define nested messages for each sub-object.
This tool automates that initial pass. It parses your JSON, infers the proto type for each field (`bool`, `int32`, `int64`, `double`, `string`), generates a nested message for every nested object, and treats arrays as `repeated` fields. Field names are converted from `camelCase` or `PascalCase` to `snake_case` to follow Protobuf style, and reserved keywords are renamed to avoid syntax errors.
The result is a starting-point schema you can refine — adjust the integer widths, mark fields as optional, add enums, and assign sensible field numbers before finalizing it for production use.
How to Use JSON to Proto Converter
Paste a JSON object (not an array — Protobuf needs a root message).
Set the root message name (defaults to "Root").
The generated .proto schema appears instantly on the right.
Copy the schema or download it as a .proto file.
Review and refine the generated schema — assign proper field numbers, adjust types, and mark fields optional or required as needed.
Common Use Cases
- Bootstrapping a Protobuf schema from a JSON API response.
- Migrating a JSON-based service to a gRPC service.
- Generating an initial .proto file to discuss with a backend team.
- Reverse-engineering the structure of an unknown JSON payload.
- Producing schema documentation for a JSON data exchange.
Example Input and Output
A flat JSON object with mixed scalar types generates a proto3 message with snake_case fields.
{
"userId": 42,
"name": "Alice",
"active": true,
"score": 87.5
}syntax = "proto3";
message Root {
int32 user_id = 1;
string name = 2;
bool active = 3;
double score = 4;
}Privacy
All conversion happens in your browser. No JSON or schema is sent to a server.
Field numbers in production
In real Protobuf usage, field numbers are part of the wire format and must remain stable forever once a schema is in production. Treat the generated numbers as a starting point and assign deliberate numbers before deploying.
Reserved keywords
If a JSON key matches a Protobuf reserved word (message, enum, service, etc.), the field is renamed to `name_field` to avoid a syntax error.

