CSS Minifier - DigiKitApp
Strip unnecessary whitespace from CSS code.
When should you use this?
Use this to shrink a website's file size before launch, stripping unnecessary whitespace and comments to speed up page load.
When shouldn't you use this?
During development, minified code is hard to read and edit; only minify as the final step right before going live.
Step-by-step
- Paste the final version of the stylesheet you're about to publish into the CSS code field.
- Click Run.
- Copy the compact output and save it as a separate file, such as style.min.css. Keep the readable original.
- Point the link in your HTML to the new file, then open the page in a couple of browsers to confirm nothing looks broken.
Example
You've built a one-page landing site and your style.css is full of comments, blank lines and indentation. Paste it in and minify it, and the same rules come out on a single line with the extra whitespace gone. Upload that file and reference it from your HTML. When you need to change a colour later, edit the readable style.css and run the minify step again.
What does CSS minification do?
CSS minification shrinks the file by removing spaces, line breaks and comments that the browser does not need. A smaller file downloads faster and the page shows sooner. Behaviour stays the same; only readability drops. So a common practice is to keep a readable version for development and ship the minified one.
Tips when minifying
- Keep your original CSS; the minified file is hard to edit.
- If your server has gzip or brotli compression the gain grows further.
- Check the page's appearance after minifying.
- Deleting unused CSS can save more than minifying.
Things to keep in mind
- The minified file is build output, not your source. Name the two files clearly so you never edit the wrong one.
- If your server has gzip or Brotli enabled, the file is already compressed on its way to the browser. Minifying still helps, but most of the saving comes from using both together.
- Comments that carry licence text, like a library's copyright notice, may be stripped. If the licence requires keeping it, check the output.
- Browser caching can keep serving visitors the old file. Adding a version number to the file name avoids that.
Frequently asked questions
Is the code/data I enter stored anywhere?
No, nothing is sent to a server or stored; processing happens entirely in your browser.
Does it work with large inputs?
Yes, though performance may degrade with very large inputs (several MB or more).
Is this tool free?
Yes, it's completely free for core use and requires no account.