JavaScript Obfuscation

What is an obfuscated code?source Wikipedia
Obfuscated code is source code in a computer programming language that has been made difficult to understand. Programmers may deliberately obfuscate code to conceal its purpose (a form of security through obscurity), to deter reverse engineering, or as a puzzle or recreational challenge for readers. Programs known as obfuscators transform human-readable code into obfuscated code using various techniques.

JavaScript obfuscation: Why & why not
An obfuscated JavaScript code can help us in many ways – reduce the download time, more optimization and a fair amount of encryption. At the same time it got some serious disadvantages too – understandability is a distant dream where there is no readability.

JavaScript obfuscation: How

Try this piece code:

// Get the value of all the form fields as a string
function getFormParametersAsAString(aWebForm)
 var inputs = aWebForm.getElementsByTagName('input');
 var formParameters = '';
 var anInput;

 if (inputs)
   for (i = 0; i < inputs.length; i++)
     anInput = inputs&#91;i&#93;;
     if ( && ( > 0) &&
        ("submit" != anInput.type) && ("reset" != anInput.type))
        formParameters += + '=' + encodeURIComponent(anInput.value) + '&';
 return (formParameters);

And the obfuscated version:

var _0xf8b7=["input","getElementsByTagName","","length","name","submit","type","reset","=","value","\x26"];
function getFormParametersAsAString(aWebForm){var inputs=aWebForm[_0xf8b7[1]](_0xf8b7[0]);
var formParameters=_0xf8b7[2];var anInput;if(inputs){for(i=0;i<inputs &#91;_0xf8b7&#91;3&#93;&#93;;i++){anInput=inputs&#91;i&#93;;
{formParameters+=anInput[_0xf8b7[4]]+_0xf8b7[8]+encodeURIComponent(anInput[_0xf8b7[9]])+_0xf8b7[10];} ;} ;} ;
return (formParameters);} ;

Made using

You can try these obfuscators – It’s Java based. Download the obfuscator Jar file