XML to JSON Converter
Convert XML documents to JSON with control over attributes, text keys, arrays and value parsing.
Open toolPretty-print or minify XML while keeping comments, CDATA and declarations intact, with exact line and column validation errors.
The XML is validated first; if it isn’t well-formed you get the line, column and reason (for example a mismatched closing tag). Valid XML is re-indented with 2 spaces, 4 spaces or tabs, keeping the XML declaration, DOCTYPE, comments, CDATA sections, processing instructions and attribute quoting exactly as written. Elements containing only text stay on one line, and elements marked xml:space="preserve" are copied verbatim.
Minify mode removes indentation and whitespace-only text between tags, and can optionally strip comments. Entities are never expanded and external entities are never fetched, so formatting untrusted XML is safe. Everything runs in your browser. Your data is never uploaded, logged or stored.
Your code or text
XML
Processed in this browser
Instant, in-browser. Nothing is uploaded.
Your result
Ready to download or copy
Paste your XML.
Choose Format (and the indentation) or Minify.
Fix any reported error, then copy or download the result.
Zero-upload architecture
Free, with no sign-up or watermark · Your files stay on your device
Launch the app and add your file. There is nothing to install and no account to create.
Choose Format (and the indentation) or Minify.
Fix any reported error, then copy or download the result.
Convert XML documents to JSON with control over attributes, text keys, arrays and value parsing.
Open toolBeautify HTML with configurable indentation, line wrapping and attribute layout, without ever rendering or running it.
Open toolPretty-print, beautify and validate JSON with precise error locations, key sorting and custom indentation.
Open toolEdit, validate, format and explore JSON with a code editor, tree view and table view, then convert it to CSV, YAML or TypeScript.
Open tool