XML to JSON Converter

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

Source

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

Loading editor...
Status: Invalid XMLCharacters: 268 | Lines: 12

DOMParser is not defined

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.

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.