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
< - Unicode Escape — contains
\u003Csequences 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
| Method | Input Signature | Decoded By |
|---|---|---|
| Base64 | document.write(atob("...")) | atob() then UTF-8 decode |
| Hexadecimal | String.fromCharCode(0x3C, ...) | Parse hex bytes, rebuild string |
| HTML Entities | <h1>... | Numeric entity decode |
| Unicode Escape | document.write("\u003C...") | Parse \uXXXX sequences |
| JS Self-Decoding | Array of codes + String.fromCharCode | Parse 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
HTML EncoderEncode HTML safely
PHP DeobfuscatorDecode PHP obfuscation
PHP ObfuscatorObfuscate PHP source
JS AST ObfuscatorReal JavaScript obfuscation
CSS Class ObfuscatorMangle CSS class names
Base64 ObfuscatorEncode any text
Base64 EncoderText & file encoding
External Resources
- MDN: Window.atob() — Base64 decoding reference
- MDN: Window.btoa() — Base64 encoding reference
- MDN: HTML Entities — character reference documentation
- MDN: String.fromCharCode()
- WHATWG HTML Parsing Spec
- OWASP Top Ten