Skip to content
TabKiwiTabKiwi

XML Formatter

Pretty-print XML with clean indentation or squeeze it onto one line, after checking it is well-formed.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

Paste a SOAP response, an RSS feed, an SVG or a config file and get it back indented one element per line, with short text-only elements kept on a single line. Comments, CDATA sections, processing instructions and the DOCTYPE are preserved. Minify mode strips the whitespace between tags instead. The document is checked for well-formedness first, and nothing is uploaded.

How to use XML Formatter

  1. Paste your XML into the left box.
  2. Choose Pretty-print or Minify.
  3. Set indentation and whether to keep comments.
  4. Copy the output or download it as an .xml file.

Frequently asked questions

Will formatting change my data?

Element names, attributes and text stay the same. Whitespace inside text is tidied, so if an element relies on exact spacing, such as xml:space="preserve", check it after formatting.

Why do I see an error instead of output?

The XML must be well-formed before it can be formatted. The message shows the line and column of the first problem, such as an unclosed tag.

More Developer tools

View all 91 →