HTML Decoder
Paste HTML-encoded text below, entities like & and < are instantly decoded back to plain text.
About the HTML Decoder
Quick Answer: The HTML Decoder converts HTML entities (such as &, <, >, ", and decimal/hex entities) back into clean, readable plain text. Operates locally in browser memory for instant, secure entity decoding.
Paste text containing HTML entities, named codes, or numeric decimal and hex character references, and they are converted back to their original characters instantly. Decoding happens through an isolated, sandboxed textarea element that reads out plain text, so pasting hostile markup cannot execute anything or alter the page.
No part of this touches a server; the conversion runs locally in your browser the moment you type or paste.
- Standards-compliant HTML5 parsing, supporting over 2,000 named entity references.
- Numeric character references, resolving decimal (
©) and hexadecimal (©) code points. - Recursive multi-pass decoding, automatically resolving nested double-encoded and triple-encoded strings.
- Optional HTML tag stripping, isolating clean textual content from embedded markup tags.
- Client-side security sandbox, utilizing RCDATA element isolation to prevent script execution.
The three categories of HTML character references
HTML documents utilize character entity references to represent reserved characters, non-ASCII symbols, and invisible glyphs without triggering syntax errors in web browsers. These references fall into three distinct syntactical categories:
- Named Character References: Human-readable aliases surrounded by an ampersand and semicolon. Examples include
&(&),<(<),>(>),"("), and©(©). The HTML5 specification catalogues 2,231 distinct named references. - Decimal Numeric Character References: Direct decimal representations of a character's Unicode code point prefixed by
&#. For example,<resolves to the less-than sign, and€resolves to the Euro currency symbol (€). - Hexadecimal Numeric Character References: Base-16 hexadecimal representations of the Unicode code point prefixed by
&#xor&#X. For example,<represents the less-than sign, and€represents the Euro symbol.
Security architecture: Why detached RCDATA textarea parsing prevents XSS
Naively decoding HTML using element.innerHTML = text creates severe security vulnerabilities. If the input text contains malicious payload markup such as <img src="x" onerror="alert(1)">, assigning it to a standard HTML element parses and executes the inline JavaScript immediately, exposing users to Cross-Site Scripting (XSS) exploits.
This HTML Decoder secures decoding through detached RCDATA parsing:
- The engine instantiates an unattached, off-screen
<textarea>DOM node in memory. - Under the official W3C and WHATWG HTML Living Standard,
<textarea>elements operate under the RCDATA (Replaceable Character Data) content model. - Within an RCDATA container, the browser HTML parser resolves all character entities into authentic Unicode glyphs, but treats all tag brackets (such as
<script>or<iframe>) as plain text characters without executing them. - Reading the
textarea.valueproperty retrieves the pure decoded text with complete safety.
Standard HTML entity reference table
| Character | Named Entity | Decimal Code | Hexadecimal Code | Description & Standard Usage |
|---|---|---|---|---|
| & | & | & | & | Ampersand symbol; root delimiter for all HTML entities |
| < | < | < | < | Less-than sign; opening delimiter for HTML tags |
| > | > | > | > | Greater-than sign; closing delimiter for HTML tags |
| " | " | " | " | Double quotation mark; attribute value boundary |
| ' | ' | ' | ' | Single quote / apostrophe; alternate attribute delimiter |
| |   |   | Non-breaking space; prevents automatic line wrapping | |
| © | © | © | © | Copyright symbol |
| ® | ® | ® | ® | Registered trademark symbol |
| € | € | € | € | Euro currency symbol |
| £ | £ | £ | £ | British Pound sterling currency symbol |
| ¥ | ¥ | ¥ | ¥ | Japanese Yen / Chinese Yuan currency symbol |
| • | • | • | • | Bullet point typographical symbol |
Handling double-encoded and triple-encoded data pipelines
In modern web architectures, strings frequently pass through multiple processing stages (e.g., WordPress content filters, database sanitation layers, JSON API encoders, and RSS feed generators). If each layer blindly applies an encoding routine, entities become compounded:
- Original text:
AT&T <HQ> - First encoding pass:
AT&T <HQ> - Second encoding pass (Double-encoded):
AT&amp;T &lt;HQ&gt;
A single decode pass on a double-encoded string only reduces &amp; to &. Enabling our Auto recursive decode option automatically executes successive decoding passes until the string reaches equilibrium, fully unpacking deeply nested entities in one click.
Comparison: Browser parser vs regex tables vs server-side libraries
| Approach | Entity Coverage | XSS Execution Risk | Performance | Typical Environment |
|---|---|---|---|---|
| RCDATA Browser DOM (This Tool) | 100% of HTML5 (2,231+ entities) | Zero (isolated detached node) | Sub-millisecond (C++ browser engine) | Client-side web applications |
| Regular Expression Map | Limited to hardcoded lookup array | Zero | Moderate (iterative string scanning) | Lightweight utility scripts |
| div.innerHTML Injection | 100% of HTML5 | High (vulnerable to script payloads) | Fast but dangerous | Insecure legacy code |
| Server-Side Library (he, html.unescape) | 100% of HTML5 | Zero (string-level transformation) | Fast (compiled backend modules) | Node.js, Python, PHP backend servers |
Frequently Asked Questions
Does this decode only basic entities or the entire HTML5 entity set?
Because decoding happens through the browser native HTML parser rather than a static lookup table, it resolves the entire HTML5 named entity set (over 2,000 names, including symbols like copyright and trademark) plus decimal and hexadecimal numeric character references.
Is it safe to paste HTML containing script tags or other markup?
Yes. The decoding element is a detached textarea, which the HTML specification defines with an RCDATA content model. Entities inside it are decoded, but tags are never parsed as real elements or executed. Nothing you paste can run as code or alter the page.
What happens if I paste an invalid or misspelled entity?
It is left unchanged. The browser parser only replaces text it recognizes as a valid entity name or numeric reference; anything else, including an unencoded ampersand or a typo, passes through exactly as typed.
Why does my text still show an entity after decoding once?
Your text was likely encoded twice by upstream systems. One decode pass correctly turns a double-encoded entity into a single-encoded entity. You can toggle the Auto recursive decode option or click the Swap to Input button to run additional passes.
Can I export the decoded text to a plain text file?
Yes. Once your entities are decoded into plain text, click the Download .txt button to save the result directly to your device with zero server transmission.
Does any of my text get sent to a server?
No. Decoding runs entirely in your browser using a local DOM element; nothing is transmitted anywhere, so it is safe to use on private text.
What is the difference between named entities and numeric character references?
Named entities use memorable alphanumeric names between an ampersand and semicolon, such as © for the copyright mark. Numeric character references refer directly to the character Unicode code point using decimal or hexadecimal digits, such as © or ©.
Why do web servers encode characters into HTML entities?
Web servers encode reserved characters like ampersands, angle brackets, and quotes to prevent browser parsers from misinterpreting raw text as HTML tags or attributes, mitigating Cross-Site Scripting (XSS) injection attacks.
How does the Strip HTML tags option work?
When enabled, the tool first decodes all HTML entities into their natural characters and then removes any remaining opening and closing HTML markup tags, leaving only pure, readable plain text.
Can this tool decode non-breaking spaces?
Yes. The entity as well as its numeric equivalents   and   decode directly into authentic Unicode non-breaking space characters (U+00A0).