Menu

HTML Decoder

Reverse the output of our HTML Encoder. Decode Base64 + document.write, hex + String.fromCharCode, HTML entities, Unicode escapes, and JS self-decoding back to readable HTML. Auto-detects the method, previews the rendered result.

HTML Decoder Studio Auto-Detect
Ready
Pair with our HTML Encoder. This tool specifically reverses the output of obfuscatortools.com/tools/html-code-encoder. It auto-detects which of the five encoding methods was used and decodes it back to plain HTML.
🤖 Auto-Detect. Inspects the input and picks the right decoder. Handles all 5 encoding methods from our HTML Encoder.
Encoded HTML Input 0 chars
Decoded HTML 0 chars
Complete Guide to HTML Decoding

What HTML Decoding Actually Does

HTML decoding reverses the encoding transformations applied by our HTML Encoder. Each encoding method leaves a recognizable signature:

  • Base64 — starts with <script>document.write(atob("...
  • Hexadecimal — starts with <script>document.write(String.fromCharCode(0x...
  • HTML Entities — contains numeric entities like &#60;
  • Unicode Escape — contains \u003C sequences inside a JS string
  • JS Self-Decoding — an array of character codes fed to String.fromCharCode

This tool detects the signature and reverses the exact transformation, giving you back the original HTML.

The Five Decoding Methods

MethodInput SignatureDecoded By
Base64document.write(atob("..."))atob() then UTF-8 decode
HexadecimalString.fromCharCode(0x3C, ...)Parse hex bytes, rebuild string
HTML Entities&#60;h1&#62;...Numeric entity decode
Unicode Escapedocument.write("\u003C...")Parse \uXXXX sequences
JS Self-DecodingArray of codes + String.fromCharCodeParse array, rebuild string

Auto-Detect

By default, the tool inspects the input and picks the right decoder. If auto-detect fails (e.g., the input is a fragment without a JS wrapper), you can force a specific method using the pill buttons above.

What HTML Decoding Cannot Do

  • It cannot decode ionCube, Zend Guard, or SourceGuardian. Those are PHP bytecode encryptors, not HTML encoding.
  • It cannot decode a truncated string. If the Base64 or hex payload is cut off, decoding fails.
  • It cannot recover comments stripped by the encoder. If you used "Strip Comments", they're gone forever.
  • It cannot reverse a re-encoded payload. If you encoded the output of the encoder again, you need to decode twice.

Frequently Asked Questions

What does this tool reverse?
The output of obfuscatortools.com/tools/html-code-encoder. It handles all 5 encoding methods: Base64, Hexadecimal, HTML Entities, Unicode Escape, and JS Self-Decoding.
How does auto-detect work?
The tool looks for signature patterns: document.write(atob( for Base64, String.fromCharCode(0x for Hex, &# for Entities, \u for Unicode, and an array literal + String.fromCharCode for JS Self-Decoding. It picks the first match.
Why does my decoded HTML look garbled?
The most common cause is a UTF-8 multi-byte character that was split during encoding. If the original page contained emoji or non-ASCII characters and the encoder didn't handle them properly, the decoded output may show � replacement characters. In that case, the original was not cleanly encoded.
Can I decode a fragment that doesn't have the JS wrapper?
Yes — if you know which method was used, select it explicitly (Base64, Hex, Entities, Unicode, or JS Self-Decoding) and the tool will decode the payload directly.
Does it handle nested encoding?
No, not automatically. If the encoder output was encoded again by another tool, you'd need to decode it in reverse order. This tool handles one layer per run.
Does it preserve inline event handlers and inline scripts?
Yes. The decoder reconstructs the exact original HTML string, including any onclick, onsubmit, or <script> tags. The preview iframe uses sandbox="allow-scripts" to run inline scripts safely.
Is my HTML uploaded to your server?
No. Everything runs in your browser. Your code never leaves your device.
Can I download the decoded HTML?
Yes. Click Download to save the decoded output as decoded.html.
Why does the preview show nothing?
The iframe has sandbox="allow-scripts". If the decoded HTML contains a script that tries to access the parent page, it's blocked. Also, if the HTML is a fragment (not a full document), the iframe may render it differently than a browser would.
What if decoding fails?
Check that the input is not truncated. If the Base64 or hex payload is incomplete, decoding cannot succeed. Try pasting the full output including the surrounding <script>...</script> wrapper.

Related Tools

External Resources