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 first textarea is copied into the second one.
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 | Date | Description |
---|---|---|
Version 1.0 | 9/06/2008 | The Beginning |
Version 2.0 | 09/06/2008 | Simple Options ... Remove comments & Remove line breaks |
Version 3.0 | 09/06/2008 | Remove spaces option added ... Remove spaces & Fixed problem with semi-colon at end of line |
Version 4.0 | 24/12/2008 | adapt http://joliclic.free.fr/php/javascript-packer/en/ |
Version 5.0 | 08/01/2009 | Use POST variables for AJAX to increase maximum length |
Relevant Links
- wikipedia article on Obfuscated code
- Packer JavaScript en PHP
Comments For This Page
Awesome!!!By Iman on 13th July 2021
Cool! Thnks!!!!!By Dima on 21st December 2019
Best tool!By MilkMan PRO(script dev) on 9th October 2019
loved it. used it for a couple projects . . . used other obfuscation methods and the used this to finalize it :D
On 19th September 2019
Not only obfuscated my code, it also made it marginally more lightweight. This tool is better than any other online obfuscator I've tested.On 4th August 2019
Awesome! Very useful. Thanks a lot!By WallyDanny on 27th April 2019
Great Job !!!On 14th February 2018
Good job team, fine work!By Miguel on 7th April 2017
I did never expect this!On 1st April 2017
Great Work!By Sistepa on 17th March 2017
ThanksBy Colombia on 25th January 2017
You had a bug when use a for loop like for(a=b;;) { c = d;} It will replace ;; by ;By Nam Nguyen on 27th May 2016
T. Jaggar, thanks for the suggestion. We will look in to this,By Daft Logic on 10th May 2016
I used this tool for some time now and really like it. I usually upload my scrips on our test environment, and when they work fine I compress them here and place the compressed version on preproduction then production. Based on my way of working, I was thinking of a great addition you could add to it: Allowing a special markup for sections that the tool should remove, and which it would do first. That would allow to have the script with some tracing or debug statements, yet ensure those are gone for prod. If, for example, it was removing all found between DEBUG and /DEBUG and , we could do code like this:
var x = someImportantStuff(); /* DEBUG */ console.log("result of important stuff is " x); /* /DEBUG */ continueNormalThings();By T. Jaggar on 10th May 2016
D McLean, sorry this was the remnants of an older version of this pageBy Daft Logic on 2nd February 2016
I do not see the checkboxes referred to in paragraph above:
"...numerous functions that each are triggered by the options/check boxes."By D McLean on 2nd February 2016
Very Thankssss !!!!!!!!!!!!!On 20th November 2015
gooodBy names on 26th August 2014
Amazing Tool, Thanks a lot!By s on 11th July 2014
Now this is awesome
On 20th January 2014
20 out of 99 comments shown. See all comments.
Add your own comment below and let others know what you think: