Skip to tool
FeuTex · free tools runs in-browser no bloat built by LiMiT

XML Formatter for VS Code

Paste XML, format it with VS Code-friendly indentation, or minify and validate it before you commit. This runs locally in your browser (no uploads).

Category: Developer · URL: /tools/xml-formatter-vscode.html
Input XMLTip: paste what you’d format in VS Code
OutputRead-only

If you need a broader XML tool, try the related format/validate tools below.

Privacy: runs locally in your browser. No uploads, no tracking scripts.

How to use

Use it like a quick VS Code formatting preview:

  1. Paste your XML into the input box.
  2. Choose indentation (spaces/tabs), line endings, and whether to collapse empty tags.
  3. Click Pretty Format or Minify. Use Validate to check syntax only.
  4. Copy the output back into VS Code.
Keywords this page targets (natural cluster): xml formatter vscode, format xml in vscode, vscode xml pretty print, vscode xml minify, xml beautify vscode, xml format online for vscode, xml indentation 2 spaces, xml indentation 4 spaces, xml tabs vs spaces, xml validate before paste, pretty print xml snippet, minify xml string, remove whitespace between xml tags, xml formatter extension alternative, fix xml indentation, format xml with comments, xml parser error checker, xml pretty printer, compact xml output, xml doctype formatter
Secondary intents covered: Pretty-print XML with a specific indent width to match VS Code settings, Minify XML for logs, URLs, or storage without changing content, Validate XML and locate parsing issues quickly, Normalize line endings (LF vs CRLF) before committing, Copy formatted XML back into VS Code without extra whitespace noise, Collapse empty elements into self-closing tags (or keep long form), Keep or remove comments while cleaning up XML

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.