The pages of your website will load faster if the code of CSS files is compressed. To do this, use our simple CSS minify tool. In some cases, you can compress CSS file by more than 90%, which allows to increase the speed of pages downloading on the website. This is especially important for mobile visitors. Sites that load faster are ranked higher in the search engine. As a result website will get more visitors.

Paste CSS code here


Or URL to CSS file

CSS compression result

This tool was used 33 times


Compress CSS to reduce load times

If the site uses CSS, the server must pass it to the browser every time it requests a resource. And this has an impact on the download speed. The more complex and voluminous the style files, the longer the visitor will wait for the site to fully load. By using CSS compression, you can reduce the size of your code and improve the performance of your site.

CSS Optimization Capabilities

Loading times are an issue when it comes to transferring data to mobile devices. This has led to an expansion of the range of tasks that can be solved with CSS. As a result, the Cascading Style Sheets language is adopting more and more features that JavaScript was previously responsible for. CMS templates often use bloated CSS files that hinder site performance.

In this article, we'll show you a few techniques you can use to compress CSS and JS.

Avoid overusing inline CSS styles (hosted in HTML) unless it is relevant to the top of the page. The same goes for style tags (individual CSS properties that deviate from established standards);
Combine multiple CSS files in a PHP script. Thus, the client only has to call the PHP file instead of sending an HTTP request for each style file;

Compressing CSS implies using shorthand property forms when possible:

body {margin: 20px 10px 5px 10px}
instead of the full form:

body {margin-top: 20px;
margin-right: 10px;
margin-bottom: 5px;
margin-left: 10px}

Avoid unnecessary use of code. If certain tags are placed in only one tag (for example, in a list), then the element should not be mentioned twice;

Use HEX instead of RGB to set the color;
The universal selector "*" should only be used in exceptional cases. Style settings made through the universal selector apply to all elements, so the browser must first ensure that the appropriate guidelines are followed for all elements;

Minify CSS files by removing unnecessary spaces, blank lines, and comments. Spaces are not needed, such as after a colon or semicolon. The final semicolon after the last character in the list can also be omitted;
Since minifying CSS is a complex process, it is imperative to create a backup copy of the file. This will help you fix the errors.

Compress CSS: online and offline tools

There are various online and offline applications for compressing CSS code. The tools take on the task of removing spaces, indents, comments, and line breaks. Most programs also support the color code conversion function. They allow you to download the result as a CSS file or copy the code.