Skip to main content

Apache Avro Schema Formatter & Validator

Validate an Apache Avro schema (JSON) against the Avro specification — missing type/fields/name, unknown types, invalid names, duplicate named types and malformed unions all get a clear message with the exact field path — then pretty-print it with 2 or 4-space indentation. Runs entirely in your browser.

Input

Output

Formatted Schema
 
Was this helpful?

Guides

Paste an Apache Avro schema — the JSON document that describes a record's fields, used across Kafka topics, schema registries, and data-serialization pipelines — and this tool checks it against the Avro specification, then pretty-prints it with consistent indentation. Everything runs in your browser: nothing is uploaded anywhere.

Unlike a plain JSON validator, it understands Avro's own shape rules. A schema can be syntactically perfect JSON and still be an invalid Avro schema — a record missing its fields array, a field with no type, an enum symbol that doesn't match Avro's naming rules, or a union written as ["null", "null"] with the same branch twice. This tool catches those and tells you exactly which field is wrong and why, instead of a generic "invalid schema" message.

What it checks

  • The input is well-formed JSON, and every type node is a recognized shape: the eight primitives (null, boolean, int, long, float, double, bytes, string) and the six complex types (record, enum, array, map, union, fixed).
  • record types declare a name and a fields array, and every field has both a name and a type; enum declares a non-empty, duplicate-free symbols array; array declares items; map declares values; fixed declares a positive integer size.
  • Named types (record/enum/fixed) don't collide, and a reference to a named type defined elsewhere in the same document — forward or backward — is resolved and flagged if nothing matches.
  • Unions are JSON arrays, and each type may appear in a union at most once — Avro doesn't allow two string branches, or two record branches, side by side.

How to use it

  1. Paste your Avro schema JSON into the input box, or click Try an example to load a sample record.
  2. Choose 2 or 4-space indentation.
  3. Read the result line: Valid Avro schema with a quick tally of records, fields, enums, unions and fixed types, or Invalid Avro schema with the exact problem and its path (e.g. fields[2].type).
  4. Copy or download the formatted schema — valid schemas are saved as schema.avsc, matching the extension Avro tooling expects.

Validation and formatting run automatically as you edit, so you can fix one field at a time and watch the result update live.

Does this resolve schemas from a remote schema registry?

No. Avro doesn't have $ref-style remote lookups — it lets one schema reference another named type defined within the same document (by name, with an optional namespace), which this tool resolves. A schema that only exists in a separate file or a registry can't be checked without fetching it, which this client-side tool deliberately never does.

What does "union" mean in an Avro schema?

A union lets a field hold one of several types, written as a JSON array instead of a single type — most commonly ["null", "string"] to make a field optional. This tool enforces the rule that trips people up most: a union may contain at most one branch of any given type, so ["string", "string"] or two inline record definitions of the same name are rejected.

Is my schema private?

Yes. Parsing, validation and formatting all happen in pure JavaScript on your device — in the browser tab, or in the API/Node runtime if you call it programmatically. Nothing is transmitted, logged, or stored.

avroschemavalidatorformatterjsonkafkadata-serializationdeveloper

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.