Minify CSS

Make CSS, HTML and JavaScript smaller without breaking them

Minified code

Comments, spaces and line breaks are removed. Names and values stay as they are, so the code works the same.

Everything happens in your browser: your text is never sent anywhere.

How to minify CSS

Step 1

Paste your CSS into the first field

Step 2

See the minified code and the bytes saved

Step 3

Copy the minified CSS into your site

What minifying CSS does

Spaces, line breaks, indents and comments make a style sheet easy to read for people, but browsers don't need them. Paste your CSS, and the minified code appears as you type, with its size in bytes and how much was saved. Only what changes nothing is removed: the space in a descendant selector such as nav a stays, because nava would be another selector, and so do the spaces that calc() needs. Comments that start with /*!, which usually hold a license, are kept.

The same tool also minifies HTML and JavaScript: choose the language above the field. For HTML, “Remove comments” deletes the comments, and “Also minify the CSS and JavaScript inside” minifies the style and script blocks of the page as well. JavaScript is first checked by your browser, and if the code has an error, the tool shows it instead of minifying the code. Minifying adds to the gzip or Brotli compression of the server, as the two shrink the file in different ways. Your code is not sent anywhere.

Was AnyTextEditor useful to you?

Hello. We tried very hard to create a convenient website that we use ourselves. If you liked any of our tools and editors, add it to your bookmarks, because it will be useful to you more than once. And don't forget to share on social media. We will be better for you.