Skip to content

XML formatter

Paste XML and get a readable, indented version, or minify it to save bytes.

It works in your browser. We do not store or send anything you type.Free · No sign-up required

Workspace · XML formatter

Runs in your browser · 100% local
Files are processed in your browser; if you are signed in with history enabled, text results appear in your history.
Instructions

How to use it

01

Paste the XML.

02

Choose the indentation size and press Format.

03

If the document is not well formed, the parser error is shown.

Examples

Examples

Sitemap

A <urlset> with several <url> nodes is shown one node per line.

Minify

Whitespace between tags is removed without touching text content.

Reference guide

What you need to know

Validation uses DOMParser with application/xml. Formatting adds line breaks and indentation between tags while preserving text nodes, CDATA and declarations.

Frequently asked questions

Frequently Asked Questions

Yes, they are kept and indented as nodes.

Related tools

Other tools that can help with similar tasks.

More at Web development→
Online XML formatter: indent and validate · ByTooly