JSON ↔ XML converter
Convert JSON to XML or XML to JSON locally. Supports attributes, text and repeated elements while rejecting unsafe entity declarations.
Paste either format, then choose a direction.
Private · browser only
Your data stays in this browser. Nothing is uploaded.
Conversion directions
Direction 01
JSON to XML
Create XML from JSON using @ attributes and #text values.
Direction 02
XML to JSON
Parse safe XML into JSON with predictable attribute and array mapping.
About this converter
Converting JSON to XML
JSON objects become XML elements, object keys become element names, and arrays become repeated child elements. To express XML attributes, the converter follows the @-prefix convention: a key named @id becomes an attribute id on the element, while #text sets the element's text content.
This mapping keeps the conversion lossless and reversible, so you can round-trip between JSON and XML without dropping metadata.
Safe XML parsing
The parser rejects dangerous constructs such as external entity declarations (XXE) and document type definitions, which are a common source of XML security vulnerabilities. Only well-formed elements, attributes and text are accepted, so untrusted input cannot reach the file system or the network.
JSON vs XML for data exchange
XML is still required by SOAP services, legacy enterprise systems and many document standards. JSON is lighter and dominates modern APIs. Converting between them lets an XML-based system consume JSON payloads and vice versa without manual rewriting.
Frequently asked questions
How are XML attributes represented in JSON?
Attribute names use an @ prefix, text uses #text and repeated elements become arrays.
Does the XML parser load external entities?
No. DOCTYPE and ENTITY declarations are rejected before parsing.
Is it safe against XXE attacks?
Yes. The parser rejects external entity declarations and document type definitions, so untrusted input cannot access the file system or network.
Does it support repeated elements as arrays?
Yes. Repeated child elements with the same name are mapped to a JSON array, and single elements map to an object.
Can I round-trip between JSON and XML?
Yes. Using the @ attribute and #text conventions, data converts back and forth without losing metadata or structure.