Beautify XML with proper indentation, or minify it to a single line. Comments, CDATA and processing instructions are preserved.
How to use the XML Formatter
Paste your XML into the input box.
Choose Beautify to indent it or Minify to compress it.
Pick the indent size, then copy the result.
Frequently asked questions
It indents each element by its nesting depth and puts tags on their own lines, while keeping a single text child inline. Comments, CDATA and the XML declaration are preserved.
It removes comments and the whitespace used only for indentation between tags. Text content and CDATA sections are kept exactly, so it is safe unless your document relies on significant whitespace in mixed content.
No. Formatting runs entirely in your browser, so your data never leaves your device. That makes it safe even for XML that contains sensitive values.
An XML formatter that beautifies documents with depth-based indentation or minifies them, while preserving comments, CDATA and processing instructions.
Everything runs in your browser, so it is fast and your XML stays private. It reformats for readability and does not validate the schema.
Related tools
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text, right in your browser.
Convert colors between HEX, RGB and HSL with a live preview.
Convert Unix timestamps to human dates and back — UTC, local, ISO 8601 and relative time. Seconds and milliseconds are auto-detected.
Percent-encode and decode URLs and URL components, UTF-8 safe.
We use essential cookies to run the site. With your consent we also load Google AdSense, which sets advertising cookies. See our privacy policy.