Data & JSON
XML ⇄ JSON
Convert XML to JSON and JSON to XML locally with attribute, text, repeated-node and array mapping. Includes optional quote escaping, copy and download. No uploads.
About this tool
Convert XML to JSON and JSON to XML in one workspace. Attributes use a - prefix, text uses #text, and repeated child elements become arrays for API debugging, configuration migration and sample preparation.
JSON arrays generate repeated XML elements, while -prefixed object keys become XML attributes. Special text characters are escaped correctly, with optional conversion of double quotes to ".
Best use cases
- Turn XML API responses into JSON for frontend debugging or test fixtures.
- Convert JSON configuration or object arrays into XML and inspect tags, attributes and nesting.
- Draft migrated data structures for review by developers or testers.
How to use it
- Paste JSON on the left or XML on the right, or load the examples.
- Choose JSON → XML or XML → JSON to update the other editor.
- Review attributes, text and array mappings, then copy or download the result.
Scope and limits
- Up to 200,000 characters, 40 nesting levels and 20,000 nodes per conversion.
- The top-level JSON value must be an object; XML attribute values must be strings, numbers, booleans or null.
- DTD and entity declarations are not supported, and XML names must follow XML naming rules.
Data processing
Parsing, conversion, copying and downloading run entirely in your browser. Input is never uploaded, stored or executed.
FAQ
How are XML attributes and text represented?
Attributes use a - prefix, so id="7" becomes "-id": "7". Element text uses #text, and empty elements without attributes or children are preserved as empty strings.
Are repeated XML elements lost?
No. Child elements with the same name are grouped into arrays. JSON arrays become repeated XML elements with the same tag name.
Is any data uploaded?
No. XML parsing and JSON generation run entirely in the current browser without backend requests.