HTML, CSS & JS Minifier and Beautifier
Shrink your code for production, or turn minified code back into something readable. Works for HTML, CSS and JavaScript and shows how many bytes you save. Nothing is uploaded.
How to use HTML, CSS & JS Minifier and Beautifier on KickSolve
Three quick steps, no account needed.
Why choose KickSolve
Built for speed, privacy and clean results.
What you can do with HTML, CSS & JS Minifier and Beautifier
Everything this tool is good for.
About HTML, CSS & JS Minifier and Beautifier on KickSolve
What it does, how it works and how to get the best results.
What minification does
Minifying removes everything the browser does not need: comments, extra spaces, line breaks and, for JavaScript, long local variable names. The code behaves the same but is smaller, so it downloads faster. Gzip or Brotli on your server then compresses it further.
JavaScript renaming
With “Shorten JS names” on, local variables and parameters are renamed to short names. Turn it off if your code depends on function or variable names at runtime, for example when you read a function’s name or use eval. The JavaScript engine is downloaded the first time you minify JS.
Beautify
Beautify re-indents HTML, CSS and JavaScript using the indent size you choose. It does not rename anything, so it is useful for reading minified code, but variable names that were shortened stay short.
What gets minified in HTML
Comments are removed and whitespace between tags is collapsed. Content inside pre and textarea is left alone, inline styles and scripts are minified, and external script tags are not touched.
Related tools
Writing docs? Convert Markdown with Markdown to HTML. Working with data? Try the JSON Formatter or XML Formatter.
Worked example: minify CSS
Typical savings on a small stylesheet.
Input (92 B):
/* button */
.btn {
color: #fff;
padding: 8px 16px;
}
Minified (39 B, about 58% smaller):
.btn{color:#fff;padding:8px 16px}The comment, the line breaks, the spaces and the final semicolon were removed. The page itself shows the exact bytes saved for your code.
What each language gets
The changes made when you minify.
| Language | Minify removes or changes | Beautify does |
|---|---|---|
| HTML | Comments and extra whitespace, minified inline CSS and JS | Indents tags, including inner HTML |
| CSS | Comments, whitespace, last semicolon in each rule | One declaration per line |
| JavaScript | Comments, whitespace, optional renaming of local variables | Re-indents and spaces the code |
Frequently asked questions
Quick answers.
How do I minify JavaScript, CSS or HTML?
Paste the code, make sure the right language is selected, and press Minify. The result and the bytes saved appear straight away.
Will minifying break my code?
Not normally. The one risk is JavaScript that relies on local variable or function names, so turn off “Shorten JS names” in that case.
Can I make minified code readable again?
Yes. Press Beautify. It re-indents the code, although renamed variables keep their short names.
Does it detect the language?
Yes, with the Auto setting. You can force HTML, CSS or JS if the guess is wrong.
Why does the JS minifier need to download something?
JavaScript is minified with the Terser engine, which is loaded from a CDN the first time you use it. After that it is cached by your browser.
How much will I save?
It depends on how much whitespace and commenting your code has. The status line shows the exact saving for your input.
Does it work for PHP, TypeScript or JSX?
No. It supports plain HTML, CSS and JavaScript. Compile TypeScript or JSX to JavaScript first.
Is my code uploaded?
No. Your code is processed in your browser. Only the open-source helper libraries are downloaded.
More free tools from KickSolve
Related free tools. Each one runs in your browser too.