DEVELOPER TOOLS

CSS, JavaScript and HTML minifier

Paste your code to make it smaller for the web. It is processed in your browser and never uploaded.

What does minifying do?

It removes what browsers do not need: comments, line breaks, indentation and spare spaces. The code does the same thing but downloads faster. Keep your original, readable files; minified code is for publishing, not editing.

What each one changes

CSS
Removes comments and unneeded spaces and the last semicolon in each block. It does not merge rules or rewrite values, so nothing about your styles changes. Comments starting with /*! are kept for licences.
JavaScript
Uses Terser, the minifier behind most build tools. It removes comments and spaces, simplifies code and, if you allow it, shortens the names of local variables. Names other code might rely on are left alone.
HTML
Removes comments and collapses runs of spaces to one. Text inside <pre>, <textarea> and <script> is not touched.

How much smaller will my files get?

It depends on how many comments and how much indentation they have; a quarter to a half is common before compression. Web servers also compress files in transit (gzip or Brotli), so the saving your visitors see is smaller than the figure shown here, but still real.

Is my code uploaded?

No. Everything runs in your browser and this page loads no ads.

Related tools

Minify data in the JSON formatter, compress pictures with the image compressor, or browse all utilities.