Input

Output

What is the Avro to XML Converter?

Avro is JSON; XML is XML. Sometimes a downstream system speaks one and your data lives as the other. This tool bridges that — paste an Apache Avro schema (.avsc) or a JSON-encoded Avro record on the left, and the right panel emits well-formed XML following the W3C XML spec.

Element names come from your field names — so an Avro orderId becomes <orderId>. The root element uses the schema's name when present (so a record named Order wraps the document in <Order>), and arrays become repeated child elements. Special characters in values are escaped per XML 1.0 section 2.4&, <, >, and " all get the entity treatment so the output stays parseable.

Conversion runs in your browser. No data leaves the page.

How to Use It

Three steps. The buttons listed below are the actual buttons on this page.

1

Paste, Upload, or Load a Sample

Drop an Avro schema or JSON-encoded record into the left Input. Upload handles .avsc / .json files; Sample loads a realistic Order schema with nested items, an enum, and an optional address. Quick example of minified input:

{"type":"record","name":"Order","fields":[{"name":"orderId","type":"string"},{"name":"totalCents","type":"long"}]}

Both .avsc schemas and JSON-encoded Avro records work. They are both JSON, per the Avro 1.11 spec.

2

Read the XML Output

The right Output panel emits an XML 1.0 declaration followed by your converted document. Field names map to element names; nested records become nested elements. Output refreshes 300 ms after you stop editing — no Convert button.

3

Copy or Download

Use Copy for a quick paste, or Download to save as output.xml. Parsing uses native JSON.parse() — nothing is sent to a server, nothing is stored.

When You'd Actually Use This

Legacy SOAP and Enterprise XML

You have a Kafka topic publishing Avro records, and a downstream system only accepts XML. Convert here, feed the XML in. Beats hand-writing a transformer.

XSD Mockups

Designing an XSD against an Avro schema shape? Paste the schema, get a sample XML document, then sketch the XSD around the actual element tree.

Quick Cross-format Inspection

Same data, two formats. Sometimes a structural problem in an Avro record is more obvious in XML, where every field has a closing tag and arrays repeat their parent.

XML-only Test Fixtures

Some test frameworks only consume XML fixtures. If your source-of-truth is Avro, this gives you a one-paste path to a usable XML fixture without writing custom serializers.

Common Questions

Does the output validate against XSD schemas?

It produces well-formed XML (per XML 1.0) but not validated XML. There is no XSD generation here — the converter does not know your target schema. If you need XSD-conformant output, use this tool to get the shape, then tweak by hand or run through an XSLT.

How are field names that contain dots or special characters handled?

XML element names are restricted — they cannot start with a digit or contain spaces, dots, or most punctuation. Any character outside [A-Za-z0-9_-] in a field name is replaced with an underscore in the resulting tag. The original name is not preserved in the XML, since invalid element names would break parsers.

What about XML attributes vs elements?

Everything becomes an element. Avro records do not distinguish "attribute" from "child" the way XML does, so there is no clean automatic mapping. If you need attributes, post-process with an XSLT or hand-edit.

Are special characters escaped properly?

Yes. &, <, >, and " in string values are escaped to &amp;, &lt;, &gt;, and &quot; respectively. That keeps the output parseable by any compliant XML parser.

Is my data sent anywhere?

No. The whole conversion runs in your browser. There is no API call, no logging, no telemetry on input or output.

Why is the root element named "Order" sometimes and "avro" other times?

If the input has a top-level name field (Avro schemas do — record types require it), the converter uses that as the root tag. Otherwise the root is the generic <avro>. Most schemas hit the named branch.

Other Avro and XML Tools

Once you have the XML, these tools handle the rest: