Code Minifier

Compress HTML, CSS or JavaScript by removing whitespace and comments. The language is detected automatically. JavaScript uses Terser in its safest mode — no variable renaming, no logic changes. See the size reduction in bytes after minifying.

How to use

1

Paste your code

Drop HTML, CSS or JavaScript into the input field.

2

Click Minify

The minifier detects the language automatically and strips whitespace and comments.

3

Read the result

See the minified code and the size reduction in bytes.

4

Copy or download

Copy the minified code or save it as a file.

477 B→0 B−100%
Source code
Minified

Features

HTML, CSS and JavaScript

One tool for all three — the language is detected automatically.

Safe JavaScript mode

Uses Terser with compression and mangling disabled — the safest possible mode.

Preserves pre and code blocks

HTML minifier leaves the contents of pre, textarea, script and style untouched.

Size comparison

See original and minified size side by side.

Error display

Shows clear errors if the code is malformed.

Common use cases

  • Minify CSS before deploying a website
  • Compress JavaScript for production
  • Reduce HTML file size for faster page loads
  • Check how much smaller minified code is

Frequently Asked Questions

Related tools