Loading…
Minify JS for production or beautify minified JS for debugging. Use for JS only; for JSON use json-formatter, for CSS use css-formatter. Input: JS text ≤10MB. Returns minified or beautified JS or syntax error. 100% client-side.
JavaScript Minifier/Beautifier is loading — interactive editor will appear here. Use examples below to try instantly once loaded.
Press ? for keyboard shortcuts
Minifies and beautifies JavaScript code with variable name shortening to reduce size, while allowing preserve names to protect specific identifiers. Removes console.log, debugger statements, and comments, with ES5/ES6+ compatibility modes. Shows a size comparison between original and minified output with percentage savings.
Shipping large JavaScript files hurts page performance, and production builds need aggressive minification. This tool provides fine-grained control over what gets stripped and what gets preserved, with a visual size comparison to quantify savings.
This tool is part of the DevStackIO platform — a collection of free online developer tools from DevStackIO. Browse more free developer resources on DevStackIO.
Frontend developers optimizing JavaScript bundles, build pipeline maintainers, and anyone shipping JavaScript to production who needs to reduce file size.
Paste JavaScript code into the input area or upload a .js file
Select Mode: Minify (compress) or Beautify (format)
Toggle options: variable shortening, preserve names list, remove console, remove debugger, remove comments
Choose compatibility: ES5 (e.g. var instead of let/const, avoid arrow functions) or ES6+ (modern JS)
Click Process to generate the output; review the size comparison showing original KB, minified KB, and % savings
Copy the result or download as a .min.js file
Input: 'function add(a, b) { console.log("adding"); return a + b; }' with shorten and remove console. Output: 'function x(a,b){return a+b}'Input: Minified JS from CDN with beautify mode. Output: Formatted and indented JavaScript with proper line breaks.Can variable shortening be reversed?
No, shortened variable names lose their original names permanently.
Does it handle ES modules?
Yes, import/export statements are preserved during minification.
What size reductions are typical?
30-70% depending on variable shortening and comment removal.
Can I minify TypeScript?
The tool expects JavaScript; compile TypeScript to JS first.
Authoritative specifications, standards, and in-depth reading for JavaScript Minifier/Beautifier.
Analyze text for word count, readability, and language stats. Paste and get instant insights.
Convert docker run commands to Docker Compose YAML files online for free. Simplify container orchestration with this easy migration tool.
Build JS benchmarks comparing snippets. Use when comparing speed; for regex testing use regex-tester. Input: JS snippets. Returns ops/sec table. 100% client-side, files never leave browser.
Free online JSON formatter and validator with syntax highlighting and error line numbers. Use as default for beautify+validate+minify in one place; for two-file comparison use json-diff, for schema generation use json-schema-generator. Input: JSON ≤10MB. Returns formatted JSON or line-numbered error. 100% private.
Format and validate HTML with indentation and error reporting. Use as default HTML tool; for minifying production HTML use html-minifier, for converting HTML to Markdown use html-to-markdown. Input: HTML ≤10MB. Returns formatted HTML or validation errors. 100% client-side.
Format or minify CSS with indentation control. Use as default CSS tool handling both directions; css-minifier URL is a noindex alias. Input: CSS ≤10MB. Returns formatted or minified CSS. 100% client-side.
Free online SQL formatter with indentation and keyword casing. Format queries privately in browser.
Format and validate XML with indentation and well-formedness checks. Use for XML; for JSON use json-formatter, for XML to JSON conversion use xml-to-json. Input: XML ≤10MB. Returns formatted XML or line-numbered error. 100% client-side.