HTML Minifier
Paste HTML to compact it in your browser. This simple tool removes ordinary comments, removes whitespace between tags, collapses other runs of two or more whitespace characters to one, and trims the result. Your text stays on this device.
How to use the HTML Minifier
-
1
Paste HTML
Paste a snippet or document into the editor.
-
2
Choose the next step
The page guides you from input to a local result.
-
3
Review and copy
Check the compacted markup, then copy it if it suits your use case.
What this minifier actually changes
This is a small whitespace-and-comment cleaner, not a full HTML optimizer.
It does
- Preserve whole
<pre>,<code>, and<textarea>blocks. - Remove ordinary HTML comments, while keeping comments that begin with
<!--[if. - Remove whitespace between tags, collapse every other run of two or more whitespace characters to one, and trim the result.
Read the output before using it
The cleaner can change meaningful whitespace in text, <script>, or <style> content. It does not parse HTML semantically, validate markup, protect against security issues, or minify JavaScript and CSS. It has no compression modes and does not remove attributes, tags, or the doctype.
Use it for a quick local cleanup of markup you understand. For production builds, test the resulting page and use a build tool appropriate to your stack.
Frequently Asked Questions
No. The editor processes the HTML in your browser and does not send it through the tool server.
Ordinary HTML comments are removed. Comments beginning with <!--[if are kept.
No. It can alter whitespace inside script, style, or text content, so inspect and test the result.
No. This tool only performs the limited comment and whitespace cleanup described above.
Related Tools
ASCII Table Reference
Full ASCII table from 0 to 127 with decimal, hex, octal, binary, standard names and HTML numeric-reference notation, including NUL, LF and DEL.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
HTML Character Reference
Searchable list of HTML entities, their named and numeric codes, and a one-click copy for special characters and symbols.
HEX Color Picker
Pick or enter a HEX colour and get RGB, HSL, approximate CMYK, relative luminance and contrast ratios against white and black.
FPS Counter
Measure browser FPS with requestAnimationFrame, smoothing, min/max frame rate, warnings and an optional graph. Runs locally with no upload or API.
JSON Formatter
Paste JSON to pretty-print with 2 or 4 spaces, minify it to compact output, or run a quick syntax check before copying the result.
Tool available in other languages
- Trình rút gọn HTML [VI]
- HTML-minifierare [SV]
- HTML-Minifier [DE]
- ตัวบีบอัด HTML [TH]
- Minificateur HTML [FR]
- Minificador de HTML [PT]
- Pemadat HTML [ID]
- HTML 圧縮ツール [JA]
- Minificador de HTML [ES]
- HTML-minifier [NL]
- مصغّر HTML [AR]
- Minifikator HTML [PL]
- HTML 압축기 [KO]
- Минификатор HTML [RU]
- HTML Küçültücü [TR]
- HTML 压缩工具 [ZH]
- Minificatore HTML [IT]