XML Formatter
Paste your XML to pretty-print, minify, or validate it instantly β all in your browser, nothing ever uploaded.
π How it works & FAQBeautify, minify, and validate XML in one place
XML is everywhere β RSS feeds, SVG files, sitemaps, Android layouts, SOAP responses, config files, and countless data exports. But raw XML often arrives as one giant unreadable line, or with messy, inconsistent indentation. This XML Formatter cleans it up instantly. Beautify reflows your markup with tidy, nested indentation so the structure is obvious at a glance. Minify strips the whitespace between tags to shrink the file for transport or storage. Validate parses your document with the browser's built-in DOMParser and tells you whether it is well-formed.
Private by design
Everything runs as plain JavaScript inside your browser tab. Your XML is never uploaded to a server, logged, or stored β close the page and it's gone. That makes it safe for API payloads, invoices, or any data you'd rather not send to a third party.
How to use it
- Paste or type your XML into the Your XML box.
- Pick an indent width β 2 spaces, 4 spaces, or a tab.
- Click Beautify to pretty-print, or Minify to compress it to a single line.
- Click Validate anytime to check that the document is well-formed.
- Use Copy result to grab the formatted output.
FAQ
- What does "well-formed" mean?
- It means the XML follows the basic syntax rules: every tag is closed, tags nest correctly, and special characters are escaped. This tool checks well-formedness with DOMParser. It does not validate against a DTD or XSD schema.
- Why did I get a parser error?
- Common causes are a missing closing tag, mismatched tag names, more than one root element, or an unescaped & or < character in text. The error message points to the spot the parser choked on.
- Is my data uploaded anywhere?
- No. All formatting and validation happen locally in your browser. Nothing leaves your device.
- Does beautify change my data?
- It only adds or removes whitespace between elements to reindent the structure. Your tags, attributes, and text content stay intact.