Skip to content
Run here 100% in your browser, no upload, no login

XML Formatter

Beautify or minify XML with comments, CDATA and text nodes kept intact.

How to use it

  1. Paste XML into the left panel — a SOAP envelope, an RSS feed, an Android layout or a build file.
  2. Pick Beautify to re-indent or Minify to collapse the document to one line.
  3. Beautify indents nested elements by two spaces and keeps elements that contain only text on a single line.
  4. Comments, CDATA sections, the XML declaration and DOCTYPE lines pass through untouched.
  5. Copy or clear the result; the status line shows element count and output size.

Common use cases

Why it stays private

The formatter is a self-contained tokenizer and rewriter in your browser. Documents with endpoints, credentials or business data never leave the page.

FAQ

Q: Does it validate my XML? A: Only lightly. The tokenizer needs matching angle brackets and quotes, but it does not check element nesting or DTD/schema validity — malformed nesting is reprinted as-is rather than fixed.

Q: What happens to whitespace inside text nodes? A: When beautifying, a text-only child is trimmed and kept inline with its element. Whitespace between block elements is dropped, which is the conventional pretty-print behavior.

Q: Are attribute values reordered or rewritten? A: No. Attributes keep their order and their exact values; only whitespace between attributes is collapsed.

Your data stays on this device

XML Formatter runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.