10 Online Tools and Apps to Help Optimize and Format CSS
This feature rich tool takes your CSS file and parses and outputs a leaner version, removing any redundancies and attributes which are not needed. Here is a full list of what it can do:
- Removes commentsa
- Removes white space (such as excess spaces)
- Converts RGB values to Hex (they’re smaller)
- Converts Hex values in the format #RRBBGG to #RGB.
- Changes zero values with a size specified to 0. (0px would change to 0)
- Changes values such as border: 1px 2px 1px 2px; to border: 1px 2px;
- Converts multiple background, font, margin, padding, list attributes into a single attribute
- Converts multiple border values into single attributes
- Option to convert absolute values (PX & PT) into relative values (EM)
- Groups style attributes and values which appear mutliple times into a single style
This tool reads CSS just like a browser would. So using hacks which are browser specific will give random results, make sure any hacks are removed before use.
Styleneat organizes and standardizes your CSS – selectors, sub-selectors and properties – in a structure that makes it easier to define page areas making it easier to see how they relate to each other.
With this tool you have the option of sorting the properties alphabetically, sorting the selectors alphabetically and you have the choice of multi or single line formatting.
CleanCSS is a CSS optimizer and formatter with a reasonable amount of options, that takes your CSS code and makes it cleaner and more concise.
CSS Compressor, obviously compresses the CSS to reduce the code size and make your web pages load faster. You can select from four levels of compression, depending on how legible you want the compressed CSS to be versus degree of compression.
This tool is based on the popular open-source CSS parser and optimizer, CSS Tidy. Code Beautifier offers the most options compared to all of the tools in this article.
You can sort and merge selectors and properties, compress colors and font-weights, choose between lower and uppercase formatting and even has the option to discard invalid properties.
CSS SuperScrub can significantly reduce the size and complexity of your CSS by stripping out unneeded content, stripping redundant calls, and intelligently grouping the remaining element names.
There are limited options with this tool, which is no bad thing, it works exactly as intended: It scrubs your CSS.
Online CSS Optimizer/Optimiser is a web tool for reducing the file size of cascading style sheets. In order to save more space optimized files would be messy even so you may output it as a file. Non-valid or hacked (for certain browsers) CSS files may result in error.
Use this utility to compress your CSS and increase the loading speed of a web page and save a little on bandwidth as well. You can choose from three levels of compression, depending on how legible you want the compressed CSS to be versus degree of compression. The "Normal" mode should work well in most cases, creating a good balance between the two.
It also has the option of an Advanced Mode that gives you more compression options.
The CSS Analyser is a small utilty that allows you to check the validity of your CSS against the W3C's validation service, along with a color contrast test, and a test to ensure that relevant sizes are specified in relative units of measurement.
If the CSS is specified by a URL, it will be loaded into the text area to offer an option to make changes for testing without having to re-upload.
CSS Redundancy Checker is a simple tool with one simple, yet useful function. It is a tool that finds CSS selectors that aren't used by any of your HTML files and any that are redundant it removes.