JSON Schema to Protobuf screenshot

JSON Schema to Protobuf

Turn a JSON Schema into proto3 messages: scalars mapped, arrays repeated, nested objects their own message with numbered fields.

Privacy First
0 Runs
Updated 2026-11-17
Runs in your browser
No sign-up, no upload

What the JSON Schema to Protobuf does

Types map by name: string to string, integer to int32, number to double, boolean to bool. An array keeps its element type and gains repeated. A nested object becomes a message named from its title or its property, and is emitted after the message that refers to it.

proto3 has no required fields, so the schema's required list changes nothing here. That is a property of the target, not a decision the page made.

proto3 enums are refused by name: an enum needs a zero value and a name that survives protobuf's own naming rules, and inventing one would be a wire-format decision. $ref, oneOf, anyOf and allOf are refused too.

How to use it

Paste the schema into the JSON Schema box, or press Run with the example already there.

Read the Protobuf below: the root message comes first, then any message it refers to.

Check the Protobuf field numbers — they follow the property order, starting at 1, and a repeated field keeps the number it was given.

Worked example

Input:

{
  "title": "User",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "address": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string"
        }
      },
      "required": [
        "city"
      ]
    }
  },
  "required": [
    "id"
  ]
}

Output:

syntax = "proto3";

message User {
  int32 id = 1;
  string name = 2;
  repeated string tags = 3;
  Address address = 4;
}

message Address {
  string city = 1;
}

Why it runs in your browser

The result is produced on this page with JavaScript, so it works offline after the page loads and nothing you enter is sent anywhere.

A proto3 file with one message per object schema, fields numbered in declaration order, and an array written as `repeated`.

The numbering is the schema's property order, so a regenerated file keeps the numbers it had as long as the property order is stable.

What it does, and what it does not

Types map by name: string to `string`, integer to `int32`, number to `double`, boolean to `bool`. An array keeps its element type and gains `repeated`. A nested object becomes a message named from its title or its property, and is emitted after the message that refers to it.

proto3 has no required fields, so the schema's `required` list changes nothing here. That is a property of the target, not a decision the page made.

proto3 enums are refused by name: an enum needs a zero value and a name that survives protobuf's own naming rules, and inventing one would be a wire-format decision. `$ref`, `oneOf`, `anyOf` and `allOf` are refused too.

How to use JSON Schema to Protobuf

Paste the schema into the JSON Schema box, or press Run with the example already there.

Read the Protobuf below: the root message comes first, then any message it refers to.

Check the Protobuf field numbers — they follow the property order, starting at 1, and a repeated field keeps the number it was given.

What to Expect

Best for

  • Starting a proto3 file from a documented schema
  • Seeing the wire type a schema property maps to

Not ideal for

  • Schemas with enums, which are refused
  • A schema that relies on $ref

What this tool keeps

  • Field numbering in property order
  • An array as a repeated field

What may need cleanup

  • A field that was removed leaves a gap that should be `reserved`
  • Enums need hand-written zero values

Common errors

  • The page refuses it: is an enum; proto3 enums are not emitted by this page

Example use cases

  • Drafting a proto3 service from a JSON API
  • Checking an integer maps to int32 rather than int64

Sample input

JSON Schema: { …

Sample output

Protobuf: syntax = "proto3"; …

Who this is for

  • Backend developers defining a protobuf contract
  • Anyone comparing a JSON schema with a proto file

Frequently asked questions

Why is required ignored?

proto3 has no required keyword: every singular field is optional on the wire. The page prints the schema's shape, and adding requiredness would be a claim the target cannot make.

Why are enums refused?

A proto3 enum must have a zero value and its names must be unique within the package. Choosing those names for you would change the wire format, so the page refuses instead.

How are field numbers chosen?

In property order, starting at 1. Protobuf numbers must not change once a message is in use, so keep the property order stable or assign the numbers by hand.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.