Skip to main content

HTML entities

HTML entity converters escape special markup characters so code snippets display safely as text, and decode named or numeric references back into readable Unicode characters.

2 tools

When to encode or decode HTML entities

Use the HTML encoder to escape &, <, >, ", and ' before placing raw text inside HTML elements or attributes. Use the HTML decoder to turn entities such as &copy;, &#39;, or &#x20AC; back into normal text.

Escaping vs full HTML sanitization

Character escaping prevents plain text from being parsed as HTML tags in a text node, but it does not sanitize untrusted rich HTML or protect inline JavaScript contexts. For percent-encoding query parameters and paths, use the URL converters.