ToolBirch

XML Formatter

Indent XML for readability and verify tags close in order.Developer Tools

XML Formatter

Indent XML for readability and check that every tag is closed in order. Text content, CDATA and comments are never rewritten.

About this tool

Machine-written XML arrives as one endless line. This formatter re-indents every element at its nesting depth, keeps text nodes, comments and CDATA verbatim, and verifies that every open tag has a matching close tag in order.

How to use the XML Formatter tool

  1. Paste your XML. Any well-formed markup, including declarations, comments and CDATA sections.
  2. Format. Mismatched or unclosed tags are reported by name instead of producing broken output.
  3. Copy the result. Two-space indented XML, ready to read or commit.

Supported formats

Input

  • XML text

Output

  • Indented XML
  • Tag-balance errors with tag names

Inputs are validated before anything is processed. Invalid values and unsupported files are rejected with a clear error instead of failing silently.

Frequently asked questions

Is text content reflowed?

No. Text nodes, attributes, comments and CDATA are preserved exactly; only inter-tag whitespace is normalised.

What validation is performed?

Tag balance: every close tag must match the nearest open tag, and no tag may remain unclosed.

Are self-closing tags handled?

Yes, both the <tag/> form and HTML-style void elements.

Does it resolve entities?

No. Entities are left as written; expansion would change the document's bytes.

Privacy

Everything you enter stays in this browser tab. There is no upload endpoint for tool inputs, no account, and no server-side copy of your text or files. Results are produced locally and disappear when you close the page.

No account is required and no file is ever uploaded. See the privacy policy for details about analytics and the limited data this site stores.

Known limitations

  • No DTD or schema validation; only tag balance.
  • Whitespace inside text nodes is not normalised.
  • Namespaced attributes are formatted but never reordered.

Other free tools from the same collection.