Developer Tools Runs in your browser Free · no account

HTML Minifier

The HTML minifier collapses whitespace between elements, removes comments and strips optional quotes where it is safe to do so, reporting how many bytes were saved. Content inside <pre>, <textarea>, <script> and <style> is never touched.

Options
HTML 0 characters
Minified HTML

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the HTML Minifier

  1. Paste the HTML you want to shrink.
  2. Decide whether comments should be stripped.
  3. Check the size saving, then copy or download the result.

Example

Input
<div>
  <p>Hi</p>
</div>
Output
<div><p>Hi</p></div>

Common use cases

  • Reducing the size of an email template where every byte counts.
  • Compacting an inline HTML fragment stored in a database or a JSON field.
  • Preparing static markup for a build that has no minification step.

Limitations and things to watch for

  • Whitespace between inline elements is significant — removing the space in "<a>one</a> <a>two</a>" would visibly join the words. The minifier collapses runs of whitespace to a single space rather than deleting them entirely, so rendering never changes.
  • Conditional comments are preserved because removing them changes behaviour in legacy browsers.
  • Server-side gzip or Brotli compression saves considerably more than minification. Use both where you can.

Frequently asked questions

Will minifying change how my page looks?
No. Whitespace between elements is collapsed to a single space rather than removed, which preserves the rendering of inline content, and pre, textarea, script and style blocks are left untouched.
Are comments always removed?
Only when you leave that option on, and conditional comments are always kept because they carry behaviour rather than documentation.
How much will I save?
Usually 10 to 25 percent on indented markup. The tool shows exact before and after byte counts.

Share this tool