Avro Schema to JSON Schema

Paste an Avro schema and get an equivalent JSON Schema (draft 2020-12), with named records and enums turned into definitions and unions into anyOf.

Use the tool

Why this tool exists

Kafka and data pipelines describe messages in Avro, while REST APIs, form builders and documentation tools expect JSON Schema. Teams end up translating by hand when they want to validate the JSON form of an event, generate docs or share a contract with a web client.

This converter reads the .avsc, resolves named references and namespaces, and writes properties, required lists and $defs. Fields with a default are not required, unions become anyOf, maps become objects with additionalProperties, and common logical types such as timestamp-millis and uuid get a matching format. It covers the standard Avro types. Custom logical types and schema registry references are not resolved, and the JSON form of unions is simplified.

How to use it

  1. Paste your Avro schema JSON, a record or any valid Avro type.
  2. Read the JSON Schema in the output, with shared types under $defs.
  3. Copy it into your validator or documentation tool.

Frequently asked questions

How are unions handled?

As anyOf over the converted members, so a nullable union becomes a choice between null and the other type. Avro tagged JSON encoding, where the branch name wraps the value, is not modelled.

Which logical types are supported?

timestamp-millis, timestamp-micros, date, uuid and time-millis. Others are ignored and the base type is used. Decimal is not given special treatment.

Why does additionalProperties false appear?

Avro records have a fixed set of fields, so the generated object schema rejects unknown keys. Remove that line if your consumers should tolerate extras.

Does it follow references to other files?

No. Only names defined earlier in the same document are resolved. An unknown type name stops the conversion with an error naming it.