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.

Drop an HTML file here Or choose a .html/.htm file, up to 5 MB
Input HTML
1
Minified output
1

Minify HTML in three steps

01

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 options for your HTML

Option When to use it What to check
Remove HTML commentsWhen comments are notes you do not need in the output.Conditional comments remain; check whether your code depends on any others.
Keep DOCTYPELeave it on when exporting a complete HTML page.If disabled, compare the file start and how the browser renders the page.
Remove all newlinesWhen 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

Rate this tool

Loading ratings…

Write a commentNo account needed

Do not share passwords, sensitive information or the contents of files you are processing.

Reviewed before posting. Email stays private.