JSON to Protobuf Converter
Infer a proto3 schema (.proto) from a JSON sample — fields, types, and nested messages.
Types are inferred from values: string, int32/double, bool, nested objects become nested messages, and arrays become repeated fields. Field names are snake_cased and numbered. Null or empty arrays produce a best-effort guess with a warning — review and tighten the schema before shipping.
Examples
A user record
{ "id": 1, "name": "Ada", "active": true, "tags": ["x"] }message User {
int32 id = 1;
string name = 2;
bool active = 3;
repeated string tags = 4;
}Scalar types are inferred from values, the array becomes a repeated field, and fields are numbered in source order.
About this tool
The JSON to Protobuf Converter reads a JSON object and writes the matching proto3 schema. Each key becomes a numbered field whose type is inferred from its value — strings stay string, integers become int32, decimals become double, booleans become bool. Nested objects become nested messages and arrays become repeated fields.
Field names are snake_cased and message names are PascalCased to follow the protobuf style guide. The tool runs in your browser and never uploads your sample. Null values and empty arrays produce a best-effort guess with a warning, so review the schema before shipping.
How to use
Paste a JSON sample
Use an object that represents one record of your data; the richer the sample, the better the inference.
Name the root message
Set the root message name (e.g. User) so the generated .proto reads cleanly.
Copy the .proto
Copy the output and tighten any warnings (nulls, empty arrays, large integers) by hand.
Use cases
Bootstrapping a gRPC schema
Turn one JSON record into a starter .proto file, then refine the types in your editor.
Documenting a JSON API
Express a sample payload as a typed schema for sharing with backend or mobile teams.
Common mistakes
Mistake:Inferring int32 for very large ids.
Fix:Protobuf int32 tops out around 2.1 billion — switch large identifiers to int64 manually.
Mistake:Trusting empty-array inference.
Fix:An empty array is guessed as repeated string; supply a sample element or set the type yourself.
Frequently asked questions
Related guides
References & standards
Related tools
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV to Chart
Paste or upload CSV data and generate bar, line, pie, or doughnut charts. Export as PNG.
CSV to JSON Converter
Paste CSV data and convert it to pretty-printed JSON instantly — supports custom delimiters, header row toggling, and value trimming.
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV
CSV to SQL Converter
Generate SQL INSERT statements from CSV data