XML Formatter and Validator
Pretty-print and validate XML with proper indentation.
XML Formatter
Developer tool running locally in browser
What does XML Formatter do?
Format XML with nested indentation so structure is visible at a glance, or minify it for transport. Malformed documents are reported with the position of the problem — unclosed tags, mismatched names and invalid characters.
How to Use XML Formatter
- 1Paste your XMLAny XML document, RSS feed or SOAP envelope.
- 2Choose format or minifyIndent for reading, minify for transport.
- 3Copy the resultOr download it as a file.
Key Features
- Indented output with configurable width
- Minify mode that strips insignificant whitespace
- Well-formedness checking with a readable error message
- Attribute handling that keeps long tags readable
- CDATA sections, comments and processing instructions preserved
Frequently Asked Questions
What does "well-formed" mean?
That the document follows XML syntax: exactly one root element, every tag closed, tags properly nested, attribute values quoted and special characters escaped. It is a lower bar than being valid against a schema.
What is the difference between well-formed and valid?
Well-formed means syntactically correct. Valid means it also conforms to a DTD or schema defining which elements are allowed where. This tool checks well-formedness.
Can it format an RSS feed or sitemap?
Yes — both are ordinary XML. Formatting a sitemap makes it much easier to scan for wrong URLs or missing tags.
Does indentation change the meaning?
It can. XML preserves whitespace inside elements, so adding indentation technically alters mixed-content text nodes. For data-oriented XML this never matters; for document-oriented XML with inline markup, use minify instead.
Input is processed in your browser and never transmitted. That said, treat any web page as untrusted for live production secrets — rotate anything you paste anywhere.
Related Tools
XML Validator
Check XML for well-formedness and locate errors precisely.
JSON Formatter
Format, validate and explore JSON with precise error reporting.
HTML Formatter
Beautify or minify HTML with correct indentation.
YAML Formatter
Tidy and validate YAML with consistent indentation.
