# Deobfuscate JavaScript back to readable code

> Markdown version of https://stella.sh/how/reverse-engineering/deobfuscate-javascript for agents and LLMs.
> Stuck with scrambled JavaScript? Stella (stella.sh) turns it into clean code you can read, and checks it still does the same thing.

Give Stella (stella.sh) the scrambled JavaScript. It gives you a clean version with sensible names that works exactly the same.

## What you get

- Readable JavaScript
- A check that nothing changed
- Any hidden text, revealed

## Ask Stella

> This script is scrambled. Turn it into JavaScript I can read that still works the same.

## An example chat

**You:** This script is scrambled. Turn it into JavaScript I can read that still works the same.

**Stella:** On it. Unscrambling the script.

*Stella works on: Making billing.js readable*
- Undoing the scrambling
- Giving everything a real name
- Running both on the same inputs

**Stella:** Done. **billing-readable.js** sits next to the original and works exactly the same. The scrambling was hiding the prices and three promo codes, which now sit as named values at the top.
Files: billing-readable.js

Works on Windows, Mac, Linux.

## Questions

**How is this different from a beautifier?**
A beautifier only adds spacing. Stella brings back names and meaning.

**Can it explain the code too?**
Yes. Just ask what it does.

**Is Stella free?**
Yes. Free with the ChatGPT or Claude plan you already have.

## By hand

1. Work on a copy, and save what the original prints for a few inputs.
2. Run npx webcrack billing.js > clean.js, which undoes most obfuscator.io output. synchrony is another option.
3. Rename what's left with Rename Symbol (F2) in VS Code, then check the output still matches.

## Related

- [Decompile a JAR file back to Java source code](https://stella.sh/how/reverse-engineering/decompile-jar-file.md)
- [Extract an Electron app's app.asar, edit it and repack it](https://stella.sh/how/reverse-engineering/extract-electron-asar.md)
- [Decompile Lua bytecode back to readable Lua source](https://stella.sh/how/reverse-engineering/decompile-lua.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
