Small ToolsAll tools
← All tools / Frontend
Frontend utility

JavaScript Minifier

Compact JavaScript by removing ordinary comments and extra whitespace.

● This tool runs entirely in your browser. Your input is never uploaded to our servers.
Output
Your result will appear here…

How to use JavaScript Minifier

  1. Paste JavaScript source code.
  2. Select Minify to remove ordinary comments and extra spacing.
  3. Review output and run your project's normal parser and tests.

Example

Input:

function greet(name) {
  // Say hello
  return `Hello, ${name}!`;
}

Output:

function greet (name){return `Hello, ${name}!`;}

Use cases

About this tool

Compact JavaScript by removing ordinary comments and extra whitespace. Processing happens locally in your browser, so your input is not sent to a server or included in analytics.

Frequently asked questions

Does this perform advanced optimization?

No. It does not parse an AST, rename variables, or guarantee semantic preservation for every JavaScript syntax pattern.

Are license comments preserved?

Comments starting with /*! are preserved.

Is my code sent to a server?

No. Transformation runs locally in your browser.

Related tools