{ } function() const app = new Vue() import React from export default JS TS JSX React Vue JS Minifier & Unminifier

JavaScript Minifier & Unminifier

Minify JavaScript, TypeScript, or JSX for production — or paste any compressed JS and unminify it back to readable code in one click. Auto-detects ES version (ES5–ES2024), identifies React, Vue, and Angular frameworks, and scans for security anti-patterns like eval() and document.write(). No signup, no file size limit, 100% browser-based.

Real-time
Minify mode: Paste your JavaScript code and we'll compress it — removing comments, whitespace, console.log, and debugger statements for production.

Input

0 chars
Drop your JavaScript file here .js, .ts, .jsx, .tsx, .json

Minified Output

0 B
Original 0 B
Minified 0 B
Savings 0%
Functions 0
Variables 0
Imports 0
Classes 0
Strings 0
Console 0

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.

JavaScript ES5 to ES2024
TypeScript Types, interfaces, enums
JSX / TSX React components
JSON Config and data files
Node.js require, module.exports
CoffeeScript Indentation-based

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.

Advertisement
Ad

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

01

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.

02

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.

03

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

OptimizationBeforeAfterWhat it means
Line comments// note(removed)Developer notes stripped
Block comments/* note */(removed)Multi-line notes stripped
Whitespacevar   x   =   1;var x=1;Extra spaces collapsed
console.logconsole.log(x);(removed)Debug output removed
debuggerdebugger;(removed)Breakpoints removed
Booleansreturn true;return!0;Same value, fewer bytes
Var collapsevar 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.

Advertisement
Ad

Frequently Asked Questions

What JavaScript dialects does this tool support?

This tool supports JavaScript (ES5 to ES2024), TypeScript, JSX, TSX, JSON, and CoffeeScript. It auto-detects the dialect and framework from your code patterns, or you can select it manually from the dropdown.

Will minification break my JavaScript?

No. This tool performs safe minification — it only removes whitespace, comments, and optionally console.log/debugger statements. It does not rename variables, mangle code, or change logic. The green “Verified” badge confirms your code structure is preserved.

Can I unminify compressed JavaScript?

Yes! Click “Unminify / Beautify”, paste your minified JS, and the tool restores proper indentation and formatting. Note: variable names shortened by other minifiers (like Webpack/Terser) can't be restored — but the code structure becomes readable.

What are Smart Insights?

Smart Insights analyze your code and detect: ES version (ES5 to ES2024 based on syntax features), framework (React, Vue, Angular, Node.js), complexity (function count, nesting depth), and security concerns (eval, innerHTML, document.write). Like an instant code review.

Is my code data safe?

Yes, completely safe. All processing happens in your browser using JavaScript. Your code is never sent to any server. You can verify by checking the Network tab in your browser’s developer tools.

Is this tool free?

Yes, completely free with no limits on file size or usage. No registration required. Process as many files as you need.

What is the difference between minification and uglification?

Minification removes whitespace, comments, and unnecessary characters to reduce file size while keeping the code functionally identical and still (somewhat) readable. Uglification goes further — it renames variables and function names to short meaningless identifiers (a, b, c...) and restructures expressions to make the code deliberately hard to read and reverse-engineer. Obfuscation is an even stronger step that adds decoy code, string encoding, and control flow mangling. This tool performs minification and basic uglification (identifier renaming with the aggressive optimization level). For production builds, combining this tool's output with gzip compression typically achieves 60–80% size reduction.

Can I minify TypeScript directly without transpiling to JavaScript first?

Yes — this tool accepts TypeScript (.ts) directly and strips type annotations, interfaces, and TypeScript-specific syntax before minifying. This is useful for quick size checks and local development. However, for production builds, the standard workflow is: TypeScript compiler (tsc) → transpile to JavaScript → then minify the JS output. This ensures type checking runs before minification and that you're minifying the actual output code, not the TypeScript source. If you need to inspect or debug a compiled bundle, paste the minified JS into the unminify tab to make it readable again.