Skip to content
Toolars
Explore
Report bug

Developer · Local utility

HTML Minifier

Minify HTML in a local Worker — comments removed, whitespace preserved — with byte statistics on up to 256 KiB of markup.

Task path / input to outcome

Paste the markup

Runs locally · Nothing is uploaded

How HTML Minifier works, privacy, and related tools

Task path / input to outcome

How to minify HTML

  1. 01

    Paste the markup

    Paste UTF-8 source up to 256 KiB. The indent control is disabled for Minify.

  2. 02

    Try the sample first

    Sample loaded. Run the local transformation when ready.

  3. 03

    Press Minify

    Press Minify to remove HTML comments without collapsing HTML whitespace. Inline CSS and JavaScript remain unchanged. Check the output in the target page.

  4. 04

    Check the statistics

    Compare UTF-8 input and output bytes and the savings percentage. A negative saving means the result grew; inspect it before copying or downloading.

  5. 05

    Copy or download the result

    Use Copy result for the clipboard or Download to save toolars.min.html. Reset clears the panes for the next document, and the statistics reset along with the workspace.

Tool facts

Processing
In your browser
Input leaves this device
Never
Retention
Nothing is stored
Price
Free

Your input stays in the browser.

HTML Minifier uses its verified local execution path and does not create a hidden input or output history.

Local execution

Runs inside the current browser tab.

No hidden processing

Active tool data never becomes a Toolars document record.

No account required

Use the core workflow without creating a profile. Favorites sync to your account after you sign in.

Immediate reset

Clear the tab and the active working data is gone.

When HTML Minifier is useful

Code reviews

Make source easier to inspect before sharing it with another developer.

Build artifacts

Create compact HTML, CSS, or JavaScript without executing the source.

Copy-ready snippets

Format a focused example and move it directly into documentation or an editor.

What HTML Minifier actually does

For a generated email template containing review comments, paste a representative excerpt, minify it, and compare it with the original in the email renderer. Inspect whitespace-sensitive copy and embedded styles before downloading.

Common questions

What does the minifier remove?
It removes HTML comments and shortens supported markup without collapsing whitespace. It does not minify embedded style or script code.
Which engine does the minifying?
HTML is parsed with Prettier and minified with html-minifier-terser inside a local Worker. The configuration preserves HTML whitespace and disables inline CSS and JavaScript minification. Review template output in the application where it will run.
Does it minify inline CSS and JavaScript too?
No. Style and script blocks inside the markup are left untouched — only the HTML structure is minified, and the markup around those blocks still shrinks normally. Minify the embedded parts separately with the dedicated CSS and JavaScript tools, which share the same 256 KiB budget and the same local-only contract.
Why did my output grow instead of shrink?
This configuration preserves whitespace, quotes and optional tags, so removing comments may save little; serialized markup can even be larger. Compare the byte counts and keep the original.
What are the limits, and how are errors handled?
Input is limited to 256 KiB and output to 512 KiB. The local Worker has separate five-second startup and run budgets; editing or Cancel stops it. Source stays in this browser; nothing is uploaded.
Is my markup uploaded or executed?
No. Source is parsed inside a local Worker and is never executed, uploaded or saved. Parser acceptance is not application correctness or browser compatibility.

Continue in Developer

Related tasks, not a dead end.

Move into another focused workspace without returning to the full index.

Code to Image Converter

Export syntax-highlighted code as PNG or SVG for six languages with light and dark themes, line numbers, a window title, and 1x or 2x scale.

Create

URL Slug Generator

Turn titles into clean URL slugs with hyphens or underscores — accents stripped, ampersands expanded, non-Latin scripts preserved — live as you type.

Create

React Native Shadow Generator

Compare legacy shadow properties and boxShadow for React Native, tune iOS and Android output side by side, and copy the StyleSheet code.

Create

Base64 Encoder/Decoder

Encode Unicode text to Base64 or decode it back with live validation, URL-safe and UTF-8 options, and a swap button for round trips.

Convert