Minify, Unminify & Beautify JavaScript Online — Free JS Minifier
Minify, unminify and beautify your JavaScript code instantly. Our free online JavaScript minifier reduces your JS file sizes by 30 to 70% on average, improving your web page loading times. 100% client-side processing, no data is sent to our servers.
Features
Our JavaScript tool offers three main features:
Reduce the size of your JavaScript code by removing spaces, comments and unnecessary characters.
Restore the readability of your minified JavaScript code by adding spaces and line breaks.
Format and beautify your JavaScript code with customizable indentation (2 or 4 spaces, or tabs).
Package used
Terser is a modern JavaScript compressor that optimizes the size and performance of your code.
Basic example
Input code
Minified code
Minification options
Examples by ECMAScript version:
Original code (ES2022)
ES2022
ES5
Compression examples:
Original code
Conservative
Normal
Aggressive
Comparison with/without option:
Original code
With preserveClassNames: true
With preserveClassNames: false
Difference
Comparison with/without option:
Original code
With preserveFunctionNames: true
With preserveFunctionNames: false
Difference
Comparison with/without option:
Original code
With removeConsole: true
With removeConsole: false
Difference
Comparison with/without option:
Original code
With removeDebugger: true
With removeDebugger: false
Difference
Indentation Size
Sets the number of spaces or tabs for indentation during Beautify
Original code
With 2 spaces
With 4 spaces
Difference
Indentation Type
Use spaces or tabs for indentation during Beautify