Tools 365

All Tools74 tools available

JavaScript / TypeScript Minifier

Minify and compress your JavaScript or TypeScript code to reduce file size

Language
Select your code language (auto-detects if wrong)
Minifier Options
Customize how your code will be minified

Remove dead code and optimize

Shorten variable names

Strip all comments

Drop console.log calls

Input Code
Paste your JavaScript code here
1 lines0 chars
Minified Code
Compressed and optimized output
1 lines0 chars
How to Use

Instructions:

  1. Select your code language (JavaScript or TypeScript)
  2. Configure minifier options based on your needs
  3. Paste your code in the input area
  4. Click "Minify Code" to compress your code
  5. Copy the minified code for use in production
  6. Use "Load Sample" to see an example

✨ Auto-Detection: The tool automatically detects TypeScript code and strips type annotations before minification. TypeScript types are removed, leaving pure JavaScript output.

Minifier Options:

  • Compress Code: Removes dead code, optimizes expressions, and reduces file size
  • Mangle Names: Shortens variable and function names to single letters (a, b, c, etc.)
  • Remove Comments: Strips all comments from the code
  • Remove Console: Removes console.log, console.info, and console.debug statements

Use Cases:

  • Reduce JavaScript/TypeScript file size for faster page loads
  • Optimize production builds for web applications
  • Remove debugging code before deployment
  • Obfuscate code structure for basic protection
  • Prepare libraries for distribution (npm packages)

Example:

Before (readable):

function greet(name) {
  if (name) {
    return 'Hello, ' + name;
  }
}

After (minified):

function greet(n){if(n)return'Hello, '+n}

Note: This tool uses Terser, an industry-standard JavaScript minifier. Always test minified code thoroughly before deploying to production.