HTML Minifier / Beautifier
Minify HTML to reduce file size or beautify minified HTML for readability. 8 configurable options including inline CSS/JS minification. Upload files or paste code. Free, no signup.
About this tool
The HTML Minifier removes comments, whitespace, and unnecessary characters from your HTML to reduce file size and improve page load speed. Configure 8 optimization options to control exactly what gets removed.
Use Beautify mode to unminify compressed HTML back to readable, properly indented code. Choose between 2-space, 4-space, or tab indentation. Content inside pre, script, style, and textarea elements is always preserved.
All processing happens entirely in your browser. Your HTML code is never sent to any server.
Frequently Asked Questions
What does HTML minification do?
HTML minification removes comments, whitespace between tags, and unnecessary characters from your HTML code. It can also collapse boolean attributes, remove empty attributes, and minify inline CSS and JavaScript.
Can I unminify HTML?
Yes. Click the Beautify button to convert minified HTML back to readable code with proper indentation. Choose between 2-space, 4-space, or tab indentation.
What are the minification options?
Eight configurable options: remove comments, collapse whitespace, collapse boolean attributes, minify inline CSS, minify inline JS, remove empty attributes, remove attribute quotes, and remove optional closing tags.
Is content inside script and style tags preserved?
Yes. Content in pre, script, style, and textarea elements is preserved during both minification and beautification. Inline CSS and JS can be optionally minified separately.