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:
- Makes it harder for others to copy and paste blocks of code
- Reduces file size hence saves outgoing bandwidth for you and incoming bandwidth for your visitors
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
- Detect variable names and rename them to something random
- Detect function names and rename them to something random
Version History
Version 1 (09/06/2008) - The Beginning
- Copy Input to Output (no changes)
Version 2 (09/06/2008) - Simple Options
- Remove comments
- Remove line breaks
Version 3 (24/12/2008) - Remove spaces option added
- Remove spaces
- Fixed problem with semi-colon at end of line
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
- wikipedia article on Obfuscated code
- Packer JavaScript en PHP
Previous Comments For This Page
Good But Not Best...........
By Musab Hussain on 13/03/2013Absolutely sucks. De-obfuscated in seconds, literally:
just run :
for(var i in window) {
console.log(window[i]);
}
or alert();
By Shripad K on 03/03/2013 saaas
On 15/02/2013Pichabrava say:
Pichear bravos y bravas, libertad para vuestras pichas!
Good job team, fine work!
By Pichabrava on 22/01/2013Good job. It obfuscates large js code with cirillic symbols fast and fine.
By Miclech on 15/01/2013special chars problem "Ç%u015E%u0130%u011EÜ%u0131"
By musa on 01/01/2013Best Tool , Great Job, supports HTML5 nicely
On 30/12/2012doesn't fully obfuscate strings, there are other online js obfuscators that do
On 05/10/2012Great tool
By Souvik on 21/09/2012The filesize of my js has been greatly reduced, but I can't use this on scripts that incorporate dynamic PHP content. My php variables get obfuscated too. Any suggestions?
By o11y_75 on 18/09/2012Great job!
By anand K on 18/09/2012A brilliant tool. Thanks for sharing.
By Peter on 30/08/2012thank you!
By r on 25/07/2012A waste of time. Too easy to decode the obfuscated code. Simply replace eval by alert, document.write or something similar.
By rubendj on 25/06/2012nice tool...
By Lawrence Bryant on 12/06/2012thanks
On 03/05/2012awesome
On 23/03/2012Great tool!
By Alexandru Bagu on 12/01/2012OUTSTANDING - THANK YOU!
On 04/01/2012Excellent Work guys!! Thanks a lot!
By Israel Ortega on 28/12/2011good work
By saintush on 19/12/2011Best 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/2011Great! is very interesting and useful
By undest on 16/11/2011TnX veRy Go0D
By Amir Mansouri on 05/11/2011simply superb, this rocks! best way to deter copiers a tad bit too long.. (i am one :D )
On 16/10/2011When 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/2011great job this is amazing great great great awesome work thank you very much.!!
100
By richy on 03/09/2011Found this:
http://www.cloudcomputingetc.com/2011/08/javascript-code-protection-compression.html
By Jinna on 02/08/2011I tried to parse 8000 lines of javascript and it does not work :( But i love your tool tho.
By unagi on 30/07/2011excellent 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/201130 out of 73 comments shown. See all comments.
Add your own comment below and let others know what you think: