TOOL · ON YOUR DEVICE
Minify CSS, JavaScript and HTML for free
Make your code lighter before publishing, or make a compressed file readable again. Paste or open CSS, JavaScript, HTML or JSON, choose minify or format, and copy or download the result. The code is never sent to a server: it is processed on your device.
- Free account to copy or download
- CSS, JS, HTML and JSON
- Minify or format
- Paste or open your code
- Choose what to do
- Copy or download
HOW TO USE IT
Three steps.
Paste or open your code
Up to 2 million characters. The language is detected when you paste; you can change it under “Language”.
Choose what to do
Minify removes spaces, line breaks and comments. Format indents CSS, HTML or JSON so you can read it. You can keep licence comments /*! … */.
Copy or download
You see the size before and after, in bytes or KB. Press “Copy result” or “Download”.
NEXT STEP
Keep going with these tools
Minify code: common questions
Does it change what my code does?
It should not: it only removes spaces, line breaks and comments that do not change the result, and it never renames variables. For JavaScript the result is read again and, if it does not have the same pieces in the same order, it is not delivered. Still, test your site before publishing.
Can I format JavaScript or use JSX and TypeScript?
Formatting is available for CSS, HTML and JSON; JavaScript can only be minified. JSX and TypeScript are not supported: convert them to JavaScript first.
How much smaller does it get?
It depends on the code: you see the bytes before and after and the percentage saved. Since it does not shorten variable names, it saves less than a compiler that does, but it does not change behaviour.
Is my text sent to a server?
No. Everything is calculated in your browser as you type; the text is not sent to Cocuyo or any third party and is not stored. You can check it in your browser’s network tools: your file is not sent.
Does it use credits?
You can process and view code without an account. Copying or downloading the result requires a free account. Local use does not consume credits or welcome uses.
How does the tool guess the language when I paste code?
It reads the start of the code: HTML if it begins with <, JSON if it begins with { or [ and is valid, CSS if it looks like rules, and otherwise JavaScript. If the guess is wrong, choose the language yourself; pasting will then leave it alone.
When should I use conservative HTML mode?
By default, spaces next to block tags such as div, p and li are removed, which is safe unless your CSS uses display: inline-block. Conservative mode keeps one space between tags, so that space stays visible.
Does it keep license comments?
Yes, by default, because the Keep license comments option is ticked. In CSS, comments that start with /*! are kept; in JavaScript, those and comments marked @license or @preserve are kept too. Untick the option to remove them.
How large a file can I minify?
Up to 2,000,000 characters. The result updates as you type up to 300,000 characters; above that, press Process to get the result.
MORE FREE TOOLS
Other text tools
All free tools
WHEN YOU WANT TO CREATE
Make new images with AI.
Cocuyo’s Studio brings 30+ AI models for image, video and voice together. You see the credit cost before generating, and credits never expire.
































































