What is JSON / XML Converter?
JSON and XML Converter uses explicit mappings: attributes live under @attributes, element text under #text, and repeated sibling elements become arrays. DTD and entity declarations are rejected to reduce external-entity risk. Comments, mixed content, and namespace details that cannot round-trip perfectly are clearly identified. Common workflows include the following. Create simple XML requests for a legacy integration. Convert structured XML into JSON for frontend processing. Understand how attributes, text, and repeated elements map between formats. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.
When to use it
- Create simple XML requests for a legacy integration.
- Convert structured XML into JSON for frontend processing.
- Understand how attributes, text, and repeated elements map between formats.
How to use it
- Paste JSON with one root key, or an XML document.
- Choose the conversion direction.
- Review mapping warnings before copying or swapping the result.
- Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.
- Review the output, status message, and documented limits; copy, download, or continue only after the result matches your expectation.
Runnable examples
The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.
Example 1
{"catalog":{"@attributes":{"lang":"en"},"tool":[{"@attributes":{"id":"21"},"#text":"Case converter"},{"@attributes":{"id":"22"},"#text":"Letter case tool"}]}}Example 2
<release version="1.5"><tools><tool id="19">Line deduplicator</tool><tool id="20">Regex tester</tool></tools><ready>true</ready></release>Input rules
- JSON-to-XML input must contain exactly one root key.
- XML must be well formed and cannot contain DTD or ENTITY declarations.
- Complex mixed content, instructions, and namespaces require manual review.
- Text input is counted before processing and is limited to 1,000,000 characters on this page; file modes apply the separate file limit shown in the workspace.
- JSON to XML requires exactly one root object key.
Output rules
- Attributes map to @attributes and text maps to #text.
- Repeated sibling elements become arrays.
- Output is formatted, but complex XML is not guaranteed to round-trip without loss.
- Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
- Mixed #text and child elements are rejected in the JSON-to-XML direction.
Limitations and cautions
- JSON to XML requires exactly one root object key.
- Mixed #text and child elements are rejected in the JSON-to-XML direction.
- Comments, processing instructions, prefixes, and some namespace semantics are not preserved.
How your data is handled
XML parsing and conversion happen locally and do not load external entities or remote resources.