Menu

PHP Decoder

Decode eval(base64_decode(...)), eval(gzinflate(base64_decode(...))), eval(strrev(str_rot13(...))), and eval(hex2bin(...)) chains back to readable PHP. Recursive multi-layer decoding, auto-detects the encoding method.

PHP Deobfuscator Studio Recursive
Ready
This handles simple encoding chains only. It decodes the exact output of tools like the PHP Encoder (Base64+eval, GZ Deflate, ROT13, Hex, Variable Rename). It cannot decode ionCube, Zend Guard, or SourceGuardian — those are bytecode-level, not source-level. For heavily nested or custom-function obfuscation, use UnPHP or PHPDeobfuscator [citation:6][citation:11].
🤖 Auto-Detect. The tool inspects the input and picks the right decoder. It handles nested chains by recursively decoding until no more eval wrappers are found.
Obfuscated PHP Input 0 chars
Decoded PHP 0 chars
Complete Guide to PHP Deobfuscation

What PHP Deobfuscation Actually Does

PHP deobfuscation reverses the encoding chains that hide source code. The most common pattern is a chain of nested function calls inside eval():

eval(base64_decode('ZWNobyAiSGVsbG8iOw=='));

To decode this, you peel the layers from the inside out: Base64-decode the string, then you have the original PHP code. For eval(gzinflate(base64_decode(...))), you decompress with gzinflate after Base64-decoding. For eval(strrev(str_rot13(...))), you reverse the string then ROT13 it back [citation:3][citation:12].

The Encoding Chains This Tool Handles

ChainDecode OrderNotes
Base64 + evalbase64_decode() → PHPMost common. Requires atob in browser.
GZ Deflategzinflate(base64_decode()) → PHPBrowser uses DecompressionStream if available.
ROT13 + Reversestrrev(str_rot13()) → PHPPure string math, no compression.
Hex + evalhex2bin() → PHPEach byte is two hex chars.
Variable Rename❌ Not reversibleVariable names are lost permanently. The logic is still readable, just with mangled identifiers.

What This Tool Cannot Decode

  • ionCube — encrypted Zend bytecode + runtime loader. Requires the ionCube Loader extension on a PHP server.
  • Zend Guard — same bytecode-encryption model. Requires Zend Loader.
  • SourceGuardian — similar commercial protector.
  • Custom-function obfuscation — some obfuscators use custom decoder functions with random names. You need to trace the function calls manually or use a tool like UnPHP that simulates execution [citation:11].
  • Heavily nested chains — this tool handles up to ~5 layers of nesting. For 80+ layers (seen in the wild), use a dedicated recursive decoder.

How to Decode Manually (If This Tool Fails)

If the output still contains eval(...), the code has another layer. You can:

  1. Replace eval( with echo ( in the decoded output.
  2. Run it in a PHP sandbox (never on a live server).
  3. The echo will print the next layer of code.
  4. Repeat until no more eval appears.

This is exactly what tools like UnPHP and PHPDeobfuscator automate [citation:6][citation:11].

Safety Warning

Never run decoded PHP on a live server. Obfuscated PHP is often used to hide malware, backdoors, or webshells. Decode it in a sandbox or text editor first. If the decoded code contains system(), shell_exec(), base64_decode($_POST[...]), or unexplained curl calls, treat it as malicious [citation:10][citation:17].

Frequently Asked Questions

Is PHP deobfuscation legal?
It depends on what you're decoding. Decoding your own code, code you're authorized to audit, or code for security research is generally fine. Decoding third-party proprietary software without permission may violate license terms or copyright law. Use responsibly.
Why does the output still contain eval()?
The code has another layer of obfuscation. Click "Decode PHP" again to peel the next layer, or replace eval( with echo ( and run it in a sandbox to see the next layer manually.
Can this decode ionCube or Zend Guard?
No. ionCube and Zend Guard compile PHP to encrypted bytecode, not source-level encoding chains. They require a server-side loader extension to run, and there is no browser-based decoder for them. You need a dedicated service like DecodePHP for those [citation:17].
Does this tool upload my code to a server?
No. Everything runs in your browser. Your code never leaves your device.
What is gzinflate and why does my browser need to decompress it?
gzinflate is PHP's zlib decompression function. To decode it in a browser, this tool uses the built-in DecompressionStream('deflate') API. If your browser doesn't support it (older Safari), the tool falls back to a pure-JS decompressor.
Why can't I decode Variable Rename obfuscation?
Variable renaming (like the PHP Encoder's "Variable Rename" method) replaces meaningful names with random identifiers. That transformation is lossy — the original names are gone. You can still read the logic, but you can't recover $username from $_v1a2b.
What should I do after decoding?
Read the code carefully before running it. Look for suspicious patterns: eval, system, shell_exec, passthru, base64_decode($_POST), file writes to unexpected paths, and outbound curl requests. If anything looks malicious, do not run it.
Can I decode PHP with custom decoder functions?
Not with this tool. Custom functions (e.g., $x = function($y){ return base64_decode($y); }; eval($x($payload));) require execution tracing. Use UnPHP or PHPDeobfuscator, which simulate execution [citation:6][citation:11].
Is my data uploaded to your server?
No. Everything runs in your browser. Your code never leaves your device.
Can I download the decoded PHP?
Yes. Click Download to save the decoded output as decoded.php.

Related Tools

External Resources