JSON → Protocol Buffers (proto3)

Client

Paste JSON to emit syntax = "proto3" and message blocks—field names in snake_case, arrays as repeated, nested objects as nested messages. A draft for gRPC and protobuf pipelines, not a buf replacement.

Learn more: Protocol Buffers from JSON

Emit proto3 message blocks with snake_case field names and sequential field numbers from your sample—arrays become repeated fields; nested JSON objects become nested messages.

Field numbers and types

In protobuf, field numbers are part of the wire format. This tool numbers fields in key order as a starting point—reassign stable numbers before any release, and never reuse numbers once deployed.

JSON numbers map to double by default; switch to integer types when your domain is integer-only. JSON null and empty arrays get comments or placeholders—model them with wrapper types or omit fields as your API requires.

Compared to GraphQL or OpenAPI

GraphQL SDL and OpenAPI describe HTTP-oriented contracts; .proto files describe binary protobuf messages and optional gRPC services. Use this page when you are moving from JSON samples toward protobuf schemas.

JSON → proto3

?

Parses JSON in your browser and emits classes inferred from the sample shape. Nested objects become nested types; arrays use the first element only to guess item shape. Nothing is uploaded.

Field numbers follow object key order in this draft—reassign stable numbers before publishing. JSON numbers map to double; add int32/int64 when you know integers only. Nested JSON arrays may need wrapper messages or google.protobuf.ListValue.

Common use cases

  • Sketch message types from a REST JSON sample before you run buf lint or protoc.
  • Compare inferred proto with JSON → OpenAPI or GraphQL drafts when choosing wire formats.
  • Bootstrap .proto files for internal tools where JSON is the only contract you have today.

Common mistakes to avoid

  • Shipping field numbers from a single sample

    Field numbers are stable API identifiers—reassign intentionally and never reuse numbers clients might rely on.

  • Assuming double is always correct

    JSON numbers are ambiguous; switch to int32, int64, or fixed64 when your domain uses integers only.

FAQ

Is proto text generated on your servers?

No. Parsing and codegen run locally in your browser.

Does this emit gRPC services or JSON↔proto mappings?

No—only message shapes. Add services, options, and encoding rules in your own schema workflow.

Related utilities you can open in another tab—mostly client-side.