Input

Deobfuscated Output

What Is the Python Deobfuscator?

Ever inherited a Python script packed full of \x41\x42 hex strings and nested exec(compile(...)) calls? You're not alone. Obfuscated Python shows up everywhere — from base64-wrapped payloads in malware droppers to CTF challenges built around exec/eval tricks. This tool decodes Python unicode and hex escapes, unwraps exec/compile layers, and restores readable indentation — all inside your browser, powered by the browser's own JS engine. Nothing is ever uploaded. For compiled .pyc files, check out the decompile3 project instead.

This tool runs entirely in your browser. No code is sent to any server. It handles common obfuscation techniques including hex and unicode escape decoding, exec(compile(...)) pattern detection, base64 string hints, semicolon-joined statement splitting, and indentation restoration.

How to Use This Tool

1

Paste or Upload

Paste obfuscated or minified Python code into the left panel, or upload a .py or .txt file. Click Sample to load an example.

2

View Deobfuscated Output

The right panel shows cleaned and formatted Python code. String escapes are decoded, indentation is restored, and exec/compile patterns are annotated.

3

Copy or Download

Use Copy or Download to save the result as a .py file for further analysis or debugging.

Python Deobfuscator Examples

Here is an example of deobfuscating Python code that uses hex escape sequences inside an exec(compile(...)) call—a common Python obfuscation pattern.

Example: Hex Escape + exec(compile) Obfuscation

Obfuscated input:

Input

Deobfuscated output:

Output

When the Python Deobfuscator Helps

Python is one of the most widely used programming languages in malware analysis, CTF challenges, and code security reviews. Obfuscated Python is common in: malware droppers and loaders, CTF reverse-engineering challenges, pirated script protection, and automated bots. Tools like uncompyle6 handle compiled .pyc bytecode. This tool handles source-level obfuscation patterns automatically.

Frequently Asked Questions

Can this tool reverse all Python obfuscation?

It handles the most common source-level patterns: hex/unicode escape decoding, exec(compile) unwrapping, base64 string hints, semicolon splitting, and indentation restoration. Deeply custom VM-based or compiled bytecode obfuscation needs a dedicated tool like uncompyle6.

Is my Python code sent to a server?

No — it all runs in your browser. Nothing is uploaded or stored anywhere. That's what makes it safe to use on sensitive code.

What Python obfuscation patterns does this handle?

Hex escapes like \x41, unicode escapes like \u0041, exec(compile(...)) wrappers, base64-encoded strings, semicolon-joined statements, and collapsed indentation.

Does it work on .pyc compiled Python files?

.pyc files are compiled bytecode — not source code — so this tool can't process them. You'll need a bytecode decompiler like decompile3 for those.

Why is the indentation different from the original?

Obfuscated Python often strips all whitespace. This tool reconstructs block structure from Python keywords like if, for, def, and class, then applies standard 4-space indentation. Small tweaks may still be needed.

Related Tools

For more information on Python, visit the official Python documentation.