How it works
How to use the JSON to XML
Paste JSON
Or switch to XML → JSON and paste XML instead.
Set the root element
Choose the root tag name and indentation, and whether to include an XML declaration.
Copy or download
The output updates instantly; download it as a .xml or .json file.
Mapping rules
- Object keys become elements; invalid XML names are sanitized (e.g.
first name→first_name). - Arrays become repeated elements with the same tag name.
- Keys starting with
@become attributes, and#textbecomes element text. - Special characters are escaped (
&,<,"). - XML → JSON groups repeated child elements into arrays and can convert numeric and boolean text into JSON types.
Built for developers
Why developers use it
Private by design
Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.
Instant results
Output updates as you type, with precise error locations when something is wrong.
Works offline
Once loaded, the tool keeps working without a connection. Install it as an app if you like.
Free, no sign-up
No accounts, no limits, no watermarks.
FAQ
Frequently asked questions
How are XML attributes represented in JSON?
As keys prefixed with "@", for example <book id="7"> becomes {"book": {"@id": 7}}. The same convention works in reverse.
Why did an element turn into an array?
When a tag repeats inside the same parent, its values are collected into an array, because JSON objects cannot contain duplicate keys.
Is my data uploaded anywhere?
No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.
Keep going
Related tools
- XML to JSONConvert XML to JSON and back
- JSON to CSVConvert JSON arrays to CSV and CSV back to JSON
- JSON to YAMLConvert JSON to YAML and YAML to JSON
- YAML to JSONConvert YAML to JSON and back
- TOML to JSON ConverterConvert TOML to JSON and back
- JSON to StringConvert JSON into a string literal
- XML to JSON SchemaGenerate JSON Schema from XML
- JSON FormatterFormat, validate and explore JSON