Input HTML
Paste your HTML here
Options
Tip: If your page uses whitespace-sensitive rendering, disable “Collapse whitespace”.
Minified output
Result appears here
Quick diff (line-based)
Input (first 60 lines)
Output (first 60 lines)
This diff is for quick inspection. For full diffs, use your editor/IDE.
Privacy-friendly
This tool runs entirely in your browser. We don’t upload or store your HTML.
FAQ
Common questions about HTML minification
Is it safe to collapse whitespace?
Usually yes. However, some layouts or inline elements can be whitespace-sensitive. If something looks off, disable “Collapse whitespace”.
Do you modify inline JavaScript or CSS?
No. By default, script and style contents are preserved to avoid breaking functionality.
Does this tool upload my HTML?
No. Everything runs locally in your browser. Your input stays on your device.
Why is “Remove empty attributes” marked advanced?
Removing empty attributes can change behavior in edge cases. Use it only if you know the HTML is safe to modify.