CSS, JS & HTML minifier
Minify CSS, JavaScript and HTML to shrink file size — strips comments and whitespace, with a before/after size comparison.
How to use
Pick CSS, JavaScript or HTML, paste your code, and it's minified instantly — comments and unnecessary whitespace are stripped to make the file as small as possible. A live counter shows the before-and-after character count and how much you saved.
Smaller files load faster, which improves page speed and Core Web Vitals. Copy the minified output and drop it into your build, a CDN or an inline tag. CSS and HTML are minified with safe, built-in logic; JavaScript is minified with Terser, the same engine many build tools use.
Everything runs in your browser, so your code is never uploaded — handy for quick one-off minification without a build step.
Examples
Minify a CSS file to cut its size before shipping it to production.
Minify a small JS snippet to paste inline without the extra weight.
Strip whitespace and comments from HTML to reduce its size.
Frequently asked questions
Does minifying change behaviour?
No. Minification only removes whitespace, comments and (for JS) shortens local names — the code runs exactly the same.
What does it use to minify JavaScript?
Terser, the widely used JS minifier, so the output matches what most modern build pipelines produce.
Is HTML minification safe for <pre> and scripts?
Yes. Content inside <pre>, <textarea>, <script> and <style> is preserved so nothing breaks.
Is my code uploaded?
No. Minification happens entirely in your browser, so your code stays on your device.
Related tools
Beautify JavaScript, TypeScript, JSON, CSS, HTML, Markdown, YAML and GraphQL with Prettier.
Format and beautify SQL queries with proper indentation and keyword casing, for MySQL, PostgreSQL, SQL Server and more.
Strip comments, metadata and whitespace from SVG markup to shrink its size.
Format, validate and minify JSON with precise error locations and key sorting.
Build linear, radial and conic CSS gradients with multiple color stops and a live preview.