Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Avro Schema Prettifier & Indenter

Paste minified or messy Avro JSON schema, instantly format with proper indentation and syntax highlighting

Your files never leave your browser
Input0 chars, 0 lines
Output0 chars, 0 lines
Ready·

Paste a minified or badly indented Avro JSON schema, hit Format, and get clean indentation with syntax highlighting. Pick 2-space or 4-space indent, or minify it down to one line for Kafka configs and Schema Registry calls. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste Avro Schema
➔
Parse & Indent
➔
Highlighted Output

The tool parses your input as JSON, then rebuilds it with your chosen indent level. Avro-specific keywords like "record", "enum", "array", and primitive types get color-coded so you can spot them instantly. Keys, strings, numbers, and brackets each get their own highlight color. If the JSON is broken, you'll see the exact line and character where parsing failed.

Examples

Formatting a minified user record schema

A teammate pasted a single-line schema into Slack. You need to review the field types before a migration.

INPUT
{"type":"record","name":"User","namespace":"com.example","fields":[{"name":"id","type":"long"},{"name":"email","type":"string"},{"name":"active","type":"boolean"}]}
OUTPUT
{ "type": "record", "name": "User", "namespace": "com.example", "fields": [ { "name": "id", "type": "long" }, { "name": "email", "type": "string" }, { "name": "active", "type": "boolean" } ] }

Cleaning up a schema with union types

Nullable fields use union syntax — hard to read when it's all crammed together.

INPUT
{"type":"record","name":"Event","fields":[{"name":"timestamp","type":"long"},{"name":"payload","type":["null","string"]},{"name":"metadata","type":["null",{"type":"map","values":"string"}]}]}
OUTPUT
{ "type": "record", "name": "Event", "fields": [ { "name": "timestamp", "type": "long" }, { "name": "payload", "type": [ "null", "string" ] }, { "name": "metadata", "type": [ "null", { "type": "map", "values": "string" } ] } ] }

Minifying a schema for a Kafka config

You need the schema on one line to register it with the Schema Registry API.

INPUT
{ "type": "enum", "name": "Status", "symbols": [ "ACTIVE", "INACTIVE", "PENDING" ] }
OUTPUT
{"type":"enum","name":"Status","symbols":["ACTIVE","INACTIVE","PENDING"]}

Who Uses This

💻 Data Engineers

Cleaning up Avro schemas before committing to a schema registry or reviewing pull requests.

⚡ Backend Developers

Formatting schemas pulled from Kafka or Confluent to debug serialization issues.

📚 Technical Writers

Making schemas readable for API documentation and data dictionaries.

🎓 Students

Learning Avro schema structure by seeing how nested records, unions, and arrays are laid out.

Common Mistakes

Pasting Avro IDL instead of JSON

Avro has two formats: JSON schema (.avsc) and IDL (.avdl). This formatter only handles the JSON version. If you paste IDL syntax like record User { string name; }, you'll get a parse error. Convert IDL to JSON first.

Trailing commas in arrays or objects

JSON doesn't allow trailing commas. A field list like "fields": [{"name":"id","type":"long"},] will fail. Remove the extra comma after the last item.

Using single quotes instead of double quotes

JSON requires double quotes for keys and string values. If you copied a schema from a Python script or YAML conversion, single quotes will break parsing. Replace ' with " throughout.

Technical Details

Frequently Asked Questions

What is an Avro schema?

An Avro schema defines the structure of data serialized with Apache Avro. It's written in JSON and describes field names, types, defaults, and nesting. Think of it as a blueprint that tells Avro how to encode and decode your data.

What's the difference between .avsc and .avdl files?

.avsc files contain Avro schemas in JSON format. .avdl files use Avro IDL, a more human-friendly syntax that looks closer to Java or C. This formatter works with .avsc (JSON) files only. You can convert IDL to JSON using the Avro tools CLI.

Does this validate my Avro schema?

It checks that the JSON is valid — you'll get an error with the exact position if something's broken. It does not check Avro-specific rules like whether a record has a "name" field or if your logical types are correct. For that, you'd need the Avro compiler or a schema registry.

Can I use this for regular JSON too?

Yes. Since Avro schemas are just JSON, this works on any JSON input. The syntax highlighting picks up Avro keywords automatically, but plain JSON still gets formatted and color-coded just fine.

Is my data safe when I paste a schema here?

Completely. The formatting happens in JavaScript inside your browser tab. Nothing gets sent anywhere. You can disconnect your internet and the tool still works — that's the easiest way to confirm it yourself.

Share: