XML Formatter
Format, indent, and validate XML, in your browser.
Recommended next steps
Related tools
Format, validate, and beautify JSON, in your browser.
Encode text to HTML entities or decode entities back to text.
Test a regular expression against text and see matches and capture groups.
Frequently asked questions
No. Formatting, minifying, and validation all run in your browser with JavaScript. Your XML never leaves the page and isn't sent to a server.
Beautify re-indents your XML with line breaks so the nesting is easy to read. Minify removes the whitespace between tags to produce the smallest single-line output, while keeping text content, comments, and CDATA intact.
It checks structural well-formedness — unclosed tags, mismatched or stray closing tags, and unterminated comments or CDATA — and shows a clear message pointing at the problem. It is not a full schema (XSD/DTD) validator, so it won't verify your XML against a specific document definition.
Yes. In beautify mode you can indent with 2 or 4 spaces, or switch to tab characters. The output updates instantly as you change the setting.
Last updated 2026-06-23.