CSS Minifier
Why use a private CSS minifier?
Stylesheets often reveal more than they seem to: unreleased product names in class names, internal hostnames in asset URLs, and the structure of pages that aren't public yet. Online minifiers that process CSS on a server keep a copy of all of it.
formatvault minifies CSS with lightningcss, a modern CSS engine compiled to WebAssembly, running entirely in your browser. Unlike many older minifiers, it understands native CSS nesting, so nested rules come through intact instead of silently disappearing.
How it works
lightningcss parses your stylesheet into a syntax tree, then removes whitespace and comments, shortens colors and lengths, merges rules with identical declarations, and prints the result as compactly as possible. Modern syntax is kept exactly as written; nothing is rewritten for older browsers. License comments starting with /*! are preserved.
The engine loads once, the first time you minify, and runs in a Web Worker so the page stays responsive. Invalid CSS is reported with its line and column rather than guessed at. The size bar compares original, minified, and gzipped sizes, and the diff view shows exactly what changed.
Common use cases
- Minifying stylesheets for sites without a build pipeline
- Shrinking CSS for HTML email templates and embedded widgets
- Compressing styles before pasting them into a CMS or theme editor
- Checking how much a stylesheet shrinks when minified and gzipped
- Stripping comments from CSS while keeping required license headers
- Validating CSS — the minifier pinpoints syntax errors by line and column
Frequently asked questions
- Is my CSS uploaded anywhere?
- No. The minifier runs as WebAssembly in a Web Worker inside your browser. Your stylesheet is never sent to a server, logged, or stored — closing the tab discards it.
- Does it support CSS nesting and modern syntax?
- Yes. Native nesting, custom properties, :has(), :is(), @layer, @container, and modern color syntax are all preserved. Many older online minifiers silently delete nested rules; this one keeps them intact.
- What does the minifier change?
- It removes whitespace and comments, shortens colors and values (for example #ff0000 becomes red and 0px becomes 0), merges rules with identical declarations, and drops redundant declarations. It does not rewrite your CSS for older browsers.
- Are license comments kept?
- Yes. Comments starting with /*! are preserved, which is the convention for license and copyright notices. All other comments are removed.
- Why is my CSS reported as invalid?
- The minifier refuses to guess at broken CSS rather than silently dropping parts of it. The error bar shows the line and column. Common causes are a missing colon or brace, SCSS or Less syntax (variables like $gap, mixins), and old IE hacks such as *zoom.
- Can I minify SCSS or Less?
- No. Compile SCSS or Less to CSS first, then minify the result.