XML Formatter

Paste XML on the left. See errors, pretty-print the document, or open a collapsible tree of elements and attributes.

Runs entirely in your browser. Your input never leaves this tab.

Input

Output

Other tools

Same site, different job. Your input stays in the browser.

What is XML?

XML, short for Extensible Markup Language, is a text format for structured documents. It uses tags to mark up content, attributes to add data to a tag, and nesting to describe a tree. XML is stricter than HTML: every open tag needs a close tag, and every attribute needs a value in quotes.

How to use this formatter

  • Paste or type XML in the input pane.
  • The output pane shows the pretty-printed version.
  • Switch to Tree to browse the document. Attributes and children appear as separate nodes so you can collapse a section without losing context.
  • A validation error underlines the failing line and reports the message in the status area.
  • Use Minify to strip whitespace, or Copy output to grab the result.

Common XML errors

  • A tag opened without a matching close tag, or the wrong close tag.
  • An attribute value that is not wrapped in quotes.
  • An & in text content. Escape it as &.
  • Two root elements. XML allows only one.
  • A prolog that is not on the first line.

Where XML is used

XML shows up in RSS and Atom feeds, SVG vector images, Android and iOS build settings, SOAP web services, SAML single-sign-on payloads, Office documents such as .docx, and many configuration files. It is verbose compared to JSON, but its schema and namespace features suit long-lived documents.

Runs in your browser

Everything happens on this page. Nothing is uploaded. Large documents stay responsive because the tree view only renders the branches you expand.