Schema

Minified

What is the Avro Minifier?

Avro schemas are JSON, and JSON files written for humans waste a lot of bytes on indentation, line breaks, and (in Avro's case) doc fields. This tool strips all of that out. Paste your .avsc in the left panel and the right panel shows a single-line compact version that still parses correctly per the Apache Avro 1.11 specification.

There is also a "Strip doc strings" toggle. Avro lets you attach doc annotations to records and fields — great when you are documenting a schema for the team, terrible when you are trying to fit the schema into a message header or a tightly-budgeted Schema Registry payload. Toggle it on and every doc field disappears recursively before the JSON is re-stringified.

Both passes happen in your browser. The schema is parsed with the native JSON.stringify() with no indent argument, which produces the canonical compact form defined by RFC 8259. Nothing leaves your machine.

How to Use the Avro Minifier

Three steps. Auto-runs as you type — no Convert button needed.

1

Paste or Upload Your Schema

Drop your formatted .avsc into the left Schema panel. Upload reads from a file, Sample loads a typical Order schema you can experiment with. Plain JSON works too — Avro schemas are valid JSON.

If you have a JSON-encoded Avro record (not a schema), the same minifier works for that. It is just JSON either way.

2

Decide on Doc Strings

Leave Strip doc strings off if you want to keep the documentation. Turn it on if you are going to send this schema over the wire and every byte counts. The savings depend on how heavily your team has documented the schema — sometimes 10%, sometimes 40% on doc-heavy schemas.

3

Copy or Download

Hit Copy for the minified blob, or Download to save it as .avsc. The size bar at the top shows original vs minified bytes and the percent saved.

When You Would Use This

Embedding Schemas in Messages

Some pipelines embed the Avro schema right in the message header (instead of looking it up in a registry by ID). Every byte costs network. Minify the schema, drop the docs, and you cut the per-message overhead by 30-50% on doc-heavy schemas.

Schema Registry Payload Limits

Confluent Schema Registry has a default request size limit. If you have a deeply nested schema with extensive documentation, you can hit that ceiling. Minifying with doc-stripping is the quickest fix before reaching for tuning the broker config.

Snapshotting Schemas in Tests

Snapshot tests for Kafka producers often store the schema as a string fixture. Minifying makes the snapshot a single line — diffs become readable, and you actually notice when a field changes.

Comparing Two Versions

Two schemas that look different on disk might actually be identical once you remove indentation differences. Minify both, compare with a string equal — no false positives from formatting drift.

Common Questions

Does minifying lose any information?

Whitespace-only minify keeps everything. The "Strip doc strings" toggle removes documentation comments — those are non-functional under the Avro spec, so the schema remains semantically identical and any consumer that parsed the original will parse the minified version too.

Will Schema Registry accept the minified version?

Yes. Avro evaluates schemas by their canonical fingerprint, which ignores whitespace and (depending on registry settings) doc fields. If the original passed compatibility checks, the minified version passes too. Confluent's parsing canonical form is described in the Avro spec — minifying gets you most of the way there.

Is the minified output deterministic?

Yes for the JSON keys you control. JSON.stringify preserves insertion order for object keys, so two minify runs over the same parsed schema produce byte-identical output. If you need the strict Avro Parsing Canonical Form (which sorts keys), use the official Avro library after minifying here.

What does "Strip doc strings" actually remove?

Every doc property at every level of the schema — on records, on fields, on enums. Nothing else. Aliases, namespaces, default values, logicalType annotations, custom properties — all kept.

How big a schema can I minify?

Anything your browser can hold in a string. The minifier itself is JSON.parse + JSON.stringify, so it is as fast as the runtime. The Ace editor on the left becomes the bottleneck around 10 MB — for bigger inputs, run JSON.stringify in a Node script.

How is this different from the JSON Minifier?

Mechanically very similar — both are JSON.stringify with no indent. The Avro Minifier adds the Strip Doc Strings option, an Avro-specific sample, and links out to the rest of the Avro toolset. If you do not need doc-stripping, the JSON Minifier works fine on .avsc files.

Other Avro Tools

Minifying is one corner of working with Avro. These tools handle the rest: