XML Minifier
Strip whitespace and comments from XML to reduce its size.
Input
Output
Ready
Drop a file to load it
About this tool
Remove every byte that does not change meaning — indentation, line breaks and, optionally, comments.
When you would use it
- Reducing payload size
- Embedding a document in a single line
- Preparing markup for production
Worked example
<?xml version="1.0" encoding="UTF-8"?>
<user id="4815">
<name>Ada Lovelace</name>
<active>true</active>
<score>91.5</score>
<roles>
<role>admin</role>
<role>editor</role>
</roles>
</user>
<?xml version="1.0" encoding="UTF-8"?><user id="4815"><name>Ada Lovelace</name><active>true</active><score>91.5</score><roles><role>admin</role><role>editor</role></roles></user>
Things worth knowing
- Whitespace inside text content is preserved, because it is data rather than formatting.
Questions
Frequently asked
Is minifying safe?
Yes — only insignificant whitespace is removed. The parsed document is unchanged.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Does it work offline?
Yes. JSONWorks is installable as a progressive web app and caches itself on first visit, so every tool keeps working without a connection.
Related