How to use
Use the formatter in seconds:
- Paste your XML into the input box.
- Choose indentation and optional settings (remove comments / add XML declaration).
- Click Format to pretty print or Minify to compact it.
- Use Validate to check well‑formedness without changing the XML.
- Copy the result from the output box.
FAQ
Does this XML formatter upload my data?
No. Formatting and validation run in your browser with no network requests.
What does “Validate” check?
It checks that the XML is well‑formed (proper nesting, closing tags, valid syntax). It does not validate against an XSD/DTD schema.
Can minifying change my XML meaning?
Minify removes whitespace between tags; if your XML relies on whitespace in mixed content, prefer Format instead of Minify.
Why does mixed content sometimes stay on one line?
For elements like <p>Hello <b>world</b>!</p>, the tool avoids adding newlines that could change how whitespace is interpreted.
Will attribute order or self-closing tags change?
They can. The output is equivalent XML but may use different attribute order or self‑closing forms.
Can I remove comments from XML?
Yes—enable “Remove comments” before formatting or minifying.
Can I add an XML declaration header?
Yes—enable “Add XML declaration” to prepend <?xml version="1.0" encoding="UTF-8"?>.