JS, CSS & HTML Minifier

Shrink your code so your pages load faster.

Your code

Minified in your browser. Your code is not uploaded.

Result

Shorten variable names
Keep important comments
Guide

How to minify code

1

Choose the language

Pick JavaScript, CSS or HTML.

2

Paste or open your code

Paste it in, or open a file.

3

Minify and copy

See how much smaller it got, then copy it or download it.

Frequently asked questions

Is my code uploaded?

No. It is minified in your browser, so it never leaves your device.

What does minifying do?

It removes comments, spaces and line breaks, and can shorten variable names and combine rules, so the file is smaller and loads faster. It does the same job as the original.

Will it break my code?

Minifiers are careful, but always test the result. For JavaScript, turn off Shorten variable names if your code depends on function or variable names.

Why does it say there is an error?

The code has a mistake the minifier cannot read past, such as a missing bracket. The message shows the line and column.

Does it keep my comments?

No, by default. Turn on Keep important comments to keep licence notes (those starting with /*! or @license).

Is there a size limit?

Up to 2 MB of code at a time.

Related tools

See all text & utilities →