XML Formatter
Beautify or minify XML with comments, CDATA and text nodes kept intact.
How to use it
- Paste XML into the left panel — a SOAP envelope, an RSS feed, an Android layout or a build file.
- Pick Beautify to re-indent or Minify to collapse the document to one line.
- Beautify indents nested elements by two spaces and keeps elements that contain only text on a single line.
- Comments, CDATA sections, the XML declaration and DOCTYPE lines pass through untouched.
- Copy or clear the result; the status line shows element count and output size.
Common use cases
- Reading machine-generated XML — turn one-line SOAP or config output into a reviewable tree.
- Shrinking feeds — minify RSS or sitemap files before embedding them in fixtures or logs.
- Diff preparation — normalize indentation from different authors before comparing files.
- Inspecting build files — reformat Maven, Ant or Android XML that arrived with erratic spacing.
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.