XML Formatter
Format, beautify, and validate XML with proper indentation and syntax highlighting. Free online tool, no signup needed.
Preparing private browser tool…
Frequently asked questions
- Does this validate XML against a schema?
- No. It performs structural beautification only. Use a dedicated XSD or DTD validator for schema checks.
- Can I minify XML too?
- Yes. Switch to Minify to strip whitespace between tags and produce a single-line result.
- Are CDATA sections preserved?
- Inline text content is preserved as-is. For complex XML, verify the output before using.
- What indentation can I choose?
- Two or four spaces. The declaration, comments, and doctype lines are indented at the current depth, and self-closing tags do not open a new level.
- What does it treat as an error?
- Only an unclosed angle bracket. It walks tags rather than building a tree, so mismatched or wrongly nested elements are re-indented without complaint. Use a real validator before shipping a document.