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
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). recordtypes declare anameand afieldsarray, and every field has both anameand atype;enumdeclares a non-empty, duplicate-freesymbolsarray;arraydeclaresitems;mapdeclaresvalues;fixeddeclares a positive integersize.- 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
stringbranches, or tworecordbranches, side by side.
How to use it
- Paste your Avro schema JSON into the input box, or click Try an example to load a sample record.
- Choose 2 or 4-space indentation.
- 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). - 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.