JSON → XML Converter
JSON Input
Tab inserts an indent. Press Escape, then Tab, to move focus out of the editor.
XML Output
Why use a private JSON to XML converter?
Many enterprise systems, legacy APIs, and config formats still require XML as input. This converter transforms your JSON to well-formed XML entirely in your browser using fast-xml-parser. Your data never leaves the tab.
How it works
The JSON is parsed and passed to XMLBuilder, which maps JSON keys to XML elements. Keys starting with @ become element attributes, and #text becomes the text content of a mixed element. The output includes an XML declaration and is indented for readability.
XML requires a single root element. If your JSON object has multiple top-level keys, they are automatically wrapped in a <root> element. JSON arrays of objects produce repeated sibling elements with the same tag name.
Common use cases
- Building SOAP request bodies from a JSON payload for legacy enterprise APIs
- Generating Android XML resource files (strings.xml, layout attributes) from JSON config
- Producing Maven pom.xml structures from a JSON dependency manifest
- Converting JSON API responses to XML for systems that only accept XML input
- Generating RSS or Atom feed XML from a JSON content source
- Preparing XML fixtures for testing XML parsers and deserializers
Frequently asked questions
- Is it safe to convert JSON that contains credentials or sensitive data?
- Yes. fast-xml-parser runs entirely in your browser — your JSON is never sent to any server. You can verify this in DevTools → Network.
- How do I produce XML attributes from JSON?
- Prefix any JSON key with "@" and it will be serialized as an XML attribute. For example, { "item": { "@id": 1, "#text": "hello" } } produces <item id="1">hello</item>.
- What happens if my JSON has multiple top-level keys?
- XML requires a single root element. If your JSON object has more than one top-level key, the converter automatically wraps them in a <root> element and shows a warning.
- Can I convert a JSON array to XML?
- Not directly — XML has no concept of a bare array root. Wrap the array in an object first: { "items": [ ... ] }. Each array item will become a repeated <items> child element.