Avro Schema Formatter - Format & Beautify Apache Avro Schemas Online
Free online tool to format and beautify Apache Avro schemas with validation for Kafka and Hadoop.
Loading Avro Formatter...
How to Format Avro Schemas - Step by Step Guide
Input Your Avro Schema
Paste your Avro schema into the editor or upload an .avsc or .json file. The formatter accepts minified or unformatted Avro schemas.
.avsc or .json fileUnformatted Avro schema input example:
{"type":"record","name":"User","namespace":"com.example","fields":[{"name":"id","type":"int"},{"name":"name","type":"string"}]}Automatic Formatting & Validation
The formatter automatically beautifies your Avro schema with proper indentation and validates it against the Avro specification:
Formatted output example:
{ "type": "record", "name": "User", "namespace": "com.example", "fields": [ { "name": "id", "type": "int" }, { "name": "name", "type": "string" } ] }
Download or Copy Formatted Schema
Once formatted, you can download the schema as an .avsc file or copy it to your clipboard:
.avsc fileFAQs About Avro Schema Formatting
Why format Avro schemas?
A schema squashed onto one line is hard to review. With each field on its own line you can see the record structure, the types and the nested records at a glance, which matters once a schema grows past a handful of fields. It's especially useful when working with complex schemas in Kafka or Hadoop environments.
What's the difference between beautify and minify?
Beautify puts every key on its own line with two-space indentation. Minify strips the whitespace between tokens so the whole schema sits on one line, which is handy when you need to paste it into a config value or a Schema Registry request body. Neither one changes anything inside the schema.
Does the formatter validate Avro schemas?
Yes. Every schema is checked with avsc, a JavaScript implementation of Avro. Unknown types, records or enums without a name, duplicate field names and defaults that don't fit their type are reported in plain words, naming the field where possible. JSON mistakes such as a missing or trailing comma are shown with the line and column where reading stopped.
Will formatting change any of my values?
No. Only the whitespace between tokens changes. A long default such as 8901240544102066246, a decimal written as 14.50, an exponent like 1e3 and \u escapes inside strings all come out exactly as you typed them, and the key order stays the same.
Can I use this for Kafka Schema Registry schemas?
Yes. Registry schemas are ordinary Avro JSON, so you can tidy one up before registering it or make one you fetched from the registry readable for a code review. The formatter only checks that the schema itself is valid; it doesn't compare it with earlier versions, so it can't tell you whether a change is backward compatible. The Avro Schema Compatibility Checker does that.
Is this Avro Formatter free to use?
Yes, and there's no account to create. Formatting happens in your browser, so the schema isn't sent to our server. Uploaded files can be up to 10 MB.
Related Tools
JSON to Avro
Convert JSON data to Apache Avro format with automatic schema generation
Avro to JSON
Convert Apache Avro data to JSON format with schema validation
Avro Fixer
Fix and repair broken Avro schemas with automatic syntax error correction
Avro Schema Generator
Generate Apache Avro schemas from JSON data with automatic type inference
Avro Schema Validator
Validate Apache Avro schemas with syntax and structure checking for Kafka
CSV to Avro
Convert CSV files to Apache Avro format with automatic schema generation