Skip to content
cubdomaincubdomain

XML Formatter

Pretty-print and tidy XML, and find exactly where it isn't well-formed.

Runs entirely in your browser
Paste XML here
Output

The formatted XML appears here.

How to use it

  1. 01

    Add your XML

    Paste it in or upload a file.

  2. 02

    Choose indentation

    Two spaces, four spaces or tabs.

  3. 03

    Format and copy

    Errors are shown with their line number.

Questions

What does well-formed mean?

Every tag is closed and nested correctly, with one root element and quoted attributes.

Can it validate against a schema?

It checks that the XML is well-formed — every tag closed and properly nested — and says where it isn’t. It doesn’t validate against an XSD schema.

Can I minify XML too?

Yes. Choose Compact in the Indent menu to remove the whitespace between tags.