We use essential cookies to make this site work. Optional analytics cookies help us improve your experience. Privacy Policy
XML Formatter & Minifier
Beautify or minify any XML — SOAP, RSS, SVG, sitemap, KML. Browser-based parser, no upload. Free and private. 100% free, private, and browser-based — no.
How to use
Paste XML — Drop in any XML string — config, SOAP, RSS, SVG, sitemap.
Choose Mode — Beautify with 2/4/tab indent, or minify into one line for transport.
Copy or Download — Copy the result with one click or save as a .xml file.
The XML Formatter beautifies messy single-line XML into readable, indented form — or minifies it into compact one-line output for transport. Built on the browser's native DOMParser, it works for any well-formed XML: SOAP responses, RSS feeds, sitemaps, SVG, KML, OpenDocument, plist, and custom dialects.
Why format XML?
Debugging — reading nested SOAP responses or RSS payloads is painful when collapsed.
Code review — clean indentation makes structural changes obvious.
Minify for transport — strip whitespace before embedding in URLs or APIs.
Learning — see the true tree structure of unfamiliar XML.
How it works
The browser's DOMParser validates the XML and surfaces any error. A simple regex-based pretty printer re-indents the tree using your chosen indent width. Minify mode collapses whitespace between tags.
Privacy
Everything runs locally in your browser. Confidential configuration files, signed SAML assertions and private RSS feeds never leave your device.
are escaped or in CDATA. Well-formedness is a hard pass/fail — the parser refuses to continue on a violation. Valid XML additionally conforms to a DTD or XSD schema; this tool checks well-formedness only." }} />
Indentation and Attribute Layout
Frequently asked questions
What XML does this support?
Any well-formed XML 1.0 / 1.1 — including SVG, RSS, Atom, SOAP, sitemap, KML, plist, OpenDocument, and custom dialects. Parsing uses the browser's built-in DOMParser.
How is validity checked?
The browser's DOMParser surfaces any syntax error (unclosed tag, missing quote, illegal character). The exact reason is displayed under the input.
Are namespaces preserved?
Yes. Beautifying only changes whitespace — element prefixes, xmlns attributes and CDATA sections stay intact.
Will minifying break my XML?
Minifying collapses whitespace between tags. If your XML carries significant whitespace inside text nodes (rare), prefer the beautify mode or keep the original.
Related free tools
XML to JSON Converter — Parse any well-formed XML into a clean JSON tree with attributes and arrays.
JSON to XML Converter — Convert JSON to well-formed XML — supports attributes, custom root, declaration.
CSV Viewer — Open CSV or TSV files in your browser — sort, search, paginate, export filtered view.
JSON to CSV Converter — Convert JSON data to CSV format. Export to spreadsheets easily.
CSV to JSON Converter — Convert CSV data to JSON format. Useful for API development.
JSON Formatter — Format, beautify, or minify JSON with customizable indentation.
JSON Validator — Validate JSON syntax and find errors with line and column numbers.
HTML Minifier — Compress HTML by removing comments, whitespace, and line breaks.
CSS Minifier — Minify CSS by stripping comments, whitespace, and unnecessary characters.
JavaScript Minifier — Compress JavaScript by removing comments, whitespace, and empty lines.
Base64 Encoder/Decoder — Encode text to Base64 or decode Base64 back to text. UTF-8 support.
URL Encoder/Decoder — Percent-encode text for URLs or decode encoded URLs back to text.