Code Minifier
Minify HTML, CSS and JavaScript by removing comments and whitespace. See how much you reduce. 100% in your browser.
Built by
Miguel Ángel Colorado Marin (MACM)
Built by
Miguel Ángel Colorado Marin (MACM)
Full-Stack Developer · Guadalajara, España
I develop web apps, digital tools and full projects — from design to deployment.
The code minifier reduces the size of your HTML, CSS and JavaScript files by removing unnecessary comments, whitespace and line breaks, so your website loads faster and uses less bandwidth. Paste your code, pick the language and you get the minified version along with the percentage of size saved, ready to copy or download. Minifying is a basic web optimization and performance practice, especially useful before pushing assets to production. It supports the three most common front-end languages. The whole process runs in your browser with JavaScript: your code is never sent to any server, so you can minify even private or proprietary code safely.
Features
- ✓Minify CSS
- ✓Minify HTML
- ✓Minify JS (basic)
- ✓Percentage saved
- ✓Copy result
- ✓100% in browser
How to minify code?
- 1
Choose the language
Select CSS, HTML or JS depending on the code you want to minify.
- 2
Paste your code
Paste the code into the left box. Everything is processed in your browser, nothing is uploaded.
- 3
Minify
Click Minify: comments and extra whitespace are removed and you'll see the reduction percentage.
- 4
Copy
Copy the minified code to clipboard, ready for production.
Frequently asked questions
Is my code uploaded to a server?
No. Minification happens 100% in your browser. Your code never leaves your device.
Is JS minification safe?
JS minification is basic: it strips comments and whitespace. For critical production use a bundler like esbuild or terser, which also renames variables.
How much is size reduced?
It depends on the code, but in CSS and HTML with many comments and spaces it's common to save between 20% and 50%.
Does it keep conditional comments?
In HTML, Internet Explorer conditional comments (<!--[if ...]-->) are kept; the rest is removed.
Related tools
Embed Code Minifier on your site
Add Code Minifier to any web page with a simple iframe. Free, with attribution to miguelacm.es.
<iframe
src="https://miguelacm.es/embed/code-minifier"
width="100%"
height="700"
frameborder="0"
title="Code Minifier — miguelacm.es"
></iframe>View embed in new tab →