Input

Deobfuscated Output

What Is the Python Deobfuscator?

The Python Deobfuscator reverses common obfuscation patterns and beautifies Python code. Paste obfuscated or minified Python and get readable output for debugging and analysis. Python is widely used in web development, data science, automation, and security research.

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?

This tool handles common source-level patterns like hex/unicode escapes, exec(compile) calls, and indentation restoration. Heavy obfuscation using custom VMs or compiled bytecode requires specialized tools.

Is my Python code sent to a server?

No. All deobfuscation runs entirely in your browser. Your code is never uploaded.

What obfuscation patterns does this tool handle?

It decodes hex string escapes (\x41), unicode escapes (\u0041), detects exec(compile(...)) patterns, hints at base64 strings, restores indentation, and removes excessive semicolons.

Does it work on .pyc compiled files?

.pyc files are compiled Python bytecode. This tool works on Python source (.py) files. For .pyc analysis you need a dedicated bytecode decompiler like uncompyle6 or decompile3.

Why does the indentation look different from the original?

Obfuscated Python often strips or collapses indentation. This tool infers block structure from Python keywords and restores standard 4-space indentation. Minor differences may require manual adjustment.

Related Tools

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