HTML Formatter
Beautify and indent HTML markup.
OpenRemove comments and the whitespace between tags to get a compact single-line copy of your HTML.
Add a template, snippet or email body, or drop an .html file.
Every <!-- --> block is deleted automatically.
Runs of spaces shrink to one and gaps between tags disappear.
Copy the single line or save it as min.html.
You are pasting a block of markup into a CMS field or an email builder that mangles line breaks, or you just want to trim a few kilobytes from a static page. A quick minify pass gives you a one-line version.
The HTML Minifier performs three steps. It deletes every <!-- --> comment, collapses any run of whitespace (spaces, tabs, newlines) into a single space, and removes whitespace sitting between a closing > and the next <. The output updates while you type and can be copied or saved as min.html. It does not remove optional tags, shorten attributes or optimize embedded CSS and JavaScript beyond whitespace.
Because the whitespace rule is applied everywhere, content inside <pre> and <textarea> loses its line breaks, and inline scripts that rely on line breaks or // comments can stop working. Conditional comments for older Outlook versions are removed as well, which matters for email templates. Keep those blocks out, or reinsert them afterwards. Embedded styles and scripts are better handled separately by the CSS minifier and the JS minifier, and keep a readable source you can regenerate with the HTML Formatter.
Minification is a few regular expressions applied in the browser, so unpublished pages never leave your device.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
Whitespace between a closing > and the next < is removed entirely. If two inline elements like a or span were separated only by a line break, they now touch. Add an explicit space or where the gap matters visually.
It depends on how much indentation and how many comments the source contains. Deeply indented templates shrink noticeably, while markup that is already compact barely changes.
For small pages and snippets, yes. Build-time minifiers can also drop optional closing tags, collapse boolean attributes and compress inline assets, which this tool does not attempt.