How to use Code minifier
- 1
Paste your code. The language is detected when you paste, or choose JavaScript, CSS or HTML.
- 2
Choose whether to shorten variable names and keep licence comments.
- 3
Press Minify, then copy the result or download it as a .min file.
What this tool does
The code minifier makes JavaScript, CSS and HTML files smaller by removing everything a browser doesn't need: spaces, line breaks and comments, plus long names and repeated rules. Smaller files load faster, which helps users on slow connections and page-speed scores.
Features
- JavaScript with terser: compression, optional name mangling, modern syntax and ES modules.
- CSS with csso: whitespace and comments removed, duplicate rules merged, values shortened.
- HTML: comments and needless whitespace removed, with pre, textarea, inline style and script handled safely.
- Size report before and after, including gzip.
- Error messages with the line and column of a syntax error.
Limits
- This is for single files. Build tools such as Vite or webpack handle whole projects, bundling and source maps.
- HTML whitespace between inline elements is kept as a single space, so text never runs together.
Where your code is processed
This tool works in your browser: your code is minified on your own device, so it isn't sent to our server for this tool. Some other tools on UtiloNest do use our server, and their pages say so.
Frequently asked questions
How is the code minified?
JavaScript is minified with terser, which removes whitespace and comments, simplifies expressions and can shorten local names. CSS uses csso, which also merges duplicate rules and shortens values. HTML has comments and needless whitespace removed, and its inline CSS and JavaScript are minified too.
Will minifying break my code?
Minifiers keep the code's behaviour, and these are widely used in production. Shortening names only touches local variables, not global names other scripts may rely on. Text in pre and textarea elements keeps its spacing. As always, test the minified version before you deploy it.
What are licence comments?
Comments that start with /*! or contain @license or @preserve usually hold copyright notices that a licence requires you to keep. With the option on, they stay in the output.
What does the gzip size mean?
Most servers send files gzip-compressed, so the gzip size is roughly what visitors download. It shows the real-world saving, which is usually smaller than the raw saving.
Is my code uploaded?
No. Minifying runs in your browser, so your code never leaves your device.