Avro Formatter

Pretty-print Avro schemas and JSON-encoded Avro records as you type

Input

Output

Paste your input on the left and the result shows up here.

Or drop a file on this box, , or .

What is the Avro Formatter?

A .avsc pulled from Apache Avro tooling or copied out of a Schema Registry response usually arrives as one line, and a record with a nested array and a union is hard to follow in that form. Paste it on the left and the output side lays it out with two-space indentation, one field per block, re-running each time you pause typing. A JSON-encoded Avro record is formatted the same way, because both are plain JSON on disk; even a schema that was pasted as an escaped JSON string (quotes and backslashes included) is unwrapped first.

Most Avro schemas come out of a Schema Registry or a CI artifact as one long line. A four-level Order → OrderItem → Address → Geo schema is genuinely unreadable until somebody reformats it. This is that somebody. Once it is laid out, you can spot the field that does not match the producer, find the union that is missing a default, or compare two versions side-by-side without losing your place.

Everything runs in the browser. The schema you paste never leaves your machine, no server, no logs, no upload.

How to Use the Avro Formatter

Three quick steps. The buttons described below match the actual buttons on this page.

1

Paste, Upload, or Load a Sample

Three ways to fill the left Input panel: paste, open an .avsc or .json file through Upload, or press Sample for a one-line Order schema with an items array, a currency enum and an optional shipping address. Compact input like this shipment record is the typical starting point:

{"type":"record","name":"Shipment","namespace":"io.northwind.logistics","fields":[{"name":"trackingNo","type":"string"},{"name":"weightGrams","type":"int"},{"name":"carrier","type":{"type":"enum","name":"Carrier","symbols":["DHL","UPS","POSTNORD"]}}]}

Both schemas (.avsc) and JSON-encoded Avro records work: they share the same JSON-on-disk form per the Avro 1.11 specification.

2

Watch It Format Automatically

About 300 ms after your last keystroke the Output panel shows the formatted version. Broken JSON produces "Invalid Avro:" plus the parser message, and the position it gives is the place to look. The Minify button on that panel does the reverse and writes a single-line copy into the output.

3

Copy, Download, or Minify

Hit Copy to grab the formatted Avro for a PR or chat. Hit Download to save as .avsc. Hit Minify to round-trip back to single-line form. All formatting uses the browser's built-in JSON.stringify(): fast, deterministic, no third-party libraries.

When You'd Actually Use This

Reviewing a Schema PR

Your teammate opened a PR adding three fields to an Order schema. The diff is on a single line and unreadable. Paste each version in here, eyeball the formatted output, approve or comment.

Cleaning Up Schema Registry Exports

Pulled a schema down from Confluent Schema Registry via curl and got back a JSON envelope with the schema as a stringified value? Format it here, peel out the inner schema, drop it into your repo as a clean .avsc.

Documenting an Event Contract

Documenting an event your team publishes? Format the schema, paste it into the wiki or the README, and reviewers can read the record names, enum symbols and defaults without squinting at one long line.

Onboarding a New Hire

Walking a new teammate through the data pipeline? A pretty-printed Order schema with each field on its own line is a lot less intimidating than the one-liner that comes out of the registry.

Common Questions

Does it auto-format as I type?

Yes. The formatter watches the input editor and re-runs about 300 ms after you stop typing. No Convert button, no Format button, just type and read.

Will it touch my schema in any way other than indentation?

No. Formatting is just JSON.parse() followed by JSON.stringify(value, null, 2). Field order is preserved, no values are coerced, no comments are added (Avro JSON does not have comments anyway).

Can it handle binary Avro container files?

No. This tool reads JSON inputs only (Avro schemas are JSON; the JSON encoding of Avro data is JSON). For binary .avro Object Container Files, use the avro-tools command-line utility to dump them to JSON first.

Is my schema sent to a server?

No. The schema is parsed and re-indented by JavaScript in this tab, so it never reaches us and nothing gets logged. You can disconnect from the network and the formatter still works.

How big a schema can I paste?

There is no size cap on this page, since nothing is uploaded. A schema with a few thousand fields formats in well under a second; the thing that slows down first on really large inputs is the editor drawing tens of thousands of lines, not the JSON parse.

What's the difference between this and the JSON Formatter?

Functionally similar: Avro schemas are valid JSON, so a JSON formatter works on them. The Avro formatter ships with an Avro-flavored sample, page copy aimed at Avro users, and links to related Avro tools. If you are formatting Avro all day, this page is faster to land on.

Other Avro Tools

A readable schema is often the first step before checking, fixing or converting it. These pages pick up from there: