How to use
- Paste your XML, or click Load sample.
- Choose the indentation and line width.
- Click Format, or press Ctrl+Enter (⌘+Enter on Mac).
- Copy the formatted XML.
Options explained
- Indent
- 2 or 4 spaces, or tabs, for each nesting level.
- Line width
- Elements with many attributes are wrapped with one attribute per line when they exceed this width.
Examples
API response. Paste a SOAP or REST response that arrived on one line to read its structure.
sitemap.xml. Format a generated sitemap to check its URLs and dates.
Frequently asked questions
Is whitespace inside text changed?
Whitespace between elements is re-indented. Text content is kept, but runs of spaces and line breaks inside mixed content may be normalised. If exact whitespace matters, for example in xml:space="preserve" sections, check the result.
Does it validate against a schema?
No. It checks that the XML is well-formed — tags are closed and nested properly — but not that it follows an XSD or DTD.
Is my data uploaded?
No. The XML is parsed and formatted in your browser.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.