HTML Minifier Online
Minify pasted HTML or a file and compare the size before and after. Choose how to handle comments, DOCTYPE and newlines, then copy or download the result.
Minify HTML code
Paste code or choose one .html/.htm file up to 5 MB.
Minify HTML in three steps
Paste code or choose a file
Paste HTML into the left editor or choose one .html/.htm file up to 5 MB. Choosing a file starts minification with the current options.
Choose what to keep or remove
You can remove HTML comments, keep DOCTYPE and remove all newlines. After changing an option, select “Minify HTML” again.
Compare, then copy or download
Compare before/after bytes and open the minified HTML to check text, spacing and scripts before replacing a working file.
Choose options for your HTML
| Option | When to use it | What to check |
|---|---|---|
| Remove HTML comments | When comments are notes you do not need in the output. | Conditional comments remain; check whether your code depends on any others. |
| Keep DOCTYPE | Leave it on when exporting a complete HTML page. | If disabled, compare the file start and how the browser renders the page. |
| Remove all newlines | When you accept a less readable result. | Open the page to check spacing and text affected by line breaks. |
If the minified file looks different
- Words run together or spacing changes
- The tool reduces whitespace between tags and in some code. Keep the original and compare the pages; do not use the output if spacing matters.
- Little or no reduction
- Already compact files or files with much pre, textarea, script or style content may shrink little. Compare byte sizes, not only the rounded percentage.
- The file or page no longer works
- Try turning off “Remove all newlines” or retaining needed comments, then minify and reopen the file. The tool does not parse HTML or verify JavaScript/CSS behavior.
Where is the HTML processed?
The tool reads the file and creates the minified HTML in your browser; the minification flow does not upload the file to KitoTool. Keep the original and inspect the download before using it.
Comments & feedback
Loading ratings…
Write a commentNo account needed