Paste XML or open a file to strip indentation, line breaks, and comments. The minifier reads your markup token by token, so text, attribute values, CDATA, and xml:space="preserve" sections stay exactly as written. It also checks that your XML is well-formed, and everything runs in your browser.

Original–
Minified–
Saved–
Minified + gzip–

Your XML

Paste XML here, or drop a file .xml, .svg, .rss, .xsd, .xsl, .kml, .gpx, .plist, .config and other XML formats
Waiting for XML

Minified

    How to minify XML

    1. Paste your XML into the left box, drop a file onto it, or use Open file.
    2. Check the badge under the box. It confirms the XML is well-formed, or points you to the line with the first error.
    3. Adjust the settings if you need to. The minified result updates on the right as you go.
    4. Copy the result or download it as a file.

    What the minifier changes, and what it leaves alone

    By default it removes the indentation and line breaks between tags, comments, whitespace before the root element and after the last one, and extra spaces inside tags, such as the gaps between attributes. Windows line endings become plain line feeds, which is what every XML parser converts them to anyway.

    It never rewrites attribute values, CDATA sections, entity references like &amp;, or processing instructions such as <?xml-stylesheet?>. Elements marked xml:space="preserve", and everything inside them, are copied exactly. Text that contains anything other than whitespace keeps its spacing unless you turn on Collapse spaces inside text.

    If your file declares a non-UTF-8 encoding, such as ISO-8859-1, the tool decodes it correctly and updates the declaration to UTF-8, since the minified file is saved as UTF-8.

    Choosing a whitespace setting

    Remove indentation between tags is right for almost all data XML, like feeds, config files, sitemaps, and API payloads. It removes whitespace-only text that contains a line break, which is how indentation always looks, but it keeps a lone space between two tags. That matters in mixed content, where <b>bold</b> <i>italic</i> should keep the space between the words.

    Remove all whitespace-only text gives the smallest output and is safe for pure data files with no mixed text. Keep text whitespace as is only removes comments and spacing inside tags, for documents where every character of text matters.

    Minifying vs. gzip

    Most web servers already gzip or Brotli-compress XML in transit, and compression removes much of the benefit of minifying. The Minified + gzip figure shows what your file would actually weigh over the wire. Minifying still helps with storage, files that are sent uncompressed, and anything with a size limit, such as some feed validators and embedded devices.

    Frequently asked questions

    Is it safe to minify XML?

    With the default settings, yes, for data files. The document means the same thing to any XML parser afterwards. The only setting that can change meaning in mixed text documents is Remove all whitespace-only text, which can join words that were separated only by a space between tags.

    Does the minifier validate my XML?

    It checks that the XML is well-formed, meaning tags are properly nested and closed, attributes are quoted, and entities are defined. It doesn't validate against a schema or DTD. Snippets with several top-level elements are recognized as fragments instead of being flagged as errors.

    Can I minify SVG files with this?

    Yes. SVG is XML, so the same safe rules apply. Text inside <text> elements keeps its spacing, and path data inside attributes isn't touched.

    What does "Write empty elements as <tag/>" do?

    It shortens elements with no content, like <item></item>, to <item/>. XML parsers treat both the same. Leave it off for XHTML that browsers will read as HTML, where a self-closed <div/> or <script/> doesn't close.

    How large a file can it handle?

    Files of tens of megabytes work in most browsers. Files over about 1.5 MB are minified in full but aren't shown in the editor, so the page stays responsive.

    Is my XML uploaded anywhere?

    No. Your XML is read and minified in your browser, and nothing is sent to a server or stored.

    Our Full Dev Tool Library

    [tcb_post_list query="{'paged':1,'filter':'custom','post_type':|{|'page'|}|,'related':|{||}|,'orderby':'date','order':'DESC','posts_per_page':'100','offset':'1','no_posts_text':'There are no posts to display.','exclude_current_post':|{||}|,'queried_object':{'ID':1975,'post_author':'1'},'dynamic_filter':{'category':'category','tag':'tag'},'sticky':|{||}|,'rules':|{|{'taxonomy':'category','terms':|{|'26'|}|,'operator':'AND'}|}|}" type="grid" columns-d="3" columns-t="1" columns-m="1" vertical-space-d="30" horizontal-space-d="30" ct="post_list-74116" ct-name="Small size 10" tcb-elem-type="post_list" pagination-type="none" pages_near_current="2" dynamic_filter='{"category":"category","tag":"tag"}' element-name="Post List" css="tve-u-199bc3a3995" total_post_count="123" total_sticky_count="0" posts_per_page="100" featured-content="0" disabled-links="0" article-tcb_hover_state_parent="" no_posts_text="There are no posts to display." horizontal-space-m="0" horizontal-space-t="15" vertical-space-t="10" vertical-space-m="15" article-css="tve-u-1855901a3d4" article-shortcode="tcb_post_list" class='' article-tcb_hover_state_parent='' article-css='tve-u-1855901a3d4' article-shortcode='tcb_post_list' ][tcb_post_list_dynamic_style][/tcb_post_list_dynamic_style]

    [tcb_post_categories css='tve-u-199bc3a39a2' link='1' rel='0' target='0' inline='1' static-link='{"className":"","href":"https://flipperfile.com/category/developer/","title":"Developer","data-css":"tve-u-199bc3a39a2"}' link-css-attr="tve-u-199bc3a39a2"]

    [tcb_post_title css='' link='1' rel='0' static-link='{"className":"","href":"https://flipperfile.com/developer-tools/markdown-table-generator/","title":"Markdown Table Generator Online Free","class":""}' target='0' inline='1']

    [/tcb_post_list]
    Flipper File