How to use HTML Minifier
- Paste your HTML.
- Copy or download the minified HTML.
Supported features and limitations
Conservative: whitespace inside <pre>, <textarea>, <script> and <style> is untouched, and conditional comments are kept. Collapsing whitespace can slightly change how inline elements are spaced.
Privacy
Everything you type is processed locally in your browser and is not sent to our servers. No account is needed and there is no watermark.
Frequently asked questions
Is the minified HTML identical in the browser?
Usually, but check pages that depend on whitespace between inline elements.
Does it minify inline JavaScript?
No, scripts and styles are left as they are.
Related tools
- HTML Formatter - Indent and beautify HTML so nested tags are easy to read.
- CSS Minifier - Minify CSS by removing comments and whitespace to shrink file size, with a before-and-after character count.
- HTML Previewer - Preview HTML and CSS safely in a sandboxed frame as you type.
- JSON Formatter & Validator - Format, minify and validate JSON with clear errors.
- URL Encoder / Decoder - Encode or decode URLs and query strings.
- Color Converter - Convert between HEX, RGB and HSL colours.