HTML Minifier & Beautifier
Minify for compact size or beautify for readability—fully client-side for privacy.
About this tool
This HTML Minifier & Beautifier runs entirely in your browser—no uploads, no tracking, and no external APIs.
Use Minify to remove comments and unnecessary whitespace for faster load times, or
Beautify to pretty-print your markup for review and code reviews.
For safety, the processor doesn’t alter content inside <script>
, <style>
,
<pre>
, or <textarea>
blocks.
Options in brief
- Remove comments – Strips HTML comments (
<!-- ... -->
) with optional protection for legacy IE conditionals. - Collapse whitespace – Reduces redundant spaces/newlines, while preserving protected blocks.
- Trim attribute spaces – Removes padding around equals and inside quoted attribute values (conservative).
- Keep line breaks – Leaves single newlines between common block-level elements when minifying.
Keyboard shortcut: Ctrl/Cmd + Enter runs Minify. Your last input persists locally so you can pick up where you left off.
FAQ
Does any HTML I paste get uploaded?
No. This tool runs entirely in your browser. Nothing is sent to any server.
Will minifying change what my page looks like?
Minification removes comments and collapses unnecessary whitespace between tags but preserves content inside
<script>
, <style>
, <pre>
, and <textarea>
.
Your rendered page should look the same.
What about conditional comments or inline attributes?
You can keep IE conditional comments and choose to trim attribute spacing. Toggle these options above before minifying.