Online JavaScript Obfuscator

JavaScript Obfuscator

Obfuscate your JavaScript by encoding it to Base64 and wrapping in an eval decoder

What is a JavaScript Obfuscator?

I created this tool to help you hide your JavaScript logic by encoding it into a Base64 string wrapped in an eval decoder. It does not alter functionality, but it makes the code harder to read at a glance. Everything runs right in your browser, no server calls or libraries required.

What Does Our JavaScript Obfuscator Do?

When you paste your script into the input area and click Obfuscate JavaScript the tool uses btoa to Base64-encode your code. It then wraps that string in eval(atob(“…”)), producing a single line of JavaScript that decodes and executes the original code at runtime. If encoding fails you receive a clear error message instead.

What to Expect When Using This Tool

You will see two text boxes labeled JavaScript Input and Obfuscated Output. On desktop they appear side by side, on mobile they stack vertically. Paste your code into the left box, click the button, and view the obfuscated one-liner on the right. Clear All resets both boxes so you can try again.

Common Use Cases

  • Protecting small utility scripts from casual copying
  • Hiding configuration logic in embedded widgets
  • Preparing snippets for demonstration where details are secondary
  • Obfuscating analytics or tracking snippets
  • Quickly encoding code before sharing

Input and Output Examples

Example 1

Input:

function greet(name) {
  console.log("Hello, " + name + "!");
}
greet("World");

Output:

eval(atob("ZnVuY3Rpb24gZ3JlZXQobmFtZSl7CiAgY29uc29sZS5sb2coIkhlbGxvLCAiICsgbmFtZSArICIjISIpOwp9CmdyZWV0KCIxMjMiKTs="));

Example 2

Input:

let x = 5;
let y = 10;
console.log(x * y);

Output:

eval(atob("bGV0IHggPSA1Owp2YXkgID0gMTAgOwpjb25zb2xlLmxvZyh4ICogeSk7"));

Frequently Asked Questions (FAQs)

Will this change how my code runs?

No it preserves exact behavior by decoding and executing the original script at runtime.

Is this secure against determined reverse-engineering?

This is basic obfuscation. A user can decode the Base64 string easily. For stronger protection use a dedicated obfuscator or minifier.

Can I obfuscate large files?

Browsers limit how much you can encode with btoa. Very large scripts may fail or cause performance issues.

Will it break if my code contains Unicode?

btoa only supports Latin-1 characters. Unicode content may require additional handling and could throw an error.

Can I undo the obfuscation?

Yes. Copy the Base64 string and run atob(…) in any console to recover the original source.

Does it use any external libraries?

No. It relies solely on built-in browser functions.

How do I copy the obfuscated code?

Select the Obfuscated Output area and use your device’s copy command.

Is there a way to customize the wrapper?

Not in this version. It always uses eval(atob(…)).

Can I use this on mobile?

The responsive design ensures it works smoothly on phones and tablets.

Benefits of Using an Obfuscated Script

  • Increases effort required to read your source
  • Conceals logic in shared widgets or embeds
  • Simple one-click operation in your browser
  • No dependencies or installs needed

Best Practices

  • Use for small non-critical scripts only
  • Keep a readable copy of your source code
  • Avoid obfuscating sensitive or security-critical logic
  • Test thoroughly after obfuscation
  • Integrate into build steps if using regularly

Getting Started

  1. Paste your JavaScript into the JavaScript Input box
  2. Click Obfuscate JavaScript
  3. Copy the wrapped code from the Obfuscated Output box
  4. Click Clear All to reset both fields
  5. Embed your obfuscated snippet where needed
  6. Enjoy a quick layer of code privacy!
Review Your Cart
0
Add Coupon Code
Subtotal