JSON ↔ XML Converter
Convert JSON to XML and back, both directions, in your browser. Attributes and text nodes preserved. No upload.
published
- [FREE]
- [NO_SIGNUP]
- [NO_UPLOAD]
A JSON ↔ XML converter translates between the two most common data-interchange formats, both directions, live, in your browser.
How the mapping works
- XML attributes → JSON keys prefixed
@_(<a id="1"/>→{"a":{"@_id":1}}). - XML element text → the
#textkey. - Repeated elements ↔ JSON arrays.
- Nested structure is preserved, so XML → JSON → XML round-trips.
Private by default
Conversion uses fast-xml-parser running entirely in your browser — your data never leaves the page. Malformed XML or JSON is reported with a line number rather than silently mangled.
Related tools
- JSON ↔ YAML · JSON ↔ TOML · JSON to CSV
- JSON Formatter & Validator — pretty-print and lint JSON.
Frequently asked questions
How are XML attributes represented in JSON?
Attributes become keys prefixed with @_ (e.g. <item id="1"> → "item": { "@_id": 1 }), and an element's text content uses the key #text. This is the widely used fast-xml-parser convention and it round-trips cleanly: convert XML → JSON → XML and you get the same structure back.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser with fast-xml-parser — nothing you paste is sent to a server. Open DevTools → Network while converting: zero requests carry your data.
Does it validate the XML?
Yes. Malformed XML (unclosed tags, bad nesting) is reported with the line number instead of producing garbage. Invalid JSON is reported the same way when converting the other direction.
Can it handle repeated elements / arrays?
Yes. Repeated XML elements become a JSON array, and a JSON array becomes repeated elements. Nested structures are preserved both ways.
Why convert JSON to XML at all?
Plenty of enterprise APIs, SOAP services, config formats, RSS/Atom feeds, and document formats (e.g. Office Open XML) still use XML. Converting lets you move data between an XML system and a JSON-based one without hand-editing.