Skip to main content
Z

HTML Minifier — Compress HTML, Inline CSS & JS Online

Minify HTML with html-minifier-terser. Collapses whitespace, removes comments, inline CSS / JS minification. Size savings shown live.

Free No signup Client-side Privacy friendly Updated

Size:

Size: · saved %

Working…

How to use

  1. 1 Paste your HTML on the left.
  2. 2 Toggle whitespace collapse, comment removal, inline CSS / JS minification.
  3. 3 Click Minify — see size savings instantly.

Why use this tool

  • Powered by html-minifier-terser — the maintained successor to html-minifier.
  • Inline <style> blocks are passed through clean-css; inline <script> blocks through terser.
  • Library is lazy-loaded — page is light until you click Minify.
  • Side-by-side size comparison and direct file download.

Frequently asked questions

Will it break my HTML?

Conservative defaults keep attribute quotes, void-element tags, and DOCTYPE. Test before deploying to production templates.

How do I format it back?

Use the <a class="underline" href="/html-formatter">HTML Formatter</a> to pretty-print the minified output for inspection.

Does it minify SVG inside HTML?

Whitespace and comments inside SVG are collapsed, but element-specific SVG optimisation is not run — use SVGO separately for that.

What is HTML Minifier?

An HTML Minifier is a tool that reduces the size of HTML markup for faster page loads. Built on html-minifier-terser, it collapses whitespace, removes comments, and minifies inline CSS and JavaScript, while showing the size savings live. Running entirely in the browser, it minifies HTML client-side so the markup is never uploaded to a server.

Features

Whitespace & comment removal

Collapses redundant whitespace and strips comments while preserving rendered output.

Inline CSS & JS minify

Minifies <style> and <script> contents too, via html-minifier-terser.

100% private

Minification runs on your device — nothing is uploaded.

Example

Input

<div>  <!-- c -->  <p>Hi</p>  </div>

Output

<div><p>Hi</p></div>

Common use cases

  1. 1

    Speed up page loads

    Cut HTML payload size to improve load time and Core Web Vitals.

  2. 2

    Minify email templates

    Shrink transactional email HTML before sending.

  3. 3

    Prepare for production

    Strip comments and whitespace from a template as a build step substitute.

Summary

Zerethon's HTML minifier shrinks markup for faster page loads using html-minifier-terser, entirely in your browser. It collapses whitespace, removes comments, and minifies inline CSS and JavaScript, showing the size saving live. The markup is processed client-side and never uploaded.

Category
Developer
Pricing
Free
Privacy
Browser-based
Signup
Not required

References

Privacy

Your data never leaves your browser unless explicitly stated. HTML Minifier runs entirely client-side — no server upload, no logging, no tracking of your input.

Related tools

Build, share, and grow on Zerethon Social

Free signup. Earn points, collect achievements, and connect with creators worldwide.

Sign up free