Paste HTML, CSS or JavaScript and make it smaller. The language is detected for you.
0 bytes uploaded to our server
Runs entirely in your browser: 0 bytes uploaded. Your files and text never leave your device. Privacy
What minifying does
Minifying removes everything a browser does not need: comments, extra spaces and line breaks. For JavaScript it also shortens variable names and simplifies code. The result works the same but downloads faster.
Your server should also compress files with gzip or Brotli. The gzip numbers above show the real size sent over the network; minifying first usually saves another 10–30% on top.
How each language is handled
- JavaScript uses Terser, the minifier behind most modern build tools. If your code has a syntax error, we show where.
- CSS: comments and whitespace are removed carefully. Spaces inside
calc(), strings andurl()are kept, because removing them would break your styles. - HTML: comments go (except conditional comments), runs of spaces become one, and
<pre>and<textarea>are left untouched. A single space between inline elements is kept, because it can change how text looks.
On WordPress
You rarely need to minify by hand. LiteSpeed Cache, Autoptimize and WP Rocket minify CSS and JS automatically. Use this tool for code you paste into theme settings, custom HTML blocks or email templates, or to check what a plugin would save.
Keep your original, readable file. Minified code is hard to edit.
FAQ
Is my code uploaded?
No. Minifying runs in your browser. 0 bytes are sent to our server, so it is safe for private code.
Can minifying break my code?
JavaScript minified with Terser behaves the same. Code that relies on function names (some frameworks) can break when names are shortened; turn that option off if needed.
Why are license comments kept?
Many open-source licenses require the notice to stay with the code. Comments starting with /*! or containing @license are kept unless you untick the option.
Minify or gzip?
Both. Minifying removes characters, gzip compresses what is left. Your server should do gzip or Brotli automatically.