If you need a broader XML tool, try the related format/validate tools below.
How to use
Use it like a quick VS Code formatting preview:
- Paste your XML into the input box.
- Choose indentation (spaces/tabs), line endings, and whether to collapse empty tags.
- Click Pretty Format or Minify. Use Validate to check syntax only.
- Copy the output back into VS Code.
FAQ
How is this related to formatting XML in VS Code?
It generates clean, consistent indentation and line breaks so you can paste the result into VS Code and get predictable diffs.
Does this validate XML or just reformat it?
Both: Validate checks syntax, and Pretty Format/Minify will fail with an error if the XML is invalid.
Will minify remove meaningful whitespace inside text nodes?
No—minify only removes whitespace between tags; it does not trim text content unless you enable Trim text nodes in pretty formatting.
Can I use tabs instead of spaces like my VS Code settings?
Yes. Enable Use tabs, or set the indent size (commonly 2 or 4 spaces).
Does it keep XML comments?
By default yes. Turn off Keep comments if you want them removed during pretty formatting.
Can it add an XML declaration like <?xml version="1.0"?>
Yes—enable Add XML declaration. Browsers often omit it when serializing, so this option forces it.
Is my XML uploaded anywhere?
No. The formatting and validation run locally in your browser, with no network requests.