Minify HTML to remove whitespace and comments, or beautify minified HTML back to readable code — with granular options and live size comparison.
Fill in the fields or paste your input text. Click Sample to load an example and see the tool in action.
Press the main button to process your input. Results appear instantly — all processing runs in your browser, no upload needed.
Check the output panel. Any errors are shown in a red bar with a clear description so you can fix the input quickly.
Click Copy to copy to clipboard, or Download to save the result as a file.
It removes unnecessary whitespace between tags, HTML comments (<!-- -->), leading and trailing spaces on each line, and optional redundant attributes, without affecting how the page renders.
In production, yes — HTML comments are invisible to users and serve no runtime purpose. The exception is IE conditional comments (<!--[if IE]>), which this tool preserves by default.
No. Inline <script> and <style> blocks are minified separately using their own rules. Content inside those blocks is handled carefully to avoid breaking scripts.
Beautify reverses minification — it adds proper indentation and line breaks to make compact or minified HTML readable for editing and debugging.
No, for standard HTML. This tool uses conservative minification settings that are safe for all common HTML patterns. Unusual whitespace-sensitive elements like <pre> and <textarea> are preserved.
Yes. All processing happens locally in your browser. Your HTML is never uploaded to any server.