.PYC file signature
A Python compiled bytecode file begins with the bytes ?? ?? 0D 0D 0A at the start of the file. The signature is the same whatever the file is named, which is why a renamed or extensionless PYTHONBYTECODE file is still recognisable.
Signature
| Offset | Hex | ASCII |
|---|---|---|
| 0 | ?? ?? 0D 0D 0AThe first two bytes change with each Python release (CB 0D 0D 0A for 3.12); the \r\r\n suffix is constant. |
MIME type: application/octet-stream · usual extensions: .pyc, .pyo
How to check a file's signature
Without installing anything: drop the file on our detector. It reads the bytes in your browser and shows the hex dump alongside the verdict; nothing is uploaded.
macOS and Linux (Terminal):
xxd -l 32 file.pyc
file file.pycWindows (PowerShell):
Format-Hex -Path file.pyc -Count 32If the bytes do not match
A file named .pyc whose first bytes are something else is not a PYTHONBYTECODE file. The common explanations are a wrong or deliberately misleading extension, a download that saved an HTML error page instead of the file, or a container such as ZIP wrapping the real content. The detector reports what the bytes say; the PYTHONBYTECODE guide explains what a genuine file should contain.