๐Ÿ“ฐ XML Formatter

Input
Output

Pretty-print XML data with clean indentation, or minify it by stripping unnecessary whitespace and line breaks. Uses the browser's built-in XML parser, so conversions are based on correct, standards-compliant parsing.

How to use

  1. Paste the XML you want to format or minify into the left input box.
  2. Choose "Format" or "Minify" mode, and set the indent width (for format mode).
  3. Press the run button to see the result on the right โ€” use the copy button to copy it to your clipboard.

FAQ

What happens if I enter invalid XML?

It's treated as a syntax error and an error message is shown. Check for unclosed tags or missing quotes around attribute values.

Does this handle XML namespaces?

Yes. Since it parses using the browser's built-in XML parser, XML containing xmlns attributes is handled correctly.

How are self-closing tags handled?

Elements with no children are output in the <tag /> self-closing form when formatting.