HTML Minifier
CodeMinify HTML by removing comments, collapsing whitespace, and stripping empty attributes
Paste formatted HTML and get it stripped of comments, collapsed whitespace, and redundant attributes before shipping to production, with a before/after byte-size comparison so you can see exactly how much page weight you saved. Content inside `<pre>`, `<script>`, `<style>`, and `<textarea>` tags is deliberately preserved rather than collapsed, since whitespace is often meaningful there, and there's an optional pass that does a basic minify of inline `<style>` and `<script>` blocks too, though for real CSS or JS minification the dedicated CSS Minifier and JS Minifier tools do a more thorough job. It only minifies HTML structure; it isn't a full HTML validator, so structurally broken markup should get fixed first if the output looks off. Everything runs client-side.
How to use HTML Minifier
- 1.Paste formatted HTML to strip comments, collapse whitespace between tags, and remove empty attributes before deploying to production.
- 2.Use it to shrink email template HTML, which is often bloated with formatting whitespace that adds unnecessary bytes.
- 3.Compare the before/after byte size to gauge how much a build step's HTML minification is actually saving you.
Frequently asked questions
Use via API, SDK, or MCP
cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/html-minifier \
-H "Authorization: Bearer utx_live_..." \
-H "Content-Type: application/json" \
-d '{"input":"<div> <p> Hello </p> </div>","removeComments":true}'Get an API key from your dashboard · Full API docs →