HTML Minifier
Runs in your browser — your data is never uploaded.
Shrink an HTML document by stripping comments and collapsing whitespace between tags, without ever touching the contents of <script>, <style>, <pre> or <textarea> elements. Runs entirely in your browser.
0 characters · runs entirely in your browser
How to use HTML Minifier
- 1
Paste your HTML into the box.
- 2
Click “Minify”.
- 3
Copy the result, or download it as an .html file.
Share
Embed this tool on your site
Paste this where you want the tool to appear. It runs entirely in your visitor's browser — no uploads, no account, no tracking.
Please keep the attribution line — it's what keeps these tools free.
Need a different size, a dark theme, or a different tool? Build an embed lets you preview it first.
Frequently asked questions
Does this touch my inline JavaScript or CSS?+
No. Content inside <script>, <style>, <pre> and <textarea> is copied through completely unchanged, since minifying it as generic HTML whitespace could break the code or formatting inside.
Could minifying change how my page looks?+
Whitespace between block-level tags is safely removed, but whitespace between inline elements can occasionally be visually significant — this is a well-known trade-off shared by most simple HTML minifiers, and rarely noticeable in practice.
Is my HTML uploaded anywhere?+
No. Minification runs entirely in your browser — nothing is sent to a server.