HTML Entity Encoder

Encode special characters to HTML entities or decode them back. Includes a common entities reference table.

Common HTML Entities

CharNamedNumeric
<&lt;&#60;
>&gt;&#62;
&&amp;&#38;
"&quot;&#34;
'&apos;&#39;
©&copy;&#169;
®&reg;&#174;
&trade;&#8482;
&euro;&#8364;
£&pound;&#163;
¥&yen;&#165;
nbsp&nbsp;&#160;

DevForge is free and ad-supported. Buy me a coffee if it saved you time.

How to Use This Tool

Paste your text or HTML into the input field. Select Encode to convert special characters to HTML entities, or Decode to convert entities back to characters. The reference table below shows the most commonly used HTML entities.

Common Use Cases

  • Sanitizing user input before inserting into HTML
  • Displaying code examples with < and > on web pages
  • Encoding email addresses and special characters in HTML
  • Decoding entities from API responses or database content

Frequently Asked Questions

What are HTML entities?

HTML entities are special codes used to represent characters that have a special meaning in HTML (like < and >) or characters that are not easily typed. They start with & and end with ;, for example &lt; represents <.

When do I need to encode HTML entities?

You need to encode HTML entities whenever you want to display special characters as text in HTML without them being interpreted as HTML code. This is especially important for user-generated content to prevent XSS attacks.

What is the difference between named and numeric entities?

Named entities use a descriptive name (e.g. &amp;), while numeric entities use a decimal (&#38;) or hexadecimal (&#x26;) code point. Named entities are more readable; numeric entities work for any Unicode character.