Convert JSON to XML or XML to JSON locally, with attributes, text nodes, repeated elements, and arrays mapped both ways.
Related
JSON rarely lives alone. Convert between JSON and YAML/CSV/XML, decode JWTs, generate types, and validate against JSON Schema — every step staying in the browser.
XML needs a single root and represents lists as repeated elements. Map @-prefixed keys to attributes and #text to element text for a reversible conversion.
Object keys like name, active, and profile must be quoted in valid JSON, even when the key looks like a normal identifier.
Paste JSON and click To XML, or paste XML and click To JSON. The converter maps attributes to @-prefixed keys, element text to #text, and repeated elements to arrays — and reverses all of it. Everything runs in your browser; no data is sent to any server.
<note id="1"> becomes { "note": { "@id": "1" } }#text<tag> siblings become a JSON array&, <, and numeric references are decoded/encoded both waysFor the details behind each direction, see XML to JSON Conversion and JSON to XML. If your JSON has syntax errors, the tool repairs common mistakes first — or clean it with JSON Fix.
When you paste XML and click To JSON, the converter parses the document first — so it works as an xml formatter, xml formatter online, xml formatter online tool, xml beautifier ( xml beautify), xml editor, xml parser, xml reader online, xml viewer online / online xml viewer, reader xml, xml file validator, and xml validator (xmlvalidate, xmllint online validator) in one step — a one-stop answer to what is a xml file and how to open or check one. Searches for format xml online, online xml formatter, xml pretty print, xml validation, validation of xml, or xml to json converterall land on the same workflow. Malformed XML (mismatched tags, missing quotes, stray characters) is reported in the status bar instead of being silently passed through. If you only want to format XML, click To JSON to validate, then To XML to round-trip back with consistent two-space xml indentation online.
How to open an XML file (also asked as how to open the xml file or how to open xml files in bulk): paste the contents here and click To JSON for a structured, indented view. The same flow works as a valid xml checker — the converter only succeeds when the input is well-formed XML. Searches in other languages — formatar xml online (Portuguese), formatador xml online — describe the same tool.
Prefix the key with @ (for example @id). Element text content goes under #text. JSON arrays become repeated elements with the same tag name, because XML represents lists as repetition.
Yes — paste XML and convert it to JSON for a structured, indented view, or convert back to XML to see the document re-emitted with normalised whitespace. Both directions are local-only.