XML Formatter

Format, minify and validate XML online, powered by the native browser parser with clear error messages.

How to use

  1. Paste your XML into the box, or click "Sample" to load demo data.
  2. Click "Format" for a two-space indented version, or "Minify" to strip whitespace between tags.
  3. If the XML has syntax errors such as unclosed tags, a message will tell you what went wrong.
  4. Use the "Copy" button at the top right of the result to grab the output.

FAQ

Does it support namespaces?
Yes. Formatting uses the native browser XML parser, so namespace declarations and prefixed tags are preserved as-is.
Are comments and processing instructions kept?
Yes. Comments, processing instructions (like <?xml version=?>) and CDATA sections are preserved when formatting; only pure whitespace between tags is removed when minifying.
Is my data uploaded?
No. Parsing and serialization happen entirely in your browser; nothing leaves your device.

Related Tools