JSON to XML Converter
Convert JSON to XML and XML to JSON online. Free, validated, no signup.
Tool Interface
JSON input
XML input
Output
How to use & conventions
- Pick a direction, paste your input, and press convert.
- Copy the result or download it as a file.
- JSON → XML: keys starting with
@become attributes ("@id": "1"→id="1"); the special key#textbecomes element text; arrays become repeated elements. - XML → JSON: attributes are restored as
@-prefixed keys and mixed text as#text, so round-trips stay faithful. - Element names are sanitized to valid XML names automatically.
100% private — conversion runs in your browser. Nothing is uploaded or stored.
Rate this tool
About This Tool
Convert Between JSON and XML Both Ways
The JSON to XML Converter translates data between JSON and XML in either direction. Pick JSON to XML or XML to JSON, paste your input, set the root element name for XML output, and press convert. Copy the result or download it as a file.
Smart conventions keep round trips faithful: keys starting with @ become XML attributes, the special #text key becomes element text, and arrays become repeated elements. Converting back restores @ prefixed keys and #text, and element names are sanitized to valid XML automatically. Conversion runs 100 percent in your browser. Nothing is uploaded or stored. The tool is free and needs no signup.
How to Use the JSON to XML Converter
Three steps to converted data.
- Pick a direction: Choose JSON to XML or XML to JSON.
- Paste your input: Drop in the JSON or XML. For JSON to XML, set the root element name and the XML declaration option.
- Convert and save: Press convert, then Copy the result or Download it. Click Sample to try it instantly.
Conversion Conventions
- Attributes: JSON keys starting with @ become XML attributes.
- Text content: The special #text key becomes element text.
- Arrays: JSON arrays become repeated XML elements.
- Round trips: Converting back restores @ keys and #text faithfully.
- Safe names: Element names are sanitized to valid XML automatically.
Key Features
- Both directions: JSON to XML and XML to JSON in one tool.
- Attribute mapping: @ keys translate cleanly to attributes.
- Custom root element: Name the top level XML element yourself.
- Download ready: Save the converted output as a file.
- Private by design: Everything runs in your browser. Nothing is uploaded or stored.
Frequently Asked Questions (FAQ)
Is the JSON to XML Converter free? Yes. It is completely free with no signup.
How do I make an attribute? Start the JSON key with @. An @id key becomes an id attribute on the XML element.
What is #text for? It holds the text content of an element when the element also has attributes.
Can I convert XML back to JSON? Yes. Switch to the XML to JSON tab for the reverse conversion.
Are my files uploaded? No. Conversion runs entirely in your browser.
What if my JSON keys are not valid XML names? Element names are sanitized automatically so the output stays valid.
More Developer Tools
Convert to YAML with the JSON to YAML Converter, format code with the JSON Formatter, and explore the developer tools.