XML Formatter and Pretty Printer

Blog

XML Formatter and Pretty Printer

BlogCheatsheets
Loading...
Loading XML...

Description

Format XML documents for readability, collapse nested elements, and validate structure. Useful for XML configuration and data exchange.

About XML Formatter and Pretty Printer

The XML Formatter pretty-prints and validates XML and HTML documents in your browser. It indents nested elements, normalizes whitespace, and surfaces structural errors so a minified or hand-edited document becomes readable and well-formed. Use it for cleaning up config files, SOAP payloads, RSS feeds, SVG, and any other angle-bracket markup.

How to use

  1. Paste your XML or HTML into the input.
  2. Choose the document type and whether to auto-fix minor errors.
  3. The formatted, indented output appears on the right.
  4. Copy the result, or fix any structural errors the parser reports first.

Frequently asked questions

What's the difference between well-formed and valid XML?

Well-formed means the syntax is correct — tags are closed and properly nested. Valid means it also conforms to a schema (DTD/XSD). This tool checks well-formedness and formatting, not schema validation.

Can it format HTML as well as XML?

Yes. Choose the HTML document type for lenient parsing of HTML, or XML for strict well-formedness checking.

Why does it report an error on my document?

Common causes are unclosed tags, mismatched nesting, an unescaped & or < in text, or multiple root elements. The error points to where parsing failed.

Does my document get uploaded?

No. Parsing and formatting run locally in your browser.