Online Javascript Obfuscator

Introduction

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

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. If a line has no semicolon at the end, add one and then join it to the previous line.

Remove Comments

Loop through all lines in the text area. Trim all white space from each line. If the first two characters are forward slashes (//), remove that line.

Further Uses and Ideas

Version History

Version Date Description
Version 1.09/06/2008The Beginning
Version 2.009/06/2008Simple Options - Remove comments & Remove line breaks
Version 3.009/06/2008Remove spaces option added
Version 4.024/12/2008Adapted joliclic.free.fr's JavaScript packer
Version 5.008/01/2009Use POST variables for AJAX to increase max length

Relevant Links

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

Thanks

By 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 page

By 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

goood

By 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.

Add Your Comment

There's no need to create an account or provide unnecessary details. Just your comment.