Free Online XML Formatter & Validator
Pretty print, validate or minify XML — sitemaps, feeds, SOAP messages and config files.
Tip: Ctrl + Enter to format · Ctrl + K to clear
Formatted XML will appear here.
How it works
- Paste your XML — a sitemap, RSS feed, SOAP response or config file.
- Choose 2 spaces, 4 spaces or tabs for indentation.
- Click Format, Validate or Minify.
- If there is an error, the message shows the line number to fix. Copy or download the result.
Frequently asked questions
What makes XML "well-formed"?
Every opening tag needs a matching closing tag (or must self-close like <br/>), tags must nest properly, attribute values need quotes, and the document must have exactly one root element.
What are the most common XML errors?
Mismatched or unclosed tags, a stray & that should be written as &, unquoted attributes, and two root elements pasted one after another. The validator points to the line where the problem starts.
Does formatting change my data?
Formatting only changes whitespace between tags. Comments, CDATA sections and attribute values are kept exactly as written.
Is my XML sent to a server?
No. Formatting and validation run in your browser, so API responses and configuration files stay private.
Make XML readable in seconds
XML from APIs, exports and sitemaps often arrives as a single long line. This formatter indents every element so the structure is clear, keeps short elements on one line, and leaves comments, CDATA sections and attribute values untouched.
Validate before you ship
Invalid XML breaks feeds, integrations and configuration loading. The validator checks that tags are properly nested and closed, that there is a single root element, and — using your browser's XML parser — that the document is well-formed. Errors include the line number so you can jump straight to the problem.
Minify XML
Minifying removes whitespace between tags and comments, producing the smallest document for transfer or storage. Text inside elements is kept, with runs of spaces collapsed.
Common uses
- Reading SOAP and REST API responses
- Checking XML sitemaps and RSS or Atom feeds
- Tidying Android layouts, Maven POM files and .NET config files
- Inspecting SVG markup