How to use the JSON to Protobuf Schema
Generate Protobuf schema from JSON:
Paste your JSON
Paste a JSON object representing the message structure. Arrays of objects are also accepted — the first element is used for field inference.
Set message name
Enter the Protobuf message name in PascalCase by convention (e.g. User, CreateOrderRequest). Nested objects automatically generate their own named message definitions.
Click Generate
Get a complete proto3 file with syntax declaration, package, and message definitions. Field names are converted to snake_case per proto3 conventions, with sequential field numbers starting at 1.
Review and refine
Copy into your .proto file and add service definitions, rpc methods, enums, and oneof fields as needed. Replace string timestamp fields with google.protobuf.Timestamp for production use.
When to use this tool
Use this when migrating from REST/JSON to gRPC or Protocol Buffers:
- →Starting a gRPC service and need .proto message definitions from existing JSON API shapes
- →Migrating a REST API to gRPC and need to define Protobuf messages from current JSON contracts
- →Documenting an API with Protobuf schema for cross-language service communication
- →Learning Protobuf and wanting to see how your existing JSON maps to proto3 syntax
- →Scaffolding .proto files for use with protoc code generation in Go, Java, Python, or C++