XML to JSON Converter

Paste XML on the left to turn it into JSON you can inspect, copy, and reuse.

Drop a file anywhere · up to 20 MB

Source

Free-form source input. Auto-detect tries JSON first, then XML, then YAML.

Loading editor...
Status: EmptyCharacters: 268 | Lines: 12

Result

Choose the target format for the converted output.

Loading editor...
Status: No outputCharacters: 0 | Lines: 0

Route Notes

Convert XML into JSON while keeping the structure easy to inspect and reuse.

Attributes show up as @name fields, text shows up as _text, and the original root tag is kept in _rootName.

XML Conversion Notes

XML to JSON keeps key XML details visible instead of flattening everything away.

Attributes appear as @name, and direct text appears as _text.

CDATA is preserved as text. Mixed text and child elements cannot be converted because their order would be lost.

The original XML root tag name is preserved as _rootName.

Text-only child elements stay object-shaped, so <note>hello</note> becomes { "_text": "hello" }.

JSON to XML output always uses a fixed <root> wrapper in this MVP.