Multiple languages
Minify JavaScript, CSS, HTML, and JSON in the same tool.
Developer tools
Code Minifier shrinks JavaScript, CSS, HTML, and JSON by removing unnecessary characters. It's useful when you want smaller assets or quick minified output for testing and delivery.
01 / How it works
Paste code or open a file.
Select the language or let the tool detect it.
Minify the code and copy or download the result.
02 / Features
Minify JavaScript, CSS, HTML, and JSON in the same tool.
See the original and minified output so you know what changed.
Grab the result for deployment, testing, or sharing.
Code is processed locally on your device.
03 / Guide
Code Minifier makes JavaScript, CSS, HTML and JSON files smaller by removing everything a browser doesn't need to run them. This guide explains what gets removed in each language, what each option does, when a build tool is the better choice, and how to check the output before it goes live.
Code is written for people: indentation, line breaks, comments, long descriptive names. Browsers don't need any of that. Minification strips it out and rewrites what's left in the shortest form that behaves the same way. Smaller files download faster, which matters most on mobile data and slow connections.
After each run the tool shows the original size, the minified size, the percentage saved, and the size of both versions when gzipped. The gzipped figure is the useful one, because most web servers compress files before sending them. Minified code still shrinks further with gzip, but the gap between the original and the minified version is smaller than the raw numbers suggest.
console.log and similar calls. ES module treats the file as a module, which allows import and export and some extra optimisations; turn it off for old-style scripts. Keep license comments preserves comments marked @license, @preserve or starting with /*!./*! ... */ form can be kept.type="text/javascript"), shortens boolean attributes like disabled="disabled" to just disabled, and can minify CSS and JavaScript inside <style> and <script> tags.If the code has a syntax error, the output panel shows the error message and the line and column where it happened. Minifiers have to parse your code fully, so they're stricter than a quick glance; fix the error at that location and the output appears.
This tool is ideal for one-off jobs: a script for a WordPress theme, a snippet for a landing page, a widget you're embedding, a JSON config you need to make smaller, or checking how much a file would shrink. For an ongoing project, a build tool such as Vite, esbuild, webpack or Parcel is better. Those tools minify every time you build, bundle many files into a few, and remove unused code across modules.
There's also the question of debugging. Minified code is hard to read in an error message: everything is on one line and the names are meaningless. Build tools solve this with source maps, separate files that let the browser's developer tools show the original code. This minifier doesn't produce source maps, so keep your original files, and deploy minified code only once it's tested.
eval, renaming can break it. Turn the option off if that applies.console.log(...) for its side effects.Minified code looks unreadable, but any browser's developer tools can reformat it with one click, and the logic is still all there. If you want to make copying harder, the JavaScript Obfuscator goes further, with real costs in size and speed that its guide explains.
Everything runs in your browser, in a background worker so the page stays responsive. Your code isn't uploaded anywhere.
04 / FAQ
JavaScript, CSS, HTML, and JSON.
No. Minifying makes code smaller. Obfuscation makes JavaScript harder to read; use the JavaScript Obfuscator for that.
No. Minification runs in your browser.
05 / Related tools