Logic, but in a different way

Daft Logic

Online Javascript Obfuscator

Introduction

This javascript obfuscator is intended to be used as a resource to convert human readable javascript to a more shrouded code. This serves two purposes:

Input

Output

How it Works

Generally the code from the fist textarea is copied into the second one. In between that here are numerous functions that each are triggered by the options/check boxes. So if none of the checkboxes are on, there will be no change in the code.

Note : If you get errors with the output code, it may be because your source does not have semicolons (;) terminating each line.

Please report any bugs, fixes or suggestions to help make this tool better and remember, always keep the original code!

Remove Line Breaks

Loop through all lines in the text area. Looking at each line one-by-one, if a line has no semicolon at the end, add one and then join it to the line previous

Remove Comments

Loop through all lines in the text area. Looking at each line one-by-one, trim all white space from the line. Then check the fist and second characters in the line. If they are both forward slashes i.e. / , then remove that line.

Further Uses and Ideas

Version History

Version 1 (09/06/2008) - The Beginning

Version 2 (09/06/2008) - Simple Options

Version 3 (24/12/2008) - Remove spaces option added

Version 4 (24/12/2008) - adapt http://joliclic.free.fr/php/javascript-packer/en/

Version 5 (08/01/2009) - Use POST variables for AJAX to increase maximum length

Relevant Links

Previous Comments For This Page

Great tool!
By Alexandru Bagu on 12/01/2012
OUTSTANDING - THANK YOU!
On 04/01/2012
Excellent Work guys!! Thanks a lot!
By Israel Ortega on 28/12/2011
good work
By saintush on 19/12/2011
Best javascript obfuscator I have used. Cut a 44770 byte file to a 23858 byte file! That's nearly half the file size, the script runs faster now :)
By Con on 17/11/2011
Great! is very interesting and useful
By undest on 16/11/2011
TnX veRy Go0D
By Amir Mansouri on 05/11/2011
simply superb, this rocks! best way to deter copiers a tad bit too long.. (i am one :D )
On 16/10/2011
When code uses stings vars like var str = "some text" somevar or function call "some text" "some text"; output code rises error "missing ; efore statement".
On 11/10/2011
great job this is amazing great great great awesome work thank you very much.!! 100
By richy on 03/09/2011
Found this: http://www.cloudcomputingetc.com/2011/08/javascript-code-protection-compression.html
By Jinna on 02/08/2011
I tried to parse 8000 lines of javascript and it does not work :( But i love your tool tho.
By unagi on 30/07/2011
excellent project. moreso for bandwidth saving and also validation than anything else. If it doesn't work, it's usually an omitted semi-colon or something simple like that. easy enough to decode means easy enough to spot errors. I use it on every prject - tkank you folks!
On 29/06/2011
Woah, sooooo good ! BRAVO
By Nehat on 24/06/2011
Not working for all JSs
On 21/05/2011
replace first eval with "document.write" and obfuscation is gone :(
On 21/02/2011
Excelnt job! (if it works, of course. Didn't test it yet).
By Jambo Joe on 12/02/2011
awsome!
By doug on 11/02/2011
I use this on a daily basis. It's a great tool. I run all of my JS through it. Thanks for keeping this tool alive!
By Charles Watkins on 31/01/2011
Thanks for making this!
By Unagi on 28/01/2011
one of the most helpful little hacks i have ever used
On 31/10/2010
THANK YOU!
By Boogie on 23/10/2010
Mozilla Firebug can easily translate it back to the readable JS code.
By pozirk on 28/09/2010
it can not be readable by human. so then what is the usefull. if the generated code is not readable by browser then its fine.
On 25/08/2010
Replace "eval" with "alert" .. no comment
On 24/08/2010
Obfuscation is not protection nor compression. http://www.jssob.net/
By Vincent G on 22/08/2010
@ XCoronner, Tsunamy_boy, Awesome Finding buddy.I never thought it would be as simple as this!! If it is so easy to decode then wats the need to obfuscate i dont get it!
On 09/08/2010
If you have Firefox with the web developer add-on just click on View Generated Source it shows you the HTML.
On 27/07/2010
unfortunately this is easy to revert, just user "alert" instead of "eval". but thanks for help and for shearing : )
By Tsunamy_boy on 16/07/2010
khem... pretty useless if you REALLY need to obfuscate your code... Anybody can just copy this 'obfuscated' code from my site to local machine, create empty html, paste this code, replace 'eval' with 'alert' -and wow- my original javascript in messagebox.
By sander on 09/07/2010

30 out of 56 comments shown. See all comments.

Add your own comment below and let others know what you think:

Comments :

Your Name (optional) :