Paste the XML content into the input area. Press the format button to apply two-space indentation.
What this tool does
Format XML using two-space indentation to make nested elements easier to read and check the document for syntax errors.

How to use it
- Paste the XML content into the input area.
- Press the format button to apply two-space indentation.
- Run the formatter and review the formatted XML output or any error message.
- Copy the result into your editor or document.
Supported input and notes
Invalid XML cannot be formatted. Check closing tags, properly nested elements, and quotes around attribute values if an error appears.
When it is useful
Useful when reviewing nested XML elements, inspecting configuration files, or copying a more readable XML document for debugging.
Make XML Easier to Read
Add line breaks and indentation to XML so nested tags and matching open/close tags are easier to follow.
Two-Space Indentation
The formatter uses two spaces for each nesting level. There is no setting for a different indentation width.
XML Is Checked First
If the XML cannot be parsed, such as when required closing tags are missing, the tool shows an error instead of formatting it.
Original Spacing Is Rebuilt
Whitespace between tags is normalized before new indentation is added. Original indentation and blank lines between tags are not preserved as-is.
XML Stays XML
This page formats XML only. It does not convert the data to JSON, CSV, or another format.
No Minify Option
This formatter does not include an XML minify mode or adjustable indentation width. The formatted result can be copied after processing.
FAQ
Can I change the indentation width?
No. It is fixed at two spaces.
Can I minify XML to one line?
No. This XML formatter does not have a minify option.
Does it automatically fix invalid XML?
No. Invalid XML is reported as an error.