XML Formatter

Prettify raw or minified XML with consistent indentation and line breaks, or minify well-formatted XML to remove all unnecessary whitespace. Choose from 2-space, 4-space, or tab indentation. Invalid XML is detected and flagged with the error location before any formatting is applied, so you always get valid output.

All processing happens in your browser. No data is sent to any server.

Frequently Asked Questions

Can it both prettify and minify XML?
Yes — choose Prettify to add indentation and line breaks, or Minify to strip all unnecessary whitespace for a compact output.
What indentation options are available?
Two-space, four-space, and tab indentation are all available.
Does it validate the XML before formatting?
Yes — invalid XML triggers an error message with the approximate location of the problem before any formatting is applied.

Related Tools