JSON ↔ XML Converter
Paste JSON or XML on the left and get the other format on the right. Formix detects which one you pasted automatically — or you can pick a direction yourself. Nothing is sent to a server.
Tip. In "Auto-detect" mode, Formix looks at the first character you pasted (“{”/“[” for JSON, “<” for XML) to pick a direction automatically; if the format is ambiguous, choose a direction manually from the dropdown. Because JSON and XML don't model data identically, the conversion follows a fixed, documented convention: a JSON array's repeated values become repeated XML elements with the same tag name, and XML attributes round-trip through a “@attributes” object in the JSON. This means a JSON → XML → JSON round trip won’t always reproduce the exact original shape (for example, top-level arrays get wrapped in a
How to use this tool
- Paste JSON or XML into the input box on the left — the format is detected automatically and the result appears on the right.
- If auto-detection picks the wrong format, open the "Conversion direction" dropdown and choose JSON → XML or XML → JSON manually.
- If the input isn't valid JSON or XML, you'll get an approximate line/column for where the problem is.
- Use the indent-size dropdown to control how the converted output is pretty-printed, then "Copy" or "Download result" to grab it.
- "Copy minified" copies the converted output with all unnecessary whitespace removed — handy for pasting into config files or API requests.
- Everything happens in your browser — the data you paste is never sent to a server.
Related tips
- JSON object keys become XML element names — keys with spaces or symbols that aren't valid XML tag names are sanitized automatically.
- A JSON array like ["a", "b"] converts to two sibling elements with the same tag name (not a single element containing a list), since XML has no native array type.
- When converting XML that has attributes (e.g.
), they appear under an "@attributes" key in the resulting JSON so no information is lost. - Need to also validate or pretty-print your JSON or XML on its own? Try the dedicated JSON Formatter or XML Formatter tools linked below.