XML Formatter

Pretty print minified XML and check that it is well formed.

Pretty print minified or single-line XML with consistent two-space indentation, or compact a formatted document back down. The parser reports documents that are not well formed, such as a missing closing tag.

It works for SOAP envelopes, RSS and Atom feeds, sitemaps, SVG and configuration files. Switch to the Tree view to navigate deep documents without scrolling through markup.

How to use it

  1. Paste XML into the editor.
  2. Press Format to indent it, or Minify to compact it.
  3. Copy the result or convert it to JSON.

Questions

Are attributes and namespaces preserved?

Yes. Attributes and namespace prefixes are kept exactly as written.

Are comments preserved?

No. Comments are dropped when the document is re-serialised.

Does it validate against an XSD?

No. It checks that the XML can be parsed, not that it conforms to an XSD or DTD.

All tools