# JavaScript code scrambler

> JavaScript code scrambler hides a script from casual reading, so someone opening your file or viewing the page source sees a list of numbers instead of…

Page: https://ishowpdf.com/tools/js-scrambler

## What JavaScript code scrambler does

JavaScript code scrambler hides a script from casual reading, so someone opening your file or viewing the page source sees a list of numbers instead of your logic. The scrambled script still does the same thing when it runs.

Each run picks a random key, turns your code into numbers with it, and adds a small loader that decodes the code and runs it with eval. So the output changes every time you press Scramble. Because it uses eval, pages with a strict content security policy may block it, and code with import or export lines will not run this way. It can be undone, so keep secrets out.

## How to use JavaScript code scrambler

1. **Paste the JavaScript**: Add the script you want to hide.
2. **Scramble it**: Press Scramble to make the encoded version.
3. **Replace and test**: Download scrambled.js, use it in place of the original and test the page.

## Questions

**Is this the same as minifying or obfuscating?**

It is closer to wrapping. The code is encoded whole, not renamed or restructured, so it is easier to undo than a full obfuscator.

**Why does my page block the scrambled script?**

Your site's content security policy probably forbids eval. Allowing it means adding unsafe-eval, which weakens that protection, so think it through first.

**Can I hide an API key this way?**

No. Anyone can decode it by logging the text before it runs. Keep keys on a server.

More free tools: https://ishowpdf.com/tools
