XML Formatter

Turn minified or messy XML into cleanly indented, readable markup

Input

Formatted output

Nothing you paste here is ever uploaded, formatting happens entirely in your browser.

About this tool

This formatter takes XML that's been minified, exported without whitespace, or otherwise squashed onto a handful of lines, and re-indents it so the element nesting is visible at a glance. It works by walking the tag boundaries and tracking open/close pairs to compute indentation, a fast, lightweight approach rather than a full validating XML parser, so it won't catch every kind of malformed markup, but it handles the vast majority of real-world XML (API responses, config files, RSS feeds, SOAP payloads) cleanly.

Does this validate that my XML is well-formed?

No, this is a formatting tool, not a validator. It re-indents based on tag patterns without fully parsing the document tree, so severely malformed XML (mismatched or unclosed tags) may format unpredictably rather than throwing a clear error.

How does it handle self-closing tags like <br/>?

Self-closing tags are recognized and don't increase the indentation level for what follows, since there's no matching closing tag to account for, they're placed on their own line at the current indent depth, same as any other element.

Will formatting change the actual data in my XML?

No, only whitespace between tags is changed. Element names, attributes, and text content are preserved exactly as you entered them; the tool simply adds line breaks and indentation to make the structure readable.