JavaScript Minifier & Unminifier
Minify or unminify JavaScript, TypeScript, JSX & more. Compress code for production or paste minified JS to make it readable again. Smart Insights for ES version, framework detection & security. Free, real-time, 100% browser-based.
Input
0 chars
Minified Output
0 B
One Tool for All JavaScript Dialects
Unlike basic minifiers, this tool auto-detects and supports 6 JavaScript dialects: standard JavaScript (ES5–ES2024), TypeScript, JSX, TSX, JSON, and CoffeeScript. It also detects which framework you're using — React, Vue, Angular, or Node.js — and shows you detected features like arrow functions, async/await, and optional chaining.
Why Minify & Unminify JavaScript?
Minifying removes unnecessary whitespace, comments, console.log calls, and debugger statements from your JavaScript — making files smaller and faster to download. A typical JS file shrinks by 30–60% after minification, significantly improving page load times.
Unminifying (beautifying) does the reverse: it takes compressed JavaScript that looks like a single line and restores proper indentation, line breaks, and formatting. Essential for debugging production code, reading third-party libraries, or understanding minified source files.
Smart Insights — Your Code, Analyzed
Our Smart Insights engine scans your JavaScript and gives you instant feedback on four key areas:
ES Version
Detects your JavaScript version: arrow functions (ES6), async/await (ES2017), optional chaining (ES2020), and more. Know exactly which browsers your code supports.
Framework
Identifies React (hooks, JSX), Vue (createApp, reactive), Angular (@Component, decorators), and Node.js (require, module) patterns.
Complexity
Measures function count, nesting depth, and estimates cyclomatic complexity. Helps you identify code that may need refactoring.
Security
Flags potentially unsafe patterns like eval(), innerHTML, document.write(), and hardcoded credentials.
How to Use — 3 Simple Steps
Paste or Upload Your Code
Paste JavaScript, TypeScript, JSX, or JSON code into the input panel. Or click Upload to load a file. You can also drag & drop. The tool auto-detects your dialect and framework.
Choose Minify or Unminify
Minify compresses your code for production. Unminify / Beautify does the opposite — paste any compressed JavaScript and it restores proper indentation and formatting. Toggle advanced options to fine-tune optimizations.
Copy, Download, or Review Insights
Output updates instantly as you type. Copy or download the result. Check the Verified badge, What Changed panel, and Smart Insights for ES version, framework, complexity, and security tips.
Optimization Reference
| Optimization | Before | After | What it means |
|---|---|---|---|
| Line comments | // note | (removed) | Developer notes stripped |
| Block comments | /* note */ | (removed) | Multi-line notes stripped |
| Whitespace | var x = 1; | var x=1; | Extra spaces collapsed |
| console.log | console.log(x); | (removed) | Debug output removed |
| debugger | debugger; | (removed) | Breakpoints removed |
| Booleans | return true; | return!0; | Same value, fewer bytes |
| Var collapse | var a=1;var b=2; | var a=1,b=2; | Combined declarations |
Pro Tips
Minify for Production
Always serve minified JavaScript in production. Combined with gzip, you can reduce delivery size by 70–90%.
Unminify to Debug
Got minified library code? Switch to “Unminify / Beautify” to make it readable. Great for understanding third-party code.
Remove console.log
Enable “Remove console.log” to automatically strip all console statements before deploying to production.
Check Security Insights
Smart Insights catches eval(), innerHTML, and other potential security issues in your code.