Python Decompiler

Python Decompiler Online

Decompile PYC and PYO bytecode, RPYC compiled Ren'Py scripts, and extract RPA archives.

.pyc .pyo .rpyc .rpa
Drop your PYC, PYO, RPYC, or RPA file here
Choose file

How It Works

1

Upload

Drag and drop your .pyc, .pyo, .rpyc, or .rpa file or click to browse.

2

Decompile

The appropriate tool decompiles bytecode or extracts archive contents.

3

Browse

View the recovered source code or extracted files in your browser.

What is a PYC File?

PYC stands for Python Compiled. When Python imports a module, the interpreter compiles the source code (.py file) into bytecode and caches the result as a .pyc file. This cached bytecode allows subsequent imports to skip the compilation step, improving startup time.

In Python 3, .pyc files are stored in __pycache__ directories with filenames that include the Python version (e.g., module.cpython-39.pyc). In Python 2, .pyc files were placed alongside the .py source files.

PYC File Structure

A PYC file contains:

PYC vs PYO Files

PYO (Python Optimized) files were created when running Python with the -O flag, which removed assert statements and __debug__ code. In Python 3.5 (PEP 488), PYO files were deprecated and replaced by PYC files with optimization level suffixes like .cpython-39.opt-1.pyc.

Both PYC and PYO files contain the same type of bytecode and can be decompiled using this tool. The optimization level does not affect decompilation — only the removed assertions and debug code will be missing from the output.

How Python Decompilation Works

Python bytecode retains significant information about the original source code — variable names, function signatures, docstrings, line numbers, and code structure are all preserved. This makes Python decompilation much more effective than decompiling native code.

The decompiler reads the marshalled code object from the PYC file, analyzes the bytecode instructions, reconstructs control flow (if/else, loops, try/except), and generates Python source code that produces identical bytecode when recompiled.

RPYC Files (Ren'Py Compiled Scripts)

RPYC stands for Ren'Py Compiled. When a Ren'Py visual novel is launched or built for distribution, the engine compiles each .rpy script file into a corresponding .rpyc bytecode file. These compiled files are Python pickle objects containing the Ren'Py Abstract Syntax Tree.

RPYC files are typically found in the game/ directory of a Ren'Py project. Many distributed visual novels include only the compiled .rpyc files, with the original source removed. The decompiler reconstructs readable RPY source code including dialogue, menus, labels, and Python blocks.

RPA Files (Ren'Py Archives)

RPA stands for Ren'Py Archive. It is a package format used by the Ren'Py engine to bundle game assets — images, audio, fonts, and compiled scripts — into a single file for distribution. Common archive names include images.rpa, audio.rpa, scripts.rpa, and archive.rpa.

After extraction, any .rpyc files found in the archive can be further decompiled back to readable Ren'Py source code using the nested decompilation feature.

Common Uses for Python Decompilation

Frequently Asked Questions

What is a PYC file?

A PYC file is compiled Python bytecode. When Python imports a module, it compiles the .py source to bytecode and caches it as a .pyc file in the __pycache__ directory for faster subsequent imports.

What is the difference between PYC and PYO files?

PYO files were compiled with Python's -O optimization flag, removing assert statements. In Python 3.5+, PYO files were replaced by PYC files with opt-1 or opt-2 suffixes. Both can be decompiled by this tool.

Which Python versions are supported?

This tool supports Python bytecode from versions 2.1 through 3.8. The decompiler automatically detects the Python version from the magic number in the PYC file header.

What is an RPYC file?

An RPYC file is a compiled Ren'Py script. When a Ren'Py visual novel runs, the engine compiles .rpy scripts to .rpyc bytecode for faster loading. This tool decompiles them back to readable RPY source code.

What is an RPA file?

An RPA file is a Ren'Py Archive used to bundle game assets like images, audio, fonts, and compiled scripts into a single file. This tool extracts the archive contents so you can browse and download individual files.