HTML Minifier: Compress Markup and Measure Byte Savings
HTML Minifier turns pasted or dropped HTML into a more compact version by parsing it with the browser’s DOMParser, removing comments, collapsing whitespace, and minifying inline CSS and JavaScript. Choose the available minification options, then review the output alongside before-and-after byte counts and the percentage saved. IE conditional comments are preserved, so you can check the compact result before using it.
HTML Minifier is a browser-based HTML minifier that creates a compact version of your markup. Paste or drop in HTML to convert it online, then review the output alongside the original and see the byte counts and percentage saved. It uses the browser’s DOMParser to parse and re-serialize the HTML.
During minification, comments are removed, whitespace is collapsed, and inline style and script blocks are minified. You can choose the available minification options, although the tool’s behavior is limited to the options it provides. IE conditional comments are preserved. The before-and-after size figures help you see the result rather than relying on an estimate.
HTML is markup used to describe the structure of a page, while CSS defines styles and JavaScript provides scripting. Minification removes or reduces content such as comments and whitespace to make the serialized markup more compact. Developers may use a smaller HTML payload when shipping a page or placing markup in a URL, header, or configuration value. Always review the generated result for your intended use.
The HTML Minifier runs entirely in your browser: your input is processed on your device and is not uploaded, stored, or sent to a server. Once the page has loaded, it works offline because it has no server dependency. The tool is free and useful for developers and DevOps engineers who want to compact HTML and check byte savings without sending their markup elsewhere.
Step 1: Paste your HTML
Step 2: Choose the minification options
Step 3: Copy the compact result
Use case: Shrink HTML for shipping without changing what it means.
Use case: Compare the size before and after to judge whether minifying is worth it.
Use case: Produce a compact HTML payload for a URL, a header, or a config value.