XML Formatter & Beautifier — Indent, Minify and Check
Format messy XML with proper indentation, or minify it back down, with well-formedness checked.
To format XML, paste it in and it is re-indented with each element on its own line — except elements holding only text, which stay on one line because splitting them across three is what makes formatted XML unreadable. The document is parsed by your browser's own XML parser first, so anything not well-formed is reported with its line and column rather than silently mangled.
Runs in your browser- Privacy
- Runs entirely in your browser — nothing is uploaded
- Cost
- Free, unlimited, no sign-up
Frequently asked questions
Why does formatting change my document?
What is the difference between well-formed and valid XML?
Why does my XML fail on an ampersand?
How to use the xml formatter
- 1Enter or paste your xml.
- 2Choose the mode.
- 3Choose the indentation.
- 4Turn "Collapse empty elements to self-closing tags" on or off as needed.
- 5The result appears immediately — copy or download it.
Embed this tool
Put the working xml formatter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.
Share this tool
Related tools
XML ValidatorCheck XML is well-formed, with the exact line and column of the first error and a document summary.Data Format ConverterConvert between JSON, YAML, XML, CSV, TSV and TOML in any direction, locally in your browser.Excel to XML ConverterExport spreadsheet rows as XML with safe element names.PDF to XML ConverterExport PDF page layout into structured XML with per-line coordinates.XML Sitemap GeneratorTurn a list of URLs into a valid XML sitemap ready to submit to search engines.HTML to XML ConverterConvert HTML into well-formed XHTML that an XML parser will accept.
Last updated
More data & format tools