This page shows ECMAScript (JavaScript) obfuscation done with the ECMAScript Formatter using the optional Obfuscation capability. It contains ECMAScript sample code, its obfuscated version, and the generated obfuscation map of names to mangled names.

ECMAScript (JavaScript) Sample Code before Obfuscation

The program here draws a cute clock face near your mouse cursor, and updates it every second.
1. Click to see the cute clock running in JavaScript
2. Click to see unobfuscated JavaScript source code
3. Click to see the unobfuscated HTML page source code run

ECMAScript (JavaScript) Code after Obfuscation

This is the actual obfuscated JavaScript source code for that same cute clock. Don't expect to see a lot; it is obfuscated, and doesn't have any line breaks!
4. Click to see obfuscated JavaScript source code
5. Click to see the obfuscated HTML page
6. Click to see the obfuscated code run

Because the obfuscated text is difficult to see without line breaks, we've reproduced it again below, adding line breaks every 80 characters so you have a chance of seeing it with your browser. Compared to the original, notice that comments are gone, names have been scrambled and length-minimized, text strings obscured. Constants have their radix twiddled, line breaks removed (except for those we added back for visibility). The obfuscator has also scrambled some variable names found both inside text strings and in the code. The obfuscator uses a special list provided by the user to define names that should be preserved, ensuring that public interfaces and accesses to public libraries remain valid (e.g,. "document", "write").


function Æ(){clearTimeout(æ); if (Þ){ß.style.visibility='\150i\144d\x65n'; þ.st
yle.visibility='h\151d\144e\x6e'; Ò.style.visibility='\150i\x64\144e\156'; Ó.st
yle.visibility='\150i\x64\144e\x6e'; Ô.style.visibility='\150\151d\144e\x6e'; }
else if (Õ){for (i=0; i<Ö.length; i++)document.getElementById('\x6dz\x44\x61t\1
45'+i).style.visibility="\150i\x64\144e\x6e"; for (i=0; i<O; i++)document.getEl
ementById('mzF\141c\x65'+i).style.visibility="\150id\144e\x6e"; for (i=0; i<ò.l
ength; i++)document.getElementById('\155z\x53\145c\x6fn\144\163'+i).style.visib
ility="\150i\x64\x64\x65n"; for (i=0; i<ó.length; i++)document.getElementById('
\155z\x4d\151n\165\164\145s'+i).style.visibility="\x68i\x64d\145\x6e"; for (i=0
; i<ô.length; i++)document.getElementById('m\172H\157u\x72\163'+i).style.visibi
lity="\150i\x64\144e\x6e"; }else if (õ){for (i=0; i<Ö.length; i++)document.getE
lementById('\x6e\163D\x61\x74\145'+i).style.visibility="h\151d\x64\x65\x6e"; fo
r (i=0; i<O; i++)document.getElementById('\156s\106a\x63\145'+i).style.visibili
ty="hid\144\145n"; for (i=0; i<ò.length; i++)document.getElementById('n\x73S\x6
5c\157nd\163'+i).style.visibility="h\151\144d\x65\156"; for (i=0; i<ó.length; i
++)document.getElementById('\156\x73\x4d\x69n\x75\164\145\x73'+i).style.visibil
ity="h\151\144d\x65\x6e"; for (i=0; i<ô.length; i++)document.getElementById('\x
6es\110o\x75\x72\163'+i).style.visibility="\150i\144de\156"; }}function ö(){cle
arTimeout(æ); }function o(Y){Ý=(õ|Õ)?Y.pageY+ý-(window.pageYOffset):event.y+ý;Ì
=(õ|Õ)?Y.pageX+Í:event.x+Í; } (õ)?window.onMouseMove=o:document.onmousemove=o;f
unction Î(){time=new Date(); Ï=time.getSeconds(); I=-.157e1+Math.PI*Ï/036; ì=ti
me.getMinutes(); min=-.157e1+Math.PI*ì/036; hr=time.getHours(); í=-.1575e1+Math
.PI*hr/6+Math.PI*parseInt(time.getMinutes())/0550; if (Þ){ß.style.top=window.do
cument.body.scrollTop; þ.style.top=window.document.body.scrollTop; Ò.style.top=
window.document.body.scrollTop; Ó.style.top=window.document.body.scrollTop; Ô.s
tyle.top=window.document.body.scrollTop; }else if (Õ){for (i=0; i<O; i++){var î
=document.getElementById('\155\172F\x61c\145'+i);î.style.top=y[i]+ï*Math.sin(-.
10471e1+i*À*Math.PI/0264)+Á; î.style.left=x[i]+Â*Math.cos(-.10471e1+i*À*Math.PI
/0264); }for (i=0; i<ô.length; i++){var Ã=document.getElementById('mz\110o\x75\
162s'+i);Ã.style.top=y[i]+Ä+(i*Å)*Math.sin(í)+Á; Ã.style.left=x[i]+A+(i*à)*Math
.cos(í); }for (i=0; i<ó.length; i++){var á=document.getElementById('mz\x4d\151\
x6e\x75\164\145s'+i);á.style.top=y[i]+Ä+(i*Å)*Math.sin(min)+Á; á.style.left=x[i
]+A+(i*à)*Math.cos(min); }for (i=0; i<ò.length; i++){var â=document.getElementB
yId('m\172Se\143o\x6ed\163'+i);â.style.top=y[i]+Ä+(i*Å)*Math.sin(I)+Á; â.style.
left=x[i]+A+(i*à)*Math.cos(I); }for (i=0; i<Ö.length; i++){var ã=document.getEl
ementById('\x6dz\x44a\164\145'+i);ã.style.top=Dy[i]+ï*.15e1*Math.sin(ä+i*å*Math
.PI/0264)+Á; ã.style.left=Dx[i]+Â*.15e1*Math.cos(ä+i*å*Math.PI/0264); }}if (Þ |
| õ){for (i=0; i<O; i++){var î=(õ)?document.layers['n\x73Fa\143\x65'+i]:È[i].st
yle; î.top=y[i]+ï*Math.sin(-.10471e1+i*À*Math.PI/0264)+Á; î.left=x[i]+Â*Math.co
s(-.10471e1+i*À*Math.PI/0264); }for (i=0; i<ô.length; i++){var Ã=(õ)?document.l
ayers['ns\110\157u\x72s'+i]:É[i].style; Ã.top=y[i]+Ä+(i*Å)*Math.sin(í)+Á; Ã.lef
t=x[i]+A+(i*à)*Math.cos(í); }for (i=0; i<ó.length; i++){var á=(õ)?document.laye
rs['n\x73M\x69n\165\164\x65s'+i]:Ê[i].style; á.top=y[i]+Ä+(i*Å)*Math.sin(min)+Á
; á.left=x[i]+A+(i*à)*Math.cos(min); }for (i=0; i<ò.length; i++){var â=(õ)?docu
ment.layers['ns\123e\x63\157nds'+i]:Ë[i].style; â.top=y[i]+Ä+(i*Å)*Math.sin(I)+
Á; â.left=x[i]+A+(i*à)*Math.cos(I); }for (i=0; i<Ö.length; i++){var ã=(õ)?docum
ent.layers['\x6e\x73\x44a\164e'+i]:è[i].style; ã.top=Dy[i]+ï*.15e1*Math.sin(ä+i
*å*Math.PI/0264)+Á; ã.left=Dx[i]+Â*.15e1*Math.cos(ä+i*å*Math.PI/0264); }}ä-=é;}
function ê(){if (Þ){ß.style.visibility='\166\151s\151b\x6c\145'; þ.style.visibi
lity='\166i\x73\151b\x6ce'; Ò.style.visibility='\166i\x73\151b\x6ce'; Ó.style.v
isibility='v\151\163i\x62\154\145'; Ô.style.visibility='vis\151\142l\x65'; }els
e if (Õ){for (i=0; i<Ö.length; i++)document.getElementById('mzD\141\164e'+i).st
yle.visibility="\x73h\x6fw"; for (i=0; i<O; i++)document.getElementById('\155\1
72F\x61\143e'+i).style.visibility="\163h\x6f\167"; for (i=0; i<ò.length; i++)do
cument.getElementById('m\172\123e\143o\x6eds'+i).style.visibility="\163h\x6f\x7
7"; for (i=0; i<ó.length; i++)document.getElementById('mz\x4din\165\164\145\x73
'+i).style.visibility="\163ho\167"; for (i=0; i<ô.length; i++)document.getEleme
ntById('mz\x48ou\162\x73'+i).style.visibility="\163h\x6f\x77"; }else if (õ){for
(i=0; i<Ö.length; i++)document.getElementById('\156\x73D\141t\145'+i).style.vis
ibility="s\150\157w"; for (i=0; i<O; i++)document.getElementById('nsF\141\143e'
+i).style.visibility="\163\150o\x77"; for (i=0; i<ò.length; i++)document.getEle
mentById('\156s\x53e\143o\x6e\144s'+i).style.visibility="\163h\x6f\167"; for (i
=0; i<ó.length; i++)document.getElementById('\156s\115i\x6e\165\164\x65\163'+i)
.style.visibility="sho\167"; for (i=0; i<ô.length; i++)document.getElementById(
'\156s\x48o\165r\x73'+i).style.visibility="sho\167"; }Á=(õ)?window.pageYOffset:
0; Dy[0]=Math.round(ë[0]+=((Ý)-ë[0])*speed); Dx[0]=Math.round(e[0]+=((Ì)-e[0])*
speed); for (i=1; i<Ö.length; i++){Dy[i]=Math.round(ë[i]+=(Dy[i-1]-ë[i])*speed)
; Dx[i]=Math.round(e[i]+=(Dx[i-1]-e[i])*speed); }y[0]=Math.round(Ù[0]+=((Ý)-Ù[0
])*speed); x[0]=Math.round(Ú[0]+=((Ì)-Ú[0])*speed); for (i=1; i<O; i++){y[i]=Ma
th.round(Ù[i]+=(y[i-1]-Ù[i])*speed); x[i]=Math.round(Ú[i]+=(x[i-1]-Ú[i])*speed)
; }Î(); æ=setTimeout((('ê'))+'(\051',024); }

Obfuscated Symbol Cross Reference

The obfuscator produces a cross reference mapping obfuscated symbols to the original symbols, so that obfuscated code in the field can still be decoded, if necessary, by you, the script owner. Notice that certain symbols are preserved (we don't show them all) to enable access to the windowing environment in which this script runs. (We provide a complete preserved word list for using with the obfuscator as part of the product). In fact, by reversing this map and running the obfuscator, you can reproduce the formatted output we started with, without, of course, the comments. Of course, you can only do this if you have this map, which you had to obtain by obfuscating the file in the first place.


### Obfuscated Identifiers ###
Clear -> Æ
ClockAndAssign -> Î
ClockFromMouseX -> Í
ClockFromMouseY -> ý
ClockHeight -> ï
ClockWidth -> Â
D -> Ö
DL -> ã
DX -> e
DY -> ë
Delay -> ê
Dsplit -> å
Event -> N
F -> î
Face -> Ñ
H -> ô
HL -> Ã
HandHeight -> Å
HandWidth -> à
HandX -> A
HandY -> Ä
M -> ó
ML -> á
Mouse -> o
Od -> ß
Of -> þ
Oh -> Ò
Om -> Ó
Os -> Ô
S -> ò
SL -> â
Split -> À
StopDelay -> ö
TodaysDate -> ð
X -> Ú
Y -> Ù
currStep -> ä
d -> û
dCol -> Û
date -> Ç
day -> ç
evnt -> Y
fCol -> Ü
hCol -> ú
hrs -> í
ie -> Þ
ieDate -> è
ieFace -> È
ieHours -> É
ieMinutes -> Ê
ieSeconds -> Ë
m -> ü
mCol -> ù
mins -> ì
mz -> Õ
mzDate -> W
mzFace -> w
mzHours -> T
mzMinutes -> v
mzSeconds -> V
n -> O
ns -> õ
nsDate -> t
nsFace -> R
nsHours -> P
nsMinutes -> Q
nsSeconds -> r
props -> Z
props2 -> z
sCol -> U
scrll -> Á
sec -> I
secs -> Ï
size -> ñ
step -> é
toID -> æ
xmouse -> Ì
year -> Ð
ymouse -> Ý

AntiSpam Policy

The intended use of this Obfuscator is to protect source code that must be downloaded in Web pages because of the poor designs of browsers. Spammers, however, also know how to hide spamvertized destinations in HTML email using JavaScript; obfuscated JavaScript makes this a bit worse. Semantic Designs believes that spam seriously detracts from the value of email because of the useless traffic supported by the receiving victim; worse, spam is sometimes used to send truly disgusting proposals en masse. Semantic Designs will not knowingly offer this tool to spammers. This is probably difficult for us to enforce, and so we apologize to the Internet community in advance for any use that spammers do make of this tool. We remark that other JavaScript obfuscators existed well before ours, so we are not creating a new problem.

For more information: info@semanticdesigns.com    Follow us at Twitter: @SemanticDesigns

ECMA (Javascript)
Obfuscation Example