HTML Entity Encoder / Decoder
Encode and decode HTML entities instantly. Convert special characters to HTML entities and back. Supports named, decimal, and hex entities. Free online tool.
How to Use
- Paste your text or HTML-encoded string into the Input box.
- Click Encode to convert special characters to HTML entities, or Decode to convert entities back to characters.
- Click Copy to copy the result to your clipboard.
Worked Examples
Encoding a code snippet for display
You want to show <div class=“box”> as visible text on a web page.
Paste it into the input and click Encode. The output will be:
<div class="box">
This safely renders as the literal HTML tag text in any browser.
Decoding received HTML content
You received a string from an API: Tom & Jerry — Season 1.
Paste it in and click Decode. The output will be:
Tom & Jerry — Season 1
Encoding non-ASCII characters
Paste Café © 2024 and click Encode.
Non-ASCII characters are converted to numeric entities:
Café © 2024
Common HTML Entities
| Character | Entity Name | Decimal | Description |
|---|---|---|---|
& | & | & | Ampersand |
< | < | < | Less-than sign |
> | > | > | Greater-than sign |
” | " | " | Double quotation mark |
’ | ' | ' | Apostrophe |
|   | Non-breaking space | |
© | © | © | Copyright sign |
™ | ™ | ™ | Trademark |
— | — | — | Em dash |
€ | € | € | Euro sign |
FAQ
What are HTML entities?
HTML entities are special codes that represent characters which have meaning in HTML or are not available on a standard keyboard. For example, < is written as &lt; so the browser does not interpret it as an HTML tag.
When should I encode HTML entities?
Encode whenever you display user-generated content, embed code snippets in HTML, or need to safely include special characters like <, >, &, and quotes inside HTML attributes or text nodes to prevent XSS attacks and rendering errors.
What is the difference between named, decimal, and hex entities?
Named entities use a human-readable label (e.g. &amp;). Decimal entities use the character's Unicode code point in base 10 (e.g. &#38;). Hex entities use base 16 (e.g. &#x26;). Browsers support all three forms.
Is my data sent to any server?
No. All encoding and decoding happens entirely in your browser using JavaScript. No data leaves your machine.