Minify CSS and HTML to Speed Up Your Website
Minifying removes the characters browsers do not need, making your files smaller and your pages faster. Learn how it works and how to minify CSS and HTML for free.
Every kilobyte your page downloads adds to its load time. Minification is one of the easiest wins: it strips out the spaces, line breaks and comments that make code readable to humans but are ignored by browsers.
What minification actually does
Minified code behaves exactly the same as the original; it is just smaller. Removing whitespace and comments can shave a meaningful percentage off your CSS and HTML, which means faster downloads, especially on mobile.

How to minify safely
- Keep a readable, un-minified master copy for editing.
- Run your CSS through the free CSS Minifier.
- Run your markup through the HTML Minifier.
- Use the minified versions in production only.
Where minification fits
Minification pairs well with other speed steps like compressing images and lazy-loading. On its own it will not transform a slow site, but combined with good asset habits it adds up.