Reduce your HTML, CSS and JS code size by up to 80%. A fast tool to improve website loading speed without changing code functionality.
Input Code
Drag and drop your file here
Or click to paste code
Supported: js, css, html
Compressed Code
Original Size
Final Size
Reduction
About This Tool
Paste JavaScript, CSS or HTML and get it back with the whitespace, blank lines and comments stripped out. The language is detected from the code, and you can also pick it by hand. No installation, no sign-up.
Useful when a site or theme is running on shared hosting with no command line and no build step, but you still want to upload a lighter stylesheet and script. The same goes for a snippet you are about to paste straight into a WordPress theme or a landing page.
Drag in a file or paste the code (up to 30 MB), and after compression the original size, final size and reduction percentage sit side by side. Copy the output or download it as a file. The code you paste never leaves your device.
Frequently Asked Questions
How do I compress my code?
Paste it into the input box or drag a js, css or html file onto it, then press Compress. On auto the language is read from the code itself; if it guesses wrong, pick it manually from the menu above the box.
What is the size limit?
30 MB, for both pasted code and files. For bigger projects, hand the files over one at a time.
What is the downloaded file called?
Depending on the language, compressed.min.js, compressed.min.css or compressed.min.html. Rename it however you like afterwards, and keep the original file.
Does it handle PHP?
No. Feed it PHP and it will tell you so. Only JavaScript, CSS and HTML. For mixed files like a WordPress template, pull out the CSS or JS part and compress that.
Why is the JavaScript output completely unreadable?
For JavaScript, on top of whitespace and comments, variable names inside functions are shortened and code that can never run is dropped. The result behaves the same but can no longer be edited, so keep the original and ship only the output.
What happens to CSS and HTML?
Comments, extra whitespace and blank lines go, and the space between tags is removed. The structure is untouched: class names, rule order and duplicate rules stay exactly as you wrote them.
Can this change how the code behaves?
No. Quoted strings in CSS and the contents of pre, textarea, script and style tags in HTML are left alone, so nothing that affects the look or behaviour of the page gets shuffled.
My reduction percentage is low, why?
If the code was already compressed or carried little indentation and few comments, there is not much to remove. Files that arrived with min in their name barely change at all.
Why did compression throw an error?
If the JavaScript has a syntax mistake, the error message describes where the problem is. Fix it in the original and try again.
Can I turn compressed code back into readable code?
Whitespace and indentation can be restored with the code beautifier, but the variable names and comments removed from JavaScript are gone for good. That is why you keep the original.
How much does this actually speed up a site?
Smaller files download faster, but if yours were small to begin with the difference will not be noticeable. The gain is biggest when you have several large stylesheets and scripts.
Does it work for JSON?
For JSON, use the JSON formatter, which offers both the minified and the readable form.
Is the code I paste stored anywhere?
No. Everything runs on your own device and neither the input nor the output is stored by us, so your project code stays with you.