XML Formatter & Validator
Pretty-print or minify XML (and SVG or RSS), and check it is well-formed: matching tags, a single root, quoted attributes and valid & entities, with the line and column of any error.
Free, no sign-up
Saved on your device only
Works offline after first open
The tool
Loading the tool…
How to use
- Paste XML or open an .xml or .svg file.
- You see right away whether it is well-formed; any error shows its line and column.
- Choose Format or Minify, then copy or download the result.
Privacy & how it works
Saves your data in this browser only (back it up or delete it from “My data”).
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
Frequently asked questions
What does well-formed mean?
Every opened tag is closed with the same name in order, there is a single root element, attributes are quoted and not repeated, and & is written as & or a valid entity. This is not DTD or XSD schema validation, which the tool does not do.
Why are some elements not split onto lines?
An element containing both text and tags (mixed content) is kept as is, because adding whitespace inside it could change its meaning.
Does it work with SVG, RSS and sitemaps?
Yes, they are all XML. Just make sure the file has no HTML-style mistakes such as an unclosed <br>.
Related tools
HTML Formatter & MinifierBeautify HTML with clear indentation or minify it for production: removes comments and extra whitespace, keeps pre and textarea intact, and safely compacts inline CSS and JS. Fully local.JSON Formatter & ValidatorPretty-print JSON or minify it to one line, sort keys alphabetically, validate it with the exact line, column and cause of any error, or escape and unescape JSON strings.SQL Formatter & MinifierFormat SQL queries for MySQL, PostgreSQL, SQL Server, SQLite and more, with keyword case and indentation options, or minify them to one line without comments.Hex ViewerOpen any file and see its bytes in hex with offsets and the matching text, even multi-gigabyte files. Jump to an offset, search for text or bytes, and identify the real file type from its signature.