Skip to content
GigAI Tools

CSS Minifier: Compress & Optimize CSS Online

Paste your stylesheet and get production-ready, minified CSS instantly. Powered by csso, it doesn't just strip whitespace. It merges duplicate selectors, collapses shorthand and shortens colors, then shows exactly how many bytes you saved. All client-side, nothing uploaded.

100% browser processingFree · no sign-up
Loading tool…

What is the css minifier?

Compressing stylesheets with the csso engine, the CSS Minifier does structural optimisation (not just whitespace stripping) and reports exact bytes and percentage saved. Toggle restructuring off for a conservative, auditable pass, and minify live as you type, paste or import. Free and fully in-browser, your CSS stays on your device.

The GigAI CSS Minifier is a desktop-grade CSS compressor that runs entirely in your browser on top of the csso optimizer. Unlike naive minifiers that only delete spaces and newlines, csso performs true structural optimisation: it merges rules with identical selectors, groups selectors that share the same declarations, removes overridden and duplicate properties, collapses longhand into shorthand where it is provably safe, shortens hex colors and other values, and drops empty rulesets and comments. The result is the smallest byte-for-byte equivalent stylesheet, and the tool shows you the original size, the minified size and the exact percentage saved so a build-step decision takes seconds. You can optionally keep the safer whitespace-only behaviour by turning restructuring off, or preserve licence and attribution comments. Everything is live as you type, with drag-and-drop or paste import, one-click copy and download of a.min.css file, undo/redo history, keyboard shortcuts and shareable links. Because csso executes locally in your tab, your stylesheets, including unreleased design systems and client work, are never uploaded, logged or seen by anyone. Close the tab and it's gone.

Difficulty:
Easy
Typical time:
~15s
Processing:
100% browser processing

Last updated

How to use the css minifier

  1. 1

    Paste, drop or import CSS

    Paste into the left editor, drag a .css file onto it, or click to browse. Or load the built-in sample to try it in one click.

  2. 2

    Choose your options

    Leave restructuring on for maximum compression, or turn it off for a safe whitespace-only pass. Optionally keep comments. Everything re-runs live.

  3. 3

    Check the savings

    Read the original size, minified size and percentage saved in the badges above the output to confirm the win.

  4. 4

    Copy, download or share

    Copy the minified CSS, download it as a .min.css file, or share a link that reopens the tool with your stylesheet pre-loaded.

What CSS Minifier includes

  • Structural optimisation, not just whitespace

    csso merges duplicate selectors, groups shared declarations, drops overridden properties and empty rules, and collapses shorthand: savings a space-stripper can never reach.

  • Exact bytes & percentage saved

    See the original size, the minified size and the precise percentage shaved off, measured in real UTF-8 bytes so it matches what ships over the wire.

  • Restructure & comment controls

    Toggle aggressive restructuring off for safe whitespace-only minification, or keep licence and attribution comments intact when you need them.

  • Live as you type

    Minification runs on every keystroke with a smart debounce, so the output pane and size badges stay in sync without hunting for a button.

  • Drop, paste or import

    Drag a .css file onto the editor, paste from the clipboard, or click to browse. Copy, download a .min.css, or share a link to the result in one click.

  • 100% in your browser

    csso runs on your device via a lazy-loaded module. No stylesheet is uploaded, stored or logged, safe for unreleased design systems and client work.

Why use our css minifier

Ship smaller stylesheets

A smaller CSS file means faster first paint and less bandwidth. The before/after badge shows the exact win before you wire it into a build step.

Skip the build config

Need a quick minified stylesheet without spinning up PostCSS or a bundler? Paste, copy the result, and move on. No toolchain, no install.

Safe when you need it

Turn restructuring off for a conservative, whitespace-only pass when a stylesheet relies on source order or you want a minimal, auditable diff.

Private by design

Because it runs locally, you can minify proprietary or unreleased CSS with confidence, none of it ever leaves your machine.

Built for the way you work

From quick one-off fixes to daily workflows, see how people put this tool to use.

  • Frontend developer

    Ship a hand-written stylesheet

    Minify a component or utility stylesheet before dropping it into production when there's no bundler in the loop, and confirm the byte savings first.

  • Web performance engineer

    Trim critical CSS

    Compress an above-the-fold critical-CSS block to inline in the <head>, keeping the HTML payload as small as possible for a faster first paint.

  • Email developer

    Compact email CSS

    Squeeze inline-ready styles for HTML email where every byte and every duplicate rule counts against client size limits.

  • Agency / freelancer

    Optimize a client handoff

    Deliver a minified stylesheet alongside the source without exposing unreleased work to a third-party server.

Supported formats

Accepts CSS and TXT, and produces CSS and MIN.CSS, all processed locally in your browser.

Input formats
  • CSS
  • TXT
Output formats
  • CSS
  • MIN.CSS

Frequently asked questions

Common problems, solved

Hit a snag? Here are quick fixes for the issues people run into most.

  • My layout broke after minifying.

    Aggressive restructuring can merge or reorder rules in ways that expose an existing specificity or source-order dependency. Turn restructuring off for a whitespace-only pass, then re-test. The diff will be far smaller and safer.

  • My licence comment was removed.

    By default comments are stripped. Enable 'Keep comments' to preserve licence and attribution blocks. Note that only comments starting with /*! are treated as important by most tooling.

  • The output looks the same size as the input.

    Your CSS may already be minified, or it might be tiny. The size badges show the exact before/after bytes. If the percentage saved is near zero there simply isn't more to remove without changing behaviour.

  • It reports a parse error on valid-looking CSS.

    csso needs syntactically valid CSS. A stray unclosed brace, an unterminated string or an at-rule the parser doesn't recognise can trip it, the error message points at the problem so you can fix and re-run.

Get the most out of it

  • Leave restructuring on for the smallest possible output. Turn it off only when a stylesheet depends on source order.

  • Press Ctrl/Cmd+Enter to re-run instantly and Ctrl/Cmd+S to download the minified .min.css.

  • Use the percentage-saved badge to justify adding a minify step to your build. The number is the real wire savings.

  • Keep licence comments by starting them with /*! and enabling 'Keep comments'.

  • Minify critical CSS separately and inline it in the <head> for the fastest first paint.

What's new

Recent updates and improvements to the css minifier.

  1. Initial release, live csso minification, restructuring and keep-comments toggles, before/after byte + percentage-saved stats, drag-drop import, undo/redo and shareable links.

  2. Added keyboard shortcuts (run, download, clear, undo/redo) with an in-tool shortcuts helper and a curated sample stylesheet for the empty state.

  3. Refined parse-error messages and improved the size badges to distinguish structural savings from whitespace-only compression.

Your privacy is built in

Your CSS is parsed and minified entirely in your browser by a locally-loaded csso module. It is never uploaded to any server. Nothing is stored, logged or transmitted, so you can safely minify proprietary design systems or client stylesheets. Close the tab and every trace is gone.

  • Runs in your browser
  • No uploads
  • Nothing stored

Ready to try the css minifier?

Free, private and instant. CSS Minifier runs right in your browser.