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.
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/
Relevant Links
- wikipedia article on Obfuscated code
- Packer JavaScript en PHP
Previous Comments For This Page
this sucks big time, barely leaves 20% of a 8kb sized JS..
On 21/12/2008
Add your own comment below and let others know what you think: