Skip to content
ToolMug

XML Formatter

Paste minified or single-line XML and get properly indented, readable output. Syntax errors are reported with the line and column, so it doubles as a quick well-formedness check.

Runs in your browser — nothing you enter is uploaded

How to use

  1. Paste your XML, or click Load sample.
  2. Choose the indentation and line width.
  3. Click Format, or press Ctrl+Enter (⌘+Enter on Mac).
  4. 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.

Related tools