Loading Avro Formatter...

How to Format Avro Schemas - Step by Step Guide

Step 1

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.

•
Paste directly: Copy your Avro schema from any source
•
Upload file: Click the Upload button to select an .avsc or .json file
•
Try sample: Click the Sample button to load an example Avro schema

Unformatted Avro schema input example:

{"type":"record","name":"User","namespace":"com.example","fields":[{"name":"id","type":"int"},{"name":"name","type":"string"}]}
Step 2

Automatic Formatting & Validation

The formatter automatically beautifies your Avro schema with proper indentation and validates it against the Avro specification:

•
Pretty printing: Adds proper indentation and line breaks for readability
•
Schema validation: Ensures your schema is valid Avro format
•
Minify option: Toggle between beautified and minified formats
•
Error detection: Identifies syntax errors with line and column numbers

Formatted output example:

{
  "type": "record",
  "name": "User",
  "namespace": "com.example",
  "fields": [
    {
      "name": "id",
      "type": "int"
    },
    {
      "name": "name",
      "type": "string"
    }
  ]
}
Step 3

Download or Copy Formatted Schema

Once formatted, you can download the schema as an .avsc file or copy it to your clipboard:

•
Download: Save as .avsc file
•
Copy: One-click copy to clipboard
•
Toggle format: Switch between beautified and minified versions

FAQs 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.