JSON ↔ Protobuf Toolkit
Infer .proto schemas from JSON, or encode and decode Protobuf payloads with your schema
Paste a JSON sample or load an example, then choose Generate .proto.
Three conversions, kept apart
JSON → .proto infers a proto3 schema from a JSON sample. JSON → Protobuf encodes a JSON payload into binary with your own .proto schema and message type, and Protobuf → JSON decodes hex, base64 or a binary file back to JSON. Schema inference and real encoding are different jobs, so each has its own mode.
How schemas are inferred
Strings become string, booleans bool, decimals double and integers int64 by default, because a value that fits int32 today may not tomorrow. Objects become messages named in PascalCase from their keys, arrays of one type become repeated fields, and every object of an array is merged so optional keys are not missed. Null-only, empty or mixed values use google.protobuf.Value and are listed as notes. Field numbers are assigned in key order; once a schema is deployed they are part of the wire format and must not change.
Encoding and decoding
JSON uses the ProtoJSON mapping: lowerCamelCase field names, 64-bit integers as strings, bytes as base64, enums as names and the special forms of well-known types such as Timestamp, Duration, Struct and wrappers. Advanced options can emit default values, keep proto field names, write enums as numbers or ignore unknown JSON fields. Decoding lists field numbers the selected message does not declare, a common sign that the wrong message type is selected.
Limits and privacy
Schemas must be self-contained: Google well-known types (Timestamp, Duration, Struct, Any, Empty, FieldMask and wrappers) are bundled, and other imports are never fetched from the network. A sample cannot reveal enums, maps, presence or evolution plans, so review every inferred schema. Everything runs in your browser; payloads and schemas are not uploaded.
