JavaScript Beautifier and Minifier
JavaScript files shipped in production are often minified — whitespace stripped, variable names shortened — to reduce download size. That makes them nearly impossible to read when you need to inspect or debug them. This tool lets you go in both directions: expand minified code into readable source, or compress readable source into an optimized production bundle.
When to beautify JavaScript
Beautifying (also called pretty-printing) re-indents and reformats code so you can read it. Common use cases include inspecting third-party scripts, reviewing bundled output, debugging a vendor library, or auditing code you did not write.
When to minify JavaScript
Minification reduces file size by removing comments, collapsing whitespace, and optionally shortening variable names. Smaller files parse and execute faster, which directly improves page load performance and Core Web Vitals scores. Use minification for any JavaScript that end users download — landing pages, widgets, embeds, or libraries.
Minification options
- Mangle variable names: Renames local variables and functions to single characters. This gives the best compression ratio but breaks any code that relies on function.name or exposes a public API by variable name. Safe for self-contained scripts and browser widgets; avoid for npm libraries.
- Drop console.* calls: Removes every console.log, console.warn, console.error, and similar call from the output. Useful for production builds where debug output should never reach users.
Powered by Terser
Minification uses Terser, the same engine used internally by Vite, Rollup, and Webpack for production builds. Beautification uses js-beautify. Both libraries run on the server — nothing is added to your browser bundle and your code is never stored.