JavaScript formatter and minifier
Make minified JavaScript readable, or shrink your own scripts for production.
Report a problem with this tool
How to use JavaScript formatter & minifier
Paste your JavaScript
Paste a script, or open or drop a .js file. It’s formatted as you type.
Beautify or minify
Beautify indents the code with 2 or 4 spaces or a tab. Minify shortens names and removes spaces and comments.
Copy or download
Copy the result, or download it as a .js file. When minifying you’ll see how much smaller it got.
Why use Utils365
Real minification
Terser, the minifier behind most build tools, renames local variables, removes dead code and shortens expressions.
Errors you can find
A syntax error stops the minifier, and you’ll see the line and column with the code around it marked.
Safe for plain scripts
Top-level names aren’t renamed, so other scripts on the page that use your functions keep working.
Private by design
Your code is formatted in your browser and never uploaded, so private source code stays private.
Frequently asked questions
What does a JavaScript minifier do?
It removes spaces, line breaks and comments, renames local variables to single letters, and rewrites code in shorter ways that do the same thing. Scripts often end up half the size or less.
Can I unminify JavaScript?
Choose Beautify to restore the indents and line breaks so you can read it. The original variable names and comments can’t be recovered, since minifying threw them away.
Does it support modern JavaScript?
Yes: classes, arrow functions, async and await, optional chaining, import and export, and top-level await in modules.
Are license comments kept?
Yes. Comments that start with /*! or contain @license or @preserve stay in the minified code.
Does it work with TypeScript or JSX?
Not directly. The minifier reads standard JavaScript only, so compile TypeScript and JSX to JavaScript first, then paste the result.