
SQL Minifier
Tokenize SQL strings, quoted identifiers and comments, then collapse whitespace outside those regions.
Open toolMinify HTML fragments or documents locally while preserving script, style, pre, and textarea content.
Enter the inputs, then select Minify HTML.
Result will appear here
The minifier conservatively reduces HTML whitespace and optionally removes ordinary comments while retaining attribute quotes, optional tags, and embedded script or style content.
The result reports original and output UTF-8 byte sizes. Review the actual rendered document after copying it; inline JavaScript and CSS are not separately minified.
The input must contain text and stay within 100000 characters.

Review the input parameters, allowed value ranges, and worked reference cases for the HTML Minifier below before running your calculation.
| Parameter / Scenario | Default / Sample Value | Rule or Allowed Range | Output / Usage Note |
|---|---|---|---|
| Input: HTML | (User supplied) | Input type: textarea | Required workspace parameter |
| Input: HTML comments | (User supplied) | Options: Keep, Remove ordinary comments | Required workspace parameter |
Paste the HTML source and choose whether ordinary comments should remain in the output.
Paste the document or fragment and choose whether ordinary HTML comments should remain. Keep a source copy for a rendered comparison, especially when whitespace carries meaning in the document.
Run the minifier and inspect the output-byte result with original bytes, bytes saved, and reduction. These values describe this particular source, not a general speed improvement.
Copy the minified HTML and review it in its intended page. The result note explains that inline CSS and JavaScript are not minified. Check whitespace-sensitive and preformatted areas before replacing a file.
Compare baseline and alternative runs for HTML Minifier before exporting the result.
Minify a reviewed fragment for a system that accepts HTML text, then check that system output separately. Keep the original readable fragment as the editing source. A compact copy is less suitable for continuing manual edits or discussing markup structure.

Use the reported UTF-8 byte counts to compare this source before and after processing. Those counts describe the markup only. They do not include images, network compression, external stylesheets, or the other resources that affect actual page loading.

Try a representative source sample when evaluating a minification step in a build process. Include markup where whitespace matters, rather than testing only empty structural tags. The local result can expose a review concern but is not an integration test of that build.

Review the calculated output alongside your entered parameters and unit conventions.
Every calculation follows the rule: Collapse HTML whitespace conservatively; retain attribute quotes, optional tags, and inline JavaScript/CSS content. Because JavaScript uses IEEE 754 double-precision floating-point arithmetic, numeric outputs display up to 12 significant digits where applicable.
Always cross-check the displayed result against the scope note (Input is not rendered or executed. Whitespace can be meaningful in HTML and templates, so review the output before using it. The tool does not minify CSS or JavaScript, and accepts up to 100,000 characters) before applying the value to production specifications, financial models, or lab records.

Test the resulting document in its intended page after checking the source and comment option.
Operational scope: Input is not rendered or executed. Whitespace can be meaningful in HTML and templates, so review the output before using it. The tool does not minify CSS or JavaScript, and accepts up to 100,000 characters. Inputs that violate minimum/maximum bounds or required format rules are rejected with a clear diagnostic prompt.
Need an adjacent calculation in Developer Tools? Use the related tools linked below to chain your workflow without leaving your browser.


Tokenize SQL strings, quoted identifiers and comments, then collapse whitespace outside those regions.
Open tool
Remove scripts, event handlers and unsupported markup from basic HTML. Review the cleaned fragment and a contained preview.
Open tool
Remove line-break indentation from element-only XML; keep inline spaces, mixed text and xml:space="preserve".
Open toolChoose another tool for your next calculation, conversion, or text task.

Convert an HTML fragment to JSX with React attribute names, style objects and self-closing elements.
Open tool
Validate whitespace- or comma-separated integer codes from 0 to 127 and map them to ASCII characters.
Open toolMinify CSS while retaining strings, custom properties, and rule order.
Open tool
Encode ampersands, angle brackets and quotes, or decode recognized HTML character references without executing markup.
Open toolAnswers about using HTML Minifier and understanding its results.
Whitespace inside pre and textarea elements is preserved.
No. The tool treats the input and result as text in an isolated processing worker.
No. Script and style content is retained; those languages are not minified by this tool.
Yes. Choose Keep or Remove ordinary comments before running the minifier.
Choose another tool for your next calculation, conversion, or text task.