What is the Code Minifier?
Minifying removes comments, line breaks and extra spaces so code downloads faster. Beautifying does the opposite, adding indentation so minified code is readable. Cubestack does both for JavaScript, CSS and JSON.
How to use it
- 1
Paste code
Enter JavaScript, CSS or JSON.
- 2
Choose an action
Click Minify, Beautify or JSON format.
- 3
Copy the output
Copy the processed code.
Features
Minify
Remove comments and whitespace from JS and CSS.
Beautify
Re-indent compressed code so it's readable.
JS, CSS, HTML and JSON
The language is detected automatically, or you can pick it.
Copy output
Copy the result in one click.
Popular uses
Quick snippets
Shrink inline scripts and styles for emails or embeds.
Read minified code
Beautify third-party scripts to understand them.
Clean JSON
Format JSON before committing it.
Frequently asked questions
How is JavaScript minified?
With Terser, the same engine used by major build tools. It removes whitespace and comments, shortens variable names and never breaks strings or URLs.
Can minifying break my code?
Simple minification is safe for well-formed code, but always test. Code that relies on automatic semicolon insertion can be affected.
Is my code uploaded?
No. Everything runs in your browser.