Minify CSS, HTML & JS

Slim down CSS, HTML and JavaScript for production, or beautify minified code back into readable, indented source. Results update as you paste, all inside your browser.

Processed on your device. Your code is never uploaded.

Minifying or beautifying code

Comments and unnecessary whitespace are stripped from CSS, HTML and JavaScript the moment you paste, and you can see exactly how many bytes you've saved. It works carefully at the token level: strings, regular expressions, template literals, <pre> blocks and licence comments are kept, and JavaScript keeps the line breaks that automatic semicolon insertion relies on, so the minified code behaves exactly like the original. Inline <style> and <script> blocks inside HTML are minified too. Switch to Beautify to expand compressed code into tidy, indented source for debugging or review. It's all plain client-side string processing, so proprietary code never leaves your device – copy the result or save it as a file.

  1. 1

    Choose CSS, HTML or JavaScript, then Minify or Beautify.

  2. 2

    Paste your code on the left – the processed version appears on the right with the size saving.

  3. 3

    Copy the result or save it as a .css, .html or .js file.

What makes this Code Minifier handy

Three languages

CSS, HTML (including inline styles and scripts) and JavaScript in one tool.

Safe minifying

Strings, regexes and semicolon-sensitive line breaks are always left intact.

Beautify as well

Expand minified code back into readable, indented source.

Your code stays put

Processing happens in your browser, so nothing is uploaded.

What people use the Code Minifier for

Make websites faster

Smaller CSS, HTML and JavaScript files load sooner.

Read minified code

Beautify compressed scripts and styles for debugging.

Fit 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 searched for as: CSS minifier, JS minifier, HTML minifier, JavaScript compressor, code beautifier, CSS beautifier and unminify JS.

Related searches

  • minify css online free
  • minify javascript online
  • html minifier online
  • compress css file size
  • minify js without npm
  • secure code minifier with no upload

Developer tools that keep your code to yourself

Encode Base64, minify CSS, HTML and JavaScript, and debug regular expressions without your code leaving the tab. Tokens and test data stay in your browser, results update as you type, and there's nothing to install or sign up for.

Questions & answers

Could minifying break my JavaScript?

It shouldn't. Only comments and whitespace that can't affect behaviour are removed, and line breaks are kept wherever automatic semicolon insertion might depend on them. Variable names aren't touched.

Is my code sent to a server?

No. Minifying and beautifying are done with client-side string processing in your browser, so your source stays on your device.

You might also need