Avro to TOML
Convert an Avro schema or JSON-encoded record to TOML in your browser, no upload
Input
Output
Paste your Avro on the left and the TOML shows up here.
Or drop a file on this box, , or .
What does Avro to TOML do?
Somebody hands you an Apache Avro record encoded as JSON, or a whole .avsc, and the repo it has to land in reads TOML: a Cargo workspace, a Python pyproject, an infra config. This page writes the same values back out as TOML. Top-level scalars become key = value lines, a nested object becomes a [table], and a list of objects becomes repeated [[table]] blocks.
The Avro 1.11 specification writes schemas in JSON and defines a JSON encoding for data, which is why one input box handles both. Arrays of scalars stay inline (symbols = ["USD", "EUR"]), strings are double-quoted with backslashes and quotes escaped, and integers past 2^53 are written digit for digit. One limit to know about: inside a table only its scalar values are written, so an object nested two levels deep (a field whose type is itself a record, for example) does not make it into the TOML. Flat config-style records convert cleanly; deep schemas need a look before you commit them.
The conversion is done locally in the page: your schema is not sent to a server and is not saved anywhere.
How to Use Avro to TOML
TOML shows up on the right a beat after you stop typing. The steps cover what to paste, how to read the table layout, and how to take the file away.
Paste, Upload, or Load a Sample
Paste a JSON-encoded Avro record or an .avsc into Input, pick a file with Upload, or try Sample, which loads an Order schema. Records with one level of nesting give the cleanest TOML, like this warehouse sensor reading, which becomes two [[readings]] blocks and an [alerting] table:
{"deviceId":"THERM-0042","site":"Oslo warehouse","readings":[{"sensor":"temp","celsius":4.5},{"sensor":"humidity","percent":61}],"alerting":{"enabled":true,"thresholdCelsius":8}} TOML requires an object at the top level: a JSON array or scalar will not convert cleanly, since TOML has no notion of a bare top-level array.
Read the TOML Output
The right Output panel shows the same data formatted as TOML. In every table the plain key/value lines come first, then a [header] for each nested object and a [[header]] for each list of objects, at any depth. Headers such as [fields.type.items] in the sample use the dotted-key style from the spec, so the path to every value is spelled out.
Copy or Download
Copy takes the TOML exactly as shown and Download saves it as output.toml; the trash-can icon above the input empties both panes. Before you commit the file, load it once with Python's tomllib or whatever TOML library your app uses, since a key containing a space or a dot is written as-is and will only fail there.
When You'd Actually Use This
Config File Migration
You inherited an Avro schema that someone is using as a configuration shape (yes, it happens). The new home is a Rust project with Cargo and TOML everywhere. Run the schema through here, drop the TOML into the repo, prune what does not apply.
Documentation in TOML Repos
Your infra repo speaks TOML: Pulumi configs, Terragrunt overrides, custom tooling. You need to document an event payload coming off a Kafka topic with a known Avro schema. Convert once, paste the TOML into the README as the example payload.
Generating Test Settings
You wrote an Avro-driven settings system and need TOML fixtures for a Rust integration test. Paste the JSON-encoded Avro record into the converter, drop the TOML into tests/fixtures/settings.toml, point the test at it.
Sharing Avro with TOML-Native Teams
You are explaining a data shape to a team that does not speak Avro fluently but reads TOML every day. TOML's sub-table headers make the nesting visually obvious, which is often a faster on-ramp than handing them a JSON wall.
Common Questions
Will the round-trip preserve all the data?
Mostly yes. TOML has fewer types than JSON: there is no null, for instance, so nulls are written as empty strings. If you need lossless round-tripping, JSON or Avro itself is the safer carrier; TOML is great for human-edited configs but not designed as a serialization format for arbitrary data.
How are mixed-type arrays handled?
TOML arrays must be homogeneous, and the converter does not enforce that: it emits whatever was in the JSON. If you have something exotic like [1, "two", true], the resulting TOML may not parse in a strict TOML reader. Avro schemas almost never produce such arrays, so this is rarely an issue in practice.
What does an Avro union look like in TOML?
An Avro union in JSON is encoded as either a bare value (for the resolved branch) or {"type": value}. The converter treats those exactly as the JSON shows them: TOML cannot represent the union type itself, only whichever branch was resolved at the time of encoding. See the unions section of the spec.
Is the data sent to a server?
No. The TOML text is assembled in this tab from the object your browser parsed, so config values and internal hostnames in the record stay on your machine.
Why does my key look weird in the TOML output?
Keys with special characters or spaces get JSON-quoted, which produces "weird key" = "value". That is valid TOML: see the keys section of the TOML 1.0 spec. If you want bare keys, the source field names need to be plain identifiers (alphanumerics + underscore + dash).
Can I go from TOML back to Avro?
Not from this page. There is no reliable Avro-from-TOML inference (you would have to know the original Avro types). If you need a JSON form to feed into the JSON to Avro tool, parse the TOML in your script first and emit JSON, then paste that.
Other Avro and TOML Tools
If TOML turns out to be the wrong home for this data, the sibling converters below take the same Avro JSON and give you YAML, XML, CSV or TOON instead: