🔤

HTML Entity Encode

Encode or decode HTML entities for safe HTML output.

Original Text
HTML Entities

Common HTML Entities

&&
&lt;<
&gt;>
&quot;"
&#39;'
&nbsp;(space)
&copy;©
&reg;®
&trade;
&euro;
&pound;£
&yen;¥
&deg;°
&plusmn;±
&times;×
&divide;÷
&frac12;½
&frac14;¼
&frac34;¾

What is HTML Entity Encoding?

HTML entity encoding converts special characters to HTML entity references, ensuring they display correctly in HTML documents without being interpreted as HTML tags.

Features

  • Two-way conversion: Encode and decode modes
  • Basic encoding: Encodes special characters (<, >, &, ")
  • Full encoding: Converts all characters to numeric entities ({)
  • Entity reference: Common HTML entity lookup table

Common Entities

  • &lt; - Less than (<)
  • &gt; - Greater than (>)
  • &amp; - Ampersand (&)
  • &nbsp; - Non-breaking space
  • &copy; - Copyright (©)

Use Cases

  • XSS Prevention: Encode user input to prevent XSS attacks
  • HTML Escaping: Display HTML code as text
  • Special Symbols: Display copyright, trademark symbols in HTML