XML formatter & validator

← All tools

Paste XML to pretty-print, minify, or check well-formedness. String-based formatter preserves attributes, CDATA, and comments — no DOM normalization.

~~~
(line )
Indent:

XML input

Output

~~~

About this tool

Formatting uses a custom tokenizer — not DOMParser — so attribute order, self-closing tags, CDATA sections, and comments stay intact.

Validation uses DOMParser with text/xml and reports parser errors with line hints when available.

Your XML never leaves the browser. Minify collapses whitespace between tags but does not validate schema or namespaces — a well-formed RSS feed can still fail your consumer's expectations. Use the RSS example to sanity-check output before editing a live feed.

~~~

Read more