XML Minifier

Paste your XML, click Minify, and get compact whitespace-stripped output. Invalid XML will show a readable error before minification.

Why Use the XML Minifier?

Minified XML removes all unnecessary whitespace, line breaks, and indentation to produce the smallest possible file size. This is ideal for reducing bandwidth when transmitting XML over APIs, embedding XML in configuration strings, or optimizing storage for large XML datasets. To restore readability later, use the XML Formatter to pretty-print your minified output.

Before minifying, make sure your XML is valid with our XML Validator. For sitemaps and other structured XML files, reducing file size can improve search engine crawling performance.

Example Input

Paste formatted or indented XML like this:

<?xml version="1.0" encoding="UTF-8"?>
<catalog>
  <book id="1">
    <title>XML Developer's Guide</title>
    <price>44.95</price>
  </book>
  <book id="2">
    <title>Midnight Rain</title>
    <price>5.95</price>
  </book>
</catalog>

Example Output

The minifier strips all whitespace between tags:

<?xml version="1.0" encoding="UTF-8"?><catalog><book id="1"><title>XML Developer's Guide</title><price>44.95</price></book><book id="2"><title>Midnight Rain</title><price>5.95</price></book></catalog>