JSON to Protocol Buffers Converter
Automatically derive a proto3 (or proto2) message definition from any JSON object, with field types inferred from your actual values including nested messages, repeated fields, and timestamps. Options let you set a custom package name and toggle service stubs and request/response wrapper messages for gRPC scaffolding. The converter runs in your browser with no server round-trip, so sensitive API schemas stay on your machine.
JSON
Package
Generation Options
Protocol Buffers
What is JSON to Protobuf Generator?
Protocol Buffers offer a 3–10× size reduction and significantly faster serialisation compared to JSON — but adopting them requires writing .proto schema files that define your message types. When you already have the data shape in JSON form, writing the equivalent proto3 schema is mechanical translation work. This tool generates the proto3 message definitions from your JSON sample: integers become int32 or int64, floats become double, booleans become bool, strings become string, arrays become repeated fields, and nested objects produce separate message types. Field numbers are assigned sequentially starting from 1. Enable “Generate Service Stub” to produce a gRPC service definition with CRUD-style RPC methods alongside the messages. The output is ready to compile with protoc for Go, Python, Java, C#, or JavaScript/TypeScript code generation. Schema inference happens entirely client-side — your data never leaves your machine.
How to Use
- 1
Paste Your JSON Sample
Paste a JSON object or array representing the message structure you want to define as a Protobuf schema. Nested objects and arrays are fully supported.
- 2
Configure Proto Options
Set the package name, root message name, and syntax version (proto3 is recommended). Choose whether to generate service definitions with RPC method stubs alongside the message types.
- 3
Generate the .proto Schema
Click "Generate Proto". JSON types are mapped to proto3 scalar types (int32, int64, float, double, bool, string), nested objects become separate message definitions, and arrays become repeated fields.
- 4
Use the Schema in Your Project
Copy the .proto content into a .proto file. Run protoc (or the language-specific plugin) to generate typed code for Go, Python, Java, C#, or Node.js from the schema definition.
Common Use Cases
gRPC Service Definition
Generate proto3 message definitions from JSON request/response samples to bootstrap gRPC service contracts, enabling binary-efficient communication between microservices.
REST to gRPC Migration
When migrating REST APIs to gRPC, generate Protobuf message types from existing JSON request and response payloads to maintain data structure parity during the migration.
Event Schema Definition
Define Protobuf schemas for Kafka or Pub/Sub event payloads from JSON event samples, enabling schema registry integration and binary serialisation for high-throughput event streaming.
Cross-Language Type Sharing
Generate a .proto schema from JSON data shared between services in different languages (Go, Python, Java). Protobuf provides a language-neutral schema that generates typed code for each target language.
Conversion Examples
JSON Object → Protobuf Message
JSON fields become Protobuf message fields with inferred scalar types and field numbers.
Input JSON
{
"id": 1,
"name": "Alice",
"email": "alice@example.com",
"is_active": true
}Output CSV
syntax = "proto3";
message Root {
int32 id = 1;
string name = 2;
string email = 3;
bool is_active = 4;
}Nested JSON → Nested Protobuf Messages
Nested objects generate separate message definitions with typed field references.
Input JSON
{
"user": {"id": 1, "name": "Alice"},
"items": [{"sku": "ABC", "qty": 2}]
}Output CSV
syntax = "proto3";
message User {
int32 id = 1;
string name = 2;
}
message Item {
string sku = 1;
int32 qty = 2;
}
message Root {
User user = 1;
repeated Item items = 2;
}