CSS, HTML & JS Code Minifier
Shrink CSS, HTML and JavaScript for production, or beautify minified code back into readable, indented source. Results update as you paste, entirely in your browser.
Processed on your device. Your code is never uploaded.
How to Use Code Minifier Online
This code minifier strips comments and unnecessary whitespace from CSS, HTML and JavaScript the instant you paste it, and shows exactly how many bytes you saved. It works conservatively on tokens, so strings, regular expressions, template literals, <pre> blocks and licence comments are preserved, and JavaScript keeps the line breaks that automatic semicolon insertion depends on, so minified code behaves exactly like the original. Inline <style> and <script> blocks inside HTML are minified too. Switch to Beautify to un-minify compressed code into neatly indented, readable source for debugging or code review. Everything runs as pure client-side string processing in your browser: proprietary code never leaves your device, there's nothing to install, and you can copy the result or save it as a file.
- 1
Pick CSS, HTML or JavaScript, then Minify or Beautify.
- 2
Paste your code on the left. The processed version appears instantly on the right with the size saving.
- 3
Copy the result or save it as a .css, .html or .js file.
Why use this Code Minifier
Three languages
CSS, HTML (with inline styles and scripts) and JavaScript in one tool.
Safe minification
Strings, regexes and semicolon-sensitive line breaks are always kept intact.
Beautify too
Turn minified code back into readable, indented source.
Your code stays yours
Processing happens in your browser, so nothing is uploaded.
Popular uses for the Code Minifier
Speed up websites
Smaller CSS, HTML and JavaScript files load faster.
Read minified code
Beautify compressed scripts and styles for debugging.
Paste code into CMS fields
Minify snippets for Shopify, WordPress or tag manager embeds.
Shrink inline styles and scripts
Minify the CSS and JS inside HTML pages and emails.
Also known as: CSS minifier, JS minifier, HTML minifier, JavaScript compressor, code beautifier, CSS beautifier and unminify JS.
People also search for
- minify css online free
- minify javascript online
- html minifier online
- compress css file size
- minify js without npm
- secure code minifier with no upload
Free developer tools that never see your code
Encode Base64, minify CSS, HTML and JavaScript, and debug regular expressions with client-side developer tools. Your code, tokens and test data stay in your browser tab, results appear instantly as you type, and there's nothing to install or sign up for.
Frequently asked questions
Will minifying my JavaScript break it?
It shouldn't. The minifier only removes comments and whitespace that can't affect behaviour, and keeps line breaks wherever JavaScript's automatic semicolon insertion could depend on them. Variable names are left unchanged.
Is my code uploaded to a server?
No. Minifying and beautifying are done with client-side string processing in your browser, so your source code never leaves your device.