Pular para o conteúdo
Tool

Code Minifier

Minify and compress CSS, JavaScript, and HTML code to speed up your site.

What it is

The CSS and JS Minifier strips everything a browser does not need out of a stylesheet or a script: comments, line breaks, indentation and redundant spaces.

What minifying actually buys you

Smaller files, which means less to download and a page that starts rendering sooner. On a typical stylesheet the saving is 20 to 40 percent before compression, and more once the server gzips it on top.

It matters most on mobile connections and on repeat-heavy files. It matters least on a small file that was already tiny.

How to use it

  1. Paste the CSS or JavaScript.
  2. Minify.
  3. Copy the result into your build or straight into the file you serve.

The rules of doing this safely

Never minify over your only copy. Minified code is unreadable and there is no reliable way back. Keep the source, minify on output.

Test after minifying. For CSS the risk is low. For JavaScript it is real: code that relies on automatic semicolon insertion can break when line breaks disappear, and that failure often shows up only in one browser or one code path.

Do it last. Minify after everything else in your build, never before, or you will be debugging generated code.

If your project already has a build step, it almost certainly minifies for you. This tool is for the cases that do not: a single file, a snippet, a page you maintain by hand, or a quick check of how much a file would actually save.

Nothing is uploaded

The whole operation runs inside your browser. Your file is never sent to a server, never stored and never seen by anyone else. No queue, no daily cap and no account.

Frequently asked questions

How much smaller will my file get?

Typically 20 to 40 percent on a stylesheet before compression, and more once gzip is applied on top. Files that were already small save proportionally less.

Can minifying break my JavaScript?

It can. Code that relies on automatic semicolon insertion may break when line breaks disappear, and the failure can show up in only one browser. Always test the minified output.

Can I get my original code back?

Not reliably. Minified code is unreadable, so keep the source and minify only on output, never over your only copy.

Is my code uploaded?

No. The minification runs in your browser, so nothing you paste is sent anywhere or stored.

About this content

Written by:
Ferramenta Grátis

Related tools