JSON to XML
NewConvert JSON data to XML markup with configurable root and pretty-printing.
Frequently Asked Questions
Why did my `users` array turn into repeated `<user>` nodes?
For arrays inside objects, the tool singularizes the element name by trimming a trailing `s`. A top-level array is wrapped in your chosen root element and each child becomes `<item>`.
Can I change the root element or remove the XML declaration?
Yes. The root tag is editable, and there is a separate toggle for adding or removing `<?xml version="1.0" encoding="UTF-8"?>`.
Why were some tag names changed with underscores or a leading underscore?
Element names are sanitized before output. Invalid characters are replaced with `_`, and names that do not start with a letter or underscore get prefixed so the generated XML stays well-formed.
Does this tool create XML attributes from JSON keys?
No. Everything is emitted as elements, not attributes. Even simple scalar properties become `<key>value</key>` nodes.
Why does the output sometimes come as one line and sometimes indented?
That is controlled by the pretty-print checkbox. When it is on, the tool adds two-space indentation and newlines; when it is off, it compacts the XML.