Cubestack

Code Minifier

Free code minifier online — minify or beautify JavaScript, CSS, HTML and JSON safely in your browser.

Your code
Minified

JavaScript is minified with Terser — the same engine used by major build tools. Always test minified code before shipping it.

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. 1

    Paste code

    Enter JavaScript, CSS or JSON.

  2. 2

    Choose an action

    Click Minify, Beautify or JSON format.

  3. 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.

Related tools