HTML Entity Encoder

Encode and decode HTML entities for safe display

Read the full guide

Common HTML Entities:

&&
<&lt;
>&gt;
"&quot;
'&#39;
©&copy;
®&reg;
&trade;
&euro;
£&pound;
°&deg;
±&plusmn;

Powered by html-entities library with full HTML5 entity support.

Display code snippets and special characters safely on the web. Convert reserved characters like < and > into their corresponding HTML entities to prevent the browser from interpreting them as actual code.

HTML entities are strings that begin with an ampersand (&) and end with a semicolon (;). They are used to display reserved characters (which would otherwise be interpreted as HTML tags) and invisible characters (like non-breaking spaces).

Displaying Code

Use this when you want to show HTML or JavaScript snippets inside a <code> tag without executing them.

XSS Protection

Sanitize user input before rendering it on a page to prevent script injection.

Our tool maps characters to their HTML5 named entities (like &copy; for ©) or numeric entities. It protects your site from Cross-Site Scripting (XSS) by neutralizing potentially malicious tags.

CharNamed EntityDec Entity
<&lt;&#60;
>&gt;&#62;
&&amp;&#38;

HTML5 entities are supported by all browsers and email clients, ensuring consistent rendering across all platforms.

Frequently Asked Questions

Is there a difference between &apos; and &#39;?
&apos; is HTML5/XHTML, while &#39; is the numeric reference for a single quote. Both work in modern browsers.

Related Tools