Avro Schema Generator
Generate Apache Avro record schemas from JSON samples. Infer field types, logical types (uuid, timestamp-millis), and nullable unions. Free, 100% client-side.
Loading tool...
What is Avro Schema Generator?
An Avro schema generator turns JSON sample data into an Apache Avro record schema β the typed contract used by Kafka, Confluent Schema Registry, Hadoop, and data lake pipelines. Paste one object, an array of samples, or NDJSON lines, and the tool infers each field as an Avro type (string, int, long, double, boolean, nested records, arrays), detects logical types such as uuid and timestamp-millis, and marks fields that are missing or null in some samples as nullable unions with default null. Everything runs locally in your browser.
Key Benefits
- Turns raw JSON samples into a typed Avro contract in seconds
- Merges multiple samples so the schema reflects real-world variance, not one lucky record
- Optional fields become nullable unions with default null, following Avro conventions
- Configurable record name and namespace for Schema Registry naming rules
- 100% client-side β sample data never leaves the browser
Common Use Cases
- β’Bootstrapping a Kafka producer or consumer schema from sample event JSON
- β’Registering schemas in Confluent Schema Registry without hand-writing field types
- β’Defining Hive or Hadoop table schemas from exported JSON records
- β’Documenting API payloads as Avro contracts for data engineering handoffs
- β’Migrating JSON pipelines to Avro binary format with a validated starting schema
Generate an Avro Schema from JSON
- Paste your samples: Drop a single JSON object, an array of objects, or NDJSON lines into the input, or press Sample to load two records that demonstrate unions and logical types.
- Set record name and namespace: Fill the Options panel β RootRecord and com.example by default β so the schema matches your Schema Registry naming rules.
- Review the inferred fields: Check the output for int versus long, nested records, arrays, uuid and timestamp-millis logical types, and nullable unions with default null on optional fields.
- Copy or download the schema: Use Copy for the clipboard or Download to save <RecordName>.avsc β everything is inferred in your browser and no sample data is uploaded.
Key Features
- Type inference for string, boolean, int, long, double, nested records, and arrays
- Logical type detection for uuid strings and ISO-8601 datetimes (timestamp-millis)
- Merge many samples: fields missing in some become nullable unions with default null
- Flexible input: single object, array of objects, or newline-delimited JSON (NDJSON)
- Adjustable record name and namespace in the generated schema
- Runs entirely offline in your browser β no data leaves your machine