How to Use the HTML Minifier Online
- 1Paste a copy of the source markup. Keep the readable version nearby if you need to compare the result with the original document or template.
- 2Look through the compact output for spaces that carry meaning, such as the gap between two inline elements in a sentence.
- 3Check whether the original contains comments used by a build step, template engine, or integration. Keep any required markers in the source version.
- 4Copy or download the result after testing how the destination renders it. For a short fixture, compare the expected text and the element structure.
Input & Output Examples
The comment and line breaks between the tags are removed. The link and its href stay in the output.
<nav>
<!-- primary links -->
<a href="/docs">Docs</a>
</nav><nav><a href="/docs">Docs</a></nav>Runs of spaces inside the first text node become one space, and the gap between the two elements is removed.
<div>Plan details</div>
<div>Updated today</div><div>Plan details</div><div>Updated today</div>Practical Developer Workflows
- Prepare a compact markup fixture for a test that compares serialized HTML from a simple template.
- Remove editorial comments from a short example before including the markup in a plain-text support message.
- Compare a compact version of a simple static snippet with its readable source when reviewing how much whitespace it contains.
Zero Server Uploads & Complete Privacy
Runs 100% in your browser; no data is uploaded to any server.
Let us know directly so our engineering team can fix it.