# HTML Entity Decoder

> Turn HTML entities like &amp;, &lt; and &#x20AC; back into plain characters.

- Page: https://decoder.tools/html-entity-decoder
- Category: Data, Radix & String
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

An HTML entity decoder replaces character references such as `&amp;`, `&#8211;` and `&#x20AC;` with the characters they represent, giving you the original text or markup.

## Example

```text Input
&lt;p class=&quot;note&quot;&gt;Fish &amp; chips &#8211; &#x20AC;5&lt;/p&gt;
```

```text Output
<p class="note">Fish & chips – €5</p>
```

## What are HTML entities?

In HTML, `<`, `>` and `&` have special meaning, so to show them as text they have to be escaped. HTML offers three ways to write any character:

- **Named entities**, such as `&lt;`, `&gt;`, `&amp;`, `&quot;` and `&nbsp;`.
- **Decimal references**, such as `&#8211;`, which is Unicode code point 8211 (an en dash).
- **Hex references**, such as `&#x20AC;`, which is code point U+20AC (the euro sign).

You usually need to decode entities when text has been escaped once too often. A classic case is `&amp;amp;`, which shows on screen as `&amp;`. It also comes up with RSS feeds, JSON APIs that return HTML-escaped strings, scraped pages and database fields that stored escaped markup.

This decoder resolves all numeric references, plus the common named entities (`&amp; &lt; &gt; &quot; &apos; &nbsp; &copy; &reg; &trade; &hellip; &mdash; &ndash; &euro; &pound;` and similar). Rarer named entities are left as they are.

## How to use the HTML entity decoder

1. Paste the escaped text or markup.
2. Read the decoded result.
3. If you still see entities such as `&amp;lt;`, the text was escaped twice. Paste the output back in and decode it again.

## Decode HTML entities in code

```python Python
import html

print(html.unescape("Fish &amp; chips &#8211; &#x20AC;5"))  # Fish & chips – €5
```

```js JavaScript (browser)
// skip-run (needs a browser DOM)
const t = document.createElement("textarea");
t.innerHTML = "Fish &amp; chips &#8211; &#x20AC;5";
console.log(t.value); // Fish & chips – €5
```

## HTML entities at a glance

| | |
|---|---|
| Specification | WHATWG HTML, named character references |
| Named form | `&name;`, for example `&amp;` |
| Decimal form | `&#NNNN;`, for example `&#8211;` |
| Hex form | `&#xHHHH;`, for example `&#x20AC;` |
| Must always be escaped | `&` and `<`, plus `"` inside attribute values |

## FAQ

### Why does my page show &amp;amp;?

The text was escaped twice: once when it was stored and again when it was printed. Decode it once to get `&amp;` and a second time to get `&`. The real fix is to escape only once, at output time.

### Is decoding entities safe?

Decoding turns `&lt;script&gt;` into a real `<script>` tag. That is fine for reading, but never insert decoded text into a web page without escaping it again, or you open the page to cross-site scripting (XSS).

### What is the difference between &nbsp; and a normal space?

`&nbsp;` (U+00A0) is a non-breaking space. It looks like a space but stops the browser from wrapping a line at that point, and it isn't collapsed with neighbouring spaces.
