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.

100% Client-Side Your data never leaves your browser Free · No Sign-Up
Quick Reference — Common HTML Entities
CharacterNameEntityDecimalHex
&Ampersand&&&
<Less-than&lt;&#60;&#x3C;
>Greater-than&gt;&#62;&#x3E;
"Double quote&quot;&#34;&#x22;
'Apostrophe&apos;&#39;&#x27;
Non-breaking space&nbsp;&#160;&#xA0;
©Copyright&copy;&#169;&#xA9;
®Registered&reg;&#174;&#xAE;
Trademark&trade;&#8482;&#x2122;
Em dash&mdash;&#8212;&#x2014;
En dash&ndash;&#8211;&#x2013;
«Left guillemet&laquo;&#171;&#xAB;
»Right guillemet&raquo;&#187;&#xBB;

How to Use

  1. Paste your text or HTML-encoded string into the Input box.
  2. Click Encode to convert special characters to HTML entities, or Decode to convert entities back to characters.
  3. 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:

&lt;div class=&quot;box&quot;&gt;

This safely renders as the literal HTML tag text in any browser.

Decoding received HTML content

You received a string from an API: Tom &amp; Jerry &mdash; 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&#233; &#169; 2024

Common HTML Entities

CharacterEntity NameDecimalDescription
&&amp;&#38;Ampersand
<&lt;&#60;Less-than sign
>&gt;&#62;Greater-than sign
&quot;&#34;Double quotation mark
&apos;&#39;Apostrophe
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright sign
&trade;&#8482;Trademark
&mdash;&#8212;Em dash
&euro;&#8364;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, &lt; is written as &amp;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;amp;). Decimal entities use the character's Unicode code point in base 10 (e.g. &amp;#38;). Hex entities use base 16 (e.g. &amp;#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.