Unminify & Minify JavaScript Online — Free JS Beautifier
Unminify, minify and beautify JavaScript code instantly with our free online tool. Restore readable formatting from compressed code, minify for production, or concatenate multiple files. All processing happens in your browser — no code sent to any server.
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
Original code
With spaces
With tabs
Difference
How to Unminify JavaScript Online
JavaScript unminification (also called beautification or formatting) restores readable formatting to compressed code. Paste any minified JavaScript into our tool, and it will add proper indentation, line breaks, and spacing. This is essential for debugging production code, understanding third-party scripts, or reviewing obfuscated libraries. Our tool preserves all functionality while making the code human-readable.
JavaScript Beautifier vs Unminifier — What's the Difference
Both terms refer to making minified code readable, but with subtle differences. A beautifier applies consistent formatting rules (indentation style, brace placement) to any code. An unminifier specifically targets minified code, restoring structure that was stripped during compression. Our tool handles both — paste your code and click Unminify or Beautify depending on your needs.
Concatenating JavaScript Files
Combining multiple JavaScript files into one reduces HTTP requests and can improve page load performance. Use our concatenation feature to merge multiple JS files, then optionally minify the result for maximum compression. This is especially useful for projects that don't use a bundler like Webpack or Rollup.
Frequently Asked Questions
Everything you need to know about JavaScript minification, unminification and beautification
Why minify JavaScript?
JavaScript minification reduces file sizes by removing whitespace, comments and shortening variable names. This improves page load times and reduces bandwidth costs. Typical size reductions range from 30% to 70%.
How does JavaScript minification work?
Our tool uses Terser, the industry-standard JavaScript compressor. It removes whitespace, comments, and unnecessary characters while optionally mangling variable names. The minified code is functionally identical to the original.
Can I unminify JavaScript code?
Yes, paste any minified JavaScript into our tool and click Unminify. The tool restores indentation and formatting to make the code readable. Note that variable names shortened during minification cannot be restored to their original names.
Is my code processed securely?
All JavaScript processing happens entirely in your browser. No code is sent to any server. Your source code remains completely private and secure.
What is the difference between minify and beautify?
Minification compresses code by removing all unnecessary characters to reduce file size. Beautification (or formatting) adds consistent indentation and spacing to make code readable. They are opposite operations — our tool supports both.
How much file size reduction can I expect?
Typical reductions range from 30% to 70% depending on code style and comment density. Code with many comments and long variable names will see larger reductions. Our tool shows the exact compression ratio after processing.
Can I concatenate JavaScript files?
Yes, use our concatenation feature to merge multiple JavaScript files into a single file. You can then minify the combined result for maximum file size reduction. Click the concatenate button in the toolbar to get started.
What JavaScript versions are supported?
Our tool supports all modern JavaScript including ES6+, ES2020, ES2021 and beyond. It handles arrow functions, template literals, destructuring, async/await, optional chaining and all modern syntax.