XML Formatter

Indent XML documents while preserving their content.

Runs in your browser Developer Tools Free · No account

Input

Processed locally

This tool runs entirely in your browser. The data you paste or load is never uploaded.

Result

Enter your input, then run the tool.

About this tool

Re-indents an XML document and verifies that tags are balanced. Attribute values and text nodes are left untouched, and the parser reports the first mismatched tag instead of producing a broken document.

How to use it

  1. Paste XML into the input panel.
  2. Choose the indentation width.
  3. Format, then copy or download the indented XML.

Frequently asked questions

Does it add or remove elements?
No. Only whitespace between tags is rewritten; text content inside elements is preserved.
What about the XML declaration?
It is kept on the first line when present. DOCTYPE and comments are preserved as-is.

Keep going

More in this category