Input

Output

What is the Avro Formatter?

Pasted a single-line Apache Avro schema and given up trying to read it? This tool fixes that on the spot. Drop your .avsc schema or a JSON-encoded Avro record into the left panel and the right panel reformats it with two-space indentation, line breaks at every field, and proper nesting — automatically, as you type. No Convert button, no extra clicks. Both Avro schemas and the JSON encoding of Avro records are valid JSON underneath, so the same formatter works for both.

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

Paste an Avro schema (or JSON-encoded record) into the left Input panel. Hit Upload for an .avsc or .json file, or click Sample to drop in a realistic Order schema. Quick example of what minified input looks like:

{"type":"record","name":"Order","namespace":"com.example.commerce","fields":[{"name":"orderId","type":"string"},{"name":"totalCents","type":"long"}]}

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

The right Output panel reformats the parsed Avro with two-space indentation about 300 ms after you stop typing. No button to click. If the input is not valid JSON, the output panel shows the parse error so you know exactly which character to fix.

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

Writing the docs for an event your team produces? Drop the schema in, copy the formatted version into the wiki. Records, unions, logical types — all read naturally once they have line breaks.

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. Parsing and formatting run entirely in your browser. Nothing is uploaded, nothing is logged. You can disconnect from the network and the formatter still works.

How big a schema can I paste?

Anything your browser can hold. Schemas of a few thousand fields format instantly. Past 10 MB the Ace editor itself starts to lag — that is the bottleneck, not the formatter.

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

Formatting is one part of working with Avro. These tools cover the rest: