Free Online Tool Javascript Minify

Input data
bfotool loadding
Output data
bfotool loadding

Javascript Minify Tool

Minifying Javascript takes the pretty, well formed JS code that you have written and removes the spacing, indentation, newlines, and comments. These arie not required for Javascript to run successfully. It also makes the Javascript more difficult to read when viewing the source.

Many developers will maintain a 'pretty' version, and upon deployment of their project run their scripts through a minification program. They also often combine their many script files into a single file.

Why use Javascript Minifier?

The purpose of minifcation is to increase the speed of a website. Minimisation can make a script up to 20% smaller, resulting in a faster download time. Some developers will also use it to 'obfuscate' their code. This makes it difficult for the code to be read, thereby making it more difficult to reverse engineer or copy.

It is also common practice to combine all the Javascript files for a single website into one file. This has a number of benefits. It reduces the number of HTTP request that need to be made to get all the elements of a website. It also makes minification and gzip compression more effective.

Javascript Minify Example

Beautified Javascript:

var a = document.createElement('a');
mimeType = mimeType || 'application/octet-stream';
if (navigator.msSaveBlob) {
    navigator.msSaveBlob(new Blob([content], {
        type: mimeType
    }), fileName);
} else if (URL && 'download' in a) {
    a.href = URL.createObjectURL(new Blob([content], {
        type: mimeType
    a.setAttribute('download', fileName);
} else {
    location.href = 'data:application/octet-stream,' + encodeURIComponent(content);

Becomes this minified :

var a=document.createElement('a');mimeType=mimeType||'application/octet-stream';if(navigator.msSaveBlob){navigator.msSaveBlob(new Blob([content],{type:mimeType}),fileName);}else if(URL&&'download'in a){a.href=URL.createObjectURL(new Blob([content],{type:mimeType}));a.setAttribute('download',fileName);document.body.appendChild(a);;document.body.removeChild(a);}else{location.href='data:application/octet-stream,'+encodeURIComponent(content);}