Esta página aún no está traducida al español, así que la mostramos en inglés.

CSS Minifier

Paste a stylesheet to shrink it instantly. You’ll see the original and minified size, the percentage saved and the gzipped size — and you can beautify it back at any time.

Actualizado el
 
Minified CSS
 

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: CSS Minifier

  1. Paste your CSS, drop a .css file onto the input, or click Sample.
  2. Leave the optimizations on (all are safe) or untick any you don’t want.
  3. Check the savings below the editor, then Copy or Download styles.min.css.
  4. Need to read a minified file instead? Switch to Beautify.

What is CSS minification?

CSS minification removes every byte the browser doesn’t need — comments, indentation, line breaks, the last semicolon in each rule — and rewrites some values into shorter equivalents. The resulting stylesheet is functionally identical but smaller, so it downloads and parses faster. Because CSS is render-blocking, a smaller stylesheet can directly improve First Contentful Paint and Largest Contentful Paint.

What this minifier changes

OptimizationBeforeAfter
Comments & whitespace/* Buttons */ .btn , .link { … }.btn,.link{…}
Last semicolon{color:red;}{color:red}
Colors#FFFFFF, #aabbccdd#fff, #abcd
Zero unitsmargin:0px 0emmargin:0 0
Numbers0.50rem, 1.0.5rem, 1
Empty rules.unused{}(removed)

Why it is safe

Aggressive minifiers sometimes break stylesheets. This one only applies transformations that can’t change behavior:

  • Strings, url() values and escaped characters are protected and never modified.
  • Units are only dropped on lengths — 0s, 0deg and 0% keep theirs (transition: 0s and keyframe selectors need them), and nothing inside calc(), min() or clamp() is touched because calc(0 + 10px) is invalid.
  • The flex shorthand is skipped (flex: 1 1 0px and flex: 1 1 0 are not always equal in older engines), and custom property values only lose redundant spaces.
  • Whitespace in selectors is kept where it means something: a :hover (any hovered descendant) differs from a:hover.
  • @layer name {} is kept even when empty, because it declares layer order. License comments starting with /*! are preserved by default.

Minification vs. compression

Minifying and gzip/Brotli compression stack. Compression removes repetition; minification removes bytes compression can’t, such as comments. The Gzipped output figure shows roughly what will travel over the network if your server compresses responses (most do). For the biggest win, also remove unused rules with a tool like PurgeCSS, and inline only the critical CSS for above-the-fold content.

Want to inspect a minified file? Use Beautify mode here or the CSS Formatter. Checking a whole page’s performance? Run a page speed test.

También se busca como: minify css, css compressor, compress css, css optimizer, reduce css size, css minify online, cssnano alternative, css uglify.

Herramientas que combinan con: CSS Minifier

  • HTML Formatter — Paste minified or messy markup and get clean, consistently indented HTML — including embedded <style> and <script> blocks.
  • JavaScript Formatter — Unminify and pretty-print JavaScript, JSON or JSX with your preferred indentation and brace style — or strip whitespace and comments with a verified minifier.
  • Compresor de imágenes — Reduce el tamaño de las fotos y los gráficos entre un 50 % y un 90 % sin que se note ninguna pérdida de calidad.
  • SQL Formatter — Paste a query — or a whole migration — and get readable SQL with one clause per line, aligned joins and consistent keyword case, using the grammar of your database.

Preguntas frecuentes

Can minifying break my CSS?
Not with these settings: every optimization is limited to cases where the result is equivalent (for example units are only removed from zero lengths outside calc()). If your original CSS has a syntax error, the error stays in the output, so validate CSS that behaves strangely.
How much smaller will my CSS get?
Hand-written, commented CSS typically shrinks by 20–40%. Already-compact framework builds save less. The stats panel shows the exact saving and the gzipped size.
Should I still use gzip or Brotli?
Yes. Minification and HTTP compression complement each other: minify first, then let your server or CDN compress the file. Together they usually cut CSS transfer size by 80–90%.
Why are some comments kept?
Comments starting with /*! conventionally contain license notices that must stay with the code. Untick “Keep /*! license */ comments” to remove them too.
Does it remove unused CSS?
No. Finding unused selectors requires your HTML and JavaScript — use a tool like PurgeCSS or the Coverage tab in Chrome DevTools for that.
Is my stylesheet uploaded?
No, minification runs locally in your browser and nothing is sent to a server.
¿Puedo instalar CSS Minifier como aplicación web y utilizarla sin conexión?
Sí. CSS Minifier es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas