XML Formatter and Validator
XML is still everywhere: sitemaps, RSS feeds, SOAP and banking APIs, Android layouts, e-invoice and GST data exchanges, and configuration files. When it arrives on a single line, finding the element you need is painful.
Paste XML to indent it neatly, minify it for sending, or validate it. The tool uses your browser's own XML parser, so broken XML is reported with the parser's error message instead of being silently reformatted.
Format, minify and validate
- Format parses the XML and writes each element on its own line with two-space indentation, keeping the XML declaration, attributes, comments, CDATA sections and processing instructions.
- Minify removes whitespace between tags and strips comments, for the smallest file.
- Validate checks that the XML is well-formed: every tag closed, properly nested, attributes quoted, one root element.
Well-formed is not the same as valid against a schema
The validator checks XML syntax. It does not check the document against an XSD schema, so a well-formed file can still be rejected by a system that expects particular elements. Use the schema provided by that system, for example the GST e-invoice schema, for full validation.
How to use this tool
- Paste your XML: From a file, API response or feed.
- Choose an action: Format, Minify or Validate.
- Read any error: The parser's message points to the problem.
- Copy or download: Save the result as an .xml file.
Features
- Indentation with the browser's XML parser
- Minify, removing whitespace and comments
- Well-formedness validation with error messages
- Copy and download as .xml
Worked examples
A one-line sitemap
A sitemap.xml arrives as a single long line.
Result: Format shows each <url> with its <loc> and <lastmod> on separate, indented lines, so you can check the dates quickly.
A broken API response
An XML payload has a <name> tag that is never closed.
Result: Validate reports the mismatched tag instead of producing misleading output.
Who it is for
- Developers: Read SOAP, RSS and API payloads.
- SEO specialists: Check sitemaps and feeds.
- Finance and tax teams: Inspect XML exports from accounting and e-invoicing systems.
Tips
- Validate before formatting when an XML file comes from an unknown source.
- Keep a formatted copy for reading and send the minified one.
- Remember that minifying removes comments.
Frequently asked questions
Does it check my XML against a schema?
No. It checks that the XML is well-formed. Validate against the relevant XSD schema in the receiving system for full checks.
Is my XML uploaded?
No. Formatting and validation happen in your browser.
Why did minifying remove my comments?
Minify strips comments along with whitespace to make the file as small as possible. Use Format to keep them.