There isn't any real distinction between the two. Even UglifyJS calls itself a minification toolkit.

The distinction could be more relevant when comparing JavaScript minification to CSS minification—CSS minification involves only removing whitespace—the original code remains intact.

With JavaScript, it is possible to not only remove whitespace, but also to make transformations to the code, such as truncating variable names to single characters.

Minifying JavaScript not only makes the source smaller; it also makes the code less readable, or obfuscates it. But do not operate under the assumption that minification or uglification, or whatever you want to call it, is a security measure. It isn't encryption. The code is harder to read, but it is not impossible to read, and while it's not usually possible to return minified code back to its original form, it is possible to 'beautify' it and make it more readable.

It doesn't make sense to both minify and uglify, because most minifiers will both remove whitespace and unnecessary characters, as well as obfuscate the code. All you're doing is introducing another build step.

Answer from danwellman on Stack Overflow
🌐
Skalman
skalman.github.io › UglifyJS-online
UglifyJS 3: Online JavaScript minifier
It's a tried and tested tool, used by libraries such as jQuery. This is a simple wrapper for the browser around the minifier; the hard work is done by the Uglify team. If you need an automated solution, I suggest checking out the source code, intended for Node.JS.
🌐
JS Minify
uglifyjs.net
JS Minify and Beautify - Online
Minify your data without hassles or beautify it into a human-readable format. Minify (also known as uglify), in computer science is the process of removing all unnecessary characters from source code without changing its functionality.
People also ask

What is JavaScript Minification?
Minification, or minimization, of JavaScript source code is the process removing all characters that aren't required for proper execution. These unnecessary characters usually include formatting characters, like: whitespaces, linebreak characters, comments, and in some cases block delimeters and end-of-line characters. After minification is applied, JS code is supposed to keep its functionality.
🌐
minify-js.com
minify-js.com
Minify JS Online. JavaScript Minification tool that works in browser.
How does JavaScript Minification work?
Minification process is performed by a software or utility that analyzes and rewrites source code to reduce its size. Usually, minification process includes removal of whitespaces, shortening of variable names, and verbose functions replacement. Minification is performed on the server side and only when the source file is changed.
🌐
minify-js.com
minify-js.com
Minify JS Online. JavaScript Minification tool that works in browser.
Why is Minification used?
Minification allows to reduce JavaScript file size that has a positive impact on load times and bandwidth usage. As a result, site speed and accessibility is higher compared to sites that don't use minification. Other words, minification tangibly improves user experience.
🌐
minify-js.com
minify-js.com
Minify JS Online. JavaScript Minification tool that works in browser.
Top answer
1 of 3
36

There isn't any real distinction between the two. Even UglifyJS calls itself a minification toolkit.

The distinction could be more relevant when comparing JavaScript minification to CSS minification—CSS minification involves only removing whitespace—the original code remains intact.

With JavaScript, it is possible to not only remove whitespace, but also to make transformations to the code, such as truncating variable names to single characters.

Minifying JavaScript not only makes the source smaller; it also makes the code less readable, or obfuscates it. But do not operate under the assumption that minification or uglification, or whatever you want to call it, is a security measure. It isn't encryption. The code is harder to read, but it is not impossible to read, and while it's not usually possible to return minified code back to its original form, it is possible to 'beautify' it and make it more readable.

It doesn't make sense to both minify and uglify, because most minifiers will both remove whitespace and unnecessary characters, as well as obfuscate the code. All you're doing is introducing another build step.

2 of 3
21

Minifying is just removing unnecessary white-space and redundant like comments and semicolons. And it can be reversed back when needed.

Uglifying is transforming the code into an "unreadable" form by changing variable names, function names, etc., to hide the original content. Once it is used, there isn't any way to reverse it back.

Some libraries, like UglifyJS, does minification when used, by removing unnecessary parts. But in general, uglifying is making the code unreadable.

Minifying your code speeds up your page loading, making visitors and search engines happy, and it is also readable. Most major browsers minify the code before execution.

🌐
npm
npmjs.com › package › uglify-js
uglify-js - npm
-e, --enclose [arg[:value]] Embed everything in a big function, with configurable argument(s) & value(s). --expression Parse a single expression, rather than a program (for parsing JSON). --ie Support non-standard Internet Explorer. Equivalent to setting `ie: true` in `minify()` for `compress`, `mangle` and `output` options. By default UglifyJS will not try to be IE-proof.
      » npm install uglify-js
    
Published   Aug 29, 2024
Version   3.19.3
Author   Mihai Bazon
🌐
KeyCDN
keycdn.com › support › uglifyjs
Minify JavaScript Files with UglifyJS - KeyCDN Support
UglifyJS is best known as a JavaScript minifier. Minification is a valuable performance enhancing technique as it removes whitespace and unnecessary characters within a file to make it smaller and thus, load faster.
🌐
Webdevpuneet
tools.webdevpuneet.com › js-minify-and-uglify
JavaScript Minify and Uglify Online Tool (Free) - DevTools
With this tool, you can minify and uglify JavaScript codes for maximum compression in KB to optimize website speed.
🌐
Minify JS
minify-js.com
Minify JS Online. JavaScript Minification tool that works in browser. | Minify JS Online
A new version of EcmaScript is released and brings new syntax rules every year. At the moment, the UglifyJS parser doesn’t support ES6, and it’s not going to get supporting it soon. An UglifyJS fork called uglify-es used to be a default option to handle new standard code minification.
Find elsewhere
🌐
Symfony
symfony.com › home › documentation › frontend › assetic › how to minify css/js files (using uglifyjs and uglifycss)
How to Minify CSS/JS Files (Using UglifyJS and UglifyCSS) (Symfony 2.x Docs)
It can be used to combine and minify JavaScript assets so that they require less HTTP requests and make your site load faster. UglifyCSS is a CSS compressor/beautifier that is very similar to UglifyJS.
🌐
npm
npmjs.com › package › @node-minify › uglify-js
@node-minify/uglify-js - npm
import { minify } from '@node-minify/core'; import { uglifyJs } from '@node-minify/uglify-js'; await minify({ compressor: uglifyJs, input: 'foo.js', output: 'bar.js' });
      » npm install @node-minify/uglify-js
    
Published   Jan 22, 2026
Version   10.4.0
Author   Rodolphe Stoclin
🌐
GitHub
github.com › terinjokes › gulp-uglify
GitHub - terinjokes/gulp-uglify: Minify files with UglifyJS
fileName: The full file path for the file being minified. ... To see useful error messages, see Why Use Pipeline?. By default, gulp-uglify uses the version of UglifyJS installed as a dependency. It's possible to configure the use of a different version using the "composer" entry point. var uglifyjs = require('uglify-js'); // can be a git checkout // or another module (such as `uglify-es` for ES6 support) var composer = require('gulp-uglify/composer'); var pump = require('pump'); var minify = composer(uglifyjs, console); gulp.task('compress', function (cb) { // the same options as described above var options = {}; pump([ gulp.src('lib/*.js'), minify(options), gulp.dest('dist') ], cb ); });
Starred by 1.2K users
Forked by 153 users
Languages   JavaScript
🌐
GitHub
github.com › mishoo › UglifyJS
GitHub - mishoo/UglifyJS: JavaScript parser / mangler / compressor / beautifier toolkit · GitHub
UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit. uglify-js supports JavaScript and most language features in ECMAScript.
Author   mishoo
🌐
Simon Willison
til.simonwillison.net › javascript › minifying-uglify-npx
Minifying JavaScript with npx uglify-js | Simon Willison’s TILs
So I edited the CodeMirror file to use a single /* ... */ comment at the top of the file (instead of multiple // lines) and ran Uglify like this: npx uglify-js codemirror-5.57.0.js -o codemirror-5.57.0.min.js --comments '/LICENSE/' ... It turns out uglify-js doesn't support ES6 at all. You can use tercer instead: npx terser codemirror-5.57.0.js -o codemirror-5.57.0.min.js --comments '/LICENSE/' Discovered in datasette-edit-tables #16. UglifyJS 3: Online JavaScript minifier is a useful way to try out Ugllify since it shows you the results as you type, which makes it easy to spot tiny changes you can make that result in a shorter minified output.
🌐
DEV Community
dev.to › behainguyen › javascript-and-css-minification-345e
JavaScript and CSS minification. - DEV Community
November 6, 2022 - I'm discussing minification of JavaScript and CSS using UglifyJS 3 and UglifyCSS packages. In my... Tagged with javascript, css, minify, uglify.
🌐
GitHub
github.com › gruntjs › grunt-contrib-uglify
GitHub - gruntjs/grunt-contrib-uglify: Minify files with UglifyJS.
Minify files with UglifyJS. Contribute to gruntjs/grunt-contrib-uglify development by creating an account on GitHub.
Starred by 1.5K users
Forked by 347 users
Languages   JavaScript
🌐
Quora
quora.com › What-is-the-difference-between-JavaScript-uglification-and-minification
What is the difference between JavaScript uglification and minification? - Quora
Answer (1 of 5): Minification is all whitespace and comments (to save space) Uglification is usually that + shortening variable names to 1character, making it next really hard to read if you undo the minifcation Uglifying it also makes it (slightly) smaller in size, it tends to be preferred ove...
🌐
JetBrains
jetbrains.com › help › webstorm › minifying-javascript.html
Minifying JavaScript | WebStorm Documentation
To compress your code automatically, you need to install terser and configure a UglifyJS File Watcher which will track changes to your files and run the tool. By default, minification starts as soon as a JavaScript file in the File Watcher's scope is changed and saved. You can specify other events that invoke terser. Learn more from File Watchers. The generated minified code is stored in a separate file with the name of the source JavaScript file and the extension min.js.
🌐
LogRocket
blog.logrocket.com › home › terser vs. uglify vs. babel-minify: comparing javascript minifiers
Terser vs. Uglify vs. babel-minify: Comparing JavaScript minifiers - LogRocket Blog
June 4, 2024 - We have used the -c (compress) and -m (mangle) option on the sample.js file and uglified it. The file size has reduced to 944B, a roughly 22 percent reduction. Now, let’s look at the file contents to see how it has changed with uglification: var print="Hello world! Let's minify everything because, less is more",apple=[1,2,3,4,5];for(i=0;i<5;i++)console.log(print),console.log(apple[i]);for(i=0;i<5;i++)console.log(print),console.log(apple[i]);for(i=0;i<5;i++)console.log(print),console.log(apple[i]);for(i=0;i<5;i++)console.log(print),console.log(apple[i]);for(i=0;i<5;i++)console.log(print),cons
🌐
Cloudflare
cloudflare.com › learning › performance › why-minify-javascript-code
Why minify JavaScript code? | Cloudflare
Uglification: This essentially the same as minification. Uglify JS is a JavaScript library for minifying JavaScript files. To 'uglify' a JavaScript file is to minify it using Uglify.
🌐
YouTube
youtube.com › watch
Recreating Uglifyjs From Scratch: How To Minify Code And Generate Source Maps - YouTube
Have you wondered how you can debug TypeScript applications in the browser while browsers only understand JavaScript? What about reproducing what webpack, ug...
Published   June 20, 2023