HTML Entities Encoder & Decoder

Convert special characters to HTML entities

Common HTML Entities

< = &lt;
> = &gt;
& = &amp;
" = &quot;
' = &#39;
© = &copy;

How It Works

HTML entities are special codes that represent characters that have special meaning in HTML or are difficult to type. The encoder converts characters like <, >, &, ", and ' to their entity equivalents (<, >, &, ", ') to prevent browsers from interpreting them as HTML code. The decoder reverses this process. Named entities use descriptive names (  for non-breaking space, © for ©), while numeric entities use character codes (© for ©, © for hexadecimal). The tool handles both formats and can encode/decode entire blocks of text. Special characters include accented letters (á = á), symbols (€ = €), and mathematical operators (≠ = ≠). Modern browsers support HTML5 entities which include thousands of characters. The encoder is essential for displaying code examples in HTML without the browser executing them.

Use Cases

1. Displaying Code Examples
When showing HTML, JavaScript, or XML code on web pages, encode special characters so browsers display the code as text rather than executing it.

2. Preventing XSS Attacks
Encode user-submitted content to prevent cross-site scripting attacks. Converting