📝 Text

HTML Decoder

Paste HTML-encoded text below, entities like & and < are instantly decoded back to plain text.

0
Decoded Length
0
Input Length
0
Entities Found
0%
Length Difference
Decoded Output


    

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.

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:

  1. Named Character References: Human-readable aliases surrounded by an ampersand and semicolon. Examples include &amp; (&), &lt; (<), &gt; (>), &quot; ("), and &copy; (©). The HTML5 specification catalogues 2,231 distinct named references.
  2. Decimal Numeric Character References: Direct decimal representations of a character's Unicode code point prefixed by &#. For example, &#60; resolves to the less-than sign, and &#8364; resolves to the Euro currency symbol (€).
  3. Hexadecimal Numeric Character References: Base-16 hexadecimal representations of the Unicode code point prefixed by &#x or &#X. For example, &#x3C; represents the less-than sign, and &#x20AC; 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:

Standard HTML entity reference table

Character Named Entity Decimal Code Hexadecimal Code Description & Standard Usage
&&amp;&#38;&#x26;Ampersand symbol; root delimiter for all HTML entities
<&lt;&#60;&#x3C;Less-than sign; opening delimiter for HTML tags
>&gt;&#62;&#x3E;Greater-than sign; closing delimiter for HTML tags
"&quot;&#34;&#x22;Double quotation mark; attribute value boundary
'&apos;&#39;&#x27;Single quote / apostrophe; alternate attribute delimiter
 &nbsp;&#160;&#xA0;Non-breaking space; prevents automatic line wrapping
©&copy;&#169;&#xA9;Copyright symbol
®&reg;&#174;&#xAE;Registered trademark symbol
€&euro;&#8364;&#x20AC;Euro currency symbol
£&pound;&#163;&#xA3;British Pound sterling currency symbol
¥&yen;&#165;&#xA5;Japanese Yen / Chinese Yuan currency symbol
•&bull;&#8226;&#x2022;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:

A single decode pass on a double-encoded string only reduces &amp;amp; to &amp;. 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 &copy; for the copyright mark. Numeric character references refer directly to the character Unicode code point using decimal or hexadecimal digits, such as &#169; or &#xA9;.

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 &nbsp; as well as its numeric equivalents &#160; and &#xA0; decode directly into authentic Unicode non-breaking space characters (U+00A0).