Avro to JSON
Generate a sample JSON record from an Avro schema, right in the browser
Input
Output
Paste your Avro on the left and the JSON shows up here.
Or drop a file on this box, , or .
What does Avro to JSON do?
Say a teammate hands you an Apache Avro schema (.avsc) and you want to know what one message on that topic will look like, maybe to seed a consumer test or to mock an endpoint before the producer exists. Paste the schema on the left and the page writes out one JSON record that fits it, with a placeholder picked by type: "example" for strings and bytes, 1 for int and long, 1.5 for float and double, true for boolean, the first symbol of an enum, and a single element inside every array.
The generator walks the schema as defined in the Avro 1.11 specification: records produce objects with each field, arrays produce a one-element array, maps produce {key: ...}, enums pick the first symbol, fixed types produce a string of zeros at the right length, and unions pick the first non-null branch. Named types defined earlier in the schema are reused when referenced later: the same record class shows up consistently. The output is well-formed RFC 8259 JSON, so you can drop it straight into JSON.parse() or any HTTP client.
This is sample data for development, not realistic test data. The orderId will be "example", not "ORD-58231". If you need realistic fixtures with names, dates, and prices that look real, hand-edit the output or feed it through a faker library: the tool gives you the shape, you bring the realism.
How to Use Avro to JSON
Nothing to configure here. The record is rebuilt about 300 ms after you stop typing, so the three steps come down to getting a schema in, reading the result and taking it with you.
Paste, Upload, or Load a Sample
Get the schema into the left Input panel by pasting it, by choosing an .avsc, .json or .txt file with Upload, or by pressing Sample, which loads an Order record holding OrderItem entries, a currency enum and an Address that may be null. A schema squeezed onto one line works too, like this greenhouse sensor event:
{"type":"record","name":"TemperatureReading","namespace":"io.greenhouse.telemetry","fields":[{"name":"sensorId","type":"string"},{"name":"celsius","type":"double"},{"name":"recordedAt","type":{"type":"long","logicalType":"timestamp-millis"}}]} The schema must be valid JSON in .avsc form. If you have a binary .avro Object Container File, use avro-tools getschema first to extract the schema, then paste the JSON here.
Read the Generated JSON
The right Output panel shows a fully-formed JSON record matching the schema. Every required field is present, nullable fields default to the non-null branch (a real value, not null), arrays contain one example element, enums pick the first symbol. If the schema parses but is structurally weird, you will see fields with placeholder values where the inferrer could not figure out the type.
Copy, Download, or Tweak
Hit Copy to paste the JSON into a test fixture, a Postman request, or a Kafka Schema Registry producer's payload. Hit Download to save as sample.json. Edit the placeholder values to be realistic, or pipe the structure through your faker of choice. Parsing is done with the browser's native JSON.parse(): your schema never leaves the page.
When You'd Actually Use This
Test Fixtures for Consumers
You are writing a Kafka consumer that reads Order events. The producer is not built yet, but the schema is. Paste the schema here, get a sample record, drop it in fixtures/order.json and write the consumer test against it.
Mock API Responses
You are spinning up a mock REST API to unblock the frontend team while the real backend is in flight. The data contract is an Avro schema. Generate the JSON shape, hand it to the mock server, frontend can start integrating today.
Schema Smoke Test
Reviewing an Avro schema PR. You want a quick "if I produced this schema, what would the message look like?" gut check. Paste the schema, eyeball the JSON, ship the review.
Documentation Examples
The wiki page for your order-placed topic needs an "Example payload" block. Generate it from the schema that lives in the repo, paste it in, then swap the placeholders for one believable order so readers see what real traffic looks like.
Common Questions
What value does it pick for a union like ["null", "string"]?
The first non-null branch. So ["null", "string"] produces "example", not null. The thinking is that you almost always want to see real values when generating samples: null is rarely useful in a fixture. If you need null specifically, edit the output.
Does it handle named type references and recursive schemas?
Yes for forward-defined named types: once a record is seen, it is cached and reused if referenced later by name. Truly recursive schemas (a tree where node references node) will recurse one level and then resolve the reference; you will not get infinite output, but you will get a single nested layer.
Why does my decimal logical type come back as "example" instead of a number?
The generator looks only at the underlying physical type, so a decimal on bytes becomes "example" and a decimal on fixed becomes a run of zeros at the fixed size. Logical type semantics like decimal(10, 2) are not turned into a real decimal value; see the logical types section of the spec for the actual encoding rules.
Will it validate that my schema is structurally correct first?
It validates JSON syntax only. Structural Avro rules (every record needs type, name, fields; primitive type names are exact) are not checked here, for that, use the Avro Validator. If the schema is broken, the generator will still try, and the output may have placeholder strings where the type was unrecognizable.
Is the schema sent to a server?
No. Generation runs entirely in your browser. JSON.parse() and a small recursive walker do all the work. Nothing is uploaded, nothing is logged.
What's the difference between this and an Avro deserializer?
A deserializer takes binary Avro-encoded bytes plus a schema and produces JSON. This tool takes only the schema and produces a placeholder JSON record, no real data is involved. If you have actual Avro binary data, run it through avro-tools tojson first, then paste the JSON output into the Avro Viewer.
Other Avro and JSON Tools
Once you have the placeholder record, these are the usual next stops: the reverse trip from JSON, the same schema in other formats, and checks on the schema itself: