JSON to XML Converter
Keys become elements, arrays become repeated elements.
This tool converts JSON into indented XML for systems that still speak XML: SOAP services, RSS and sitemap feeds, enterprise integrations and legacy configuration files. Object keys become element names and arrays become repeated elements with the same name.
To produce XML attributes, prefix a key with @_. For example {"item": {"@_id": 7}} becomes <item id="7"/>.
How to use it
- Paste a JSON object into the left editor.
- Review the XML on the right.
- Copy or download the XML document.
Questions
Why is my output wrapped in a root element?
XML requires exactly one root element. If your JSON is an array, a primitive or an object with more than one top-level key, it is wrapped in a <root> element to keep the document well formed.
How do I create attributes?
Use keys that start with @_. They are written as attributes on the parent element instead of child elements.
Are all JSON keys valid XML element names?
No. XML names cannot start with a digit or contain spaces. Rename such keys before converting.
All tools
- JSON Formatter
- JSON Validator
- JSON Minifier
- JSON Repair
- JSON Diff
- JSON Schema Validator
- JSON to YAML
- YAML to JSON
- JSON to CSV
- CSV to JSON
- JSON to XML
- XML to JSON
- YAML Formatter
- XML Formatter
- JSONL Validator
- JSON to TOON
- LLM Token Counter
- LLM Token Optimizer
- JSON to TypeScript
- JSON Schema Generator
- LLM Tool Schema Generator