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 ©, ', or € 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.
- HTML Decoder Replace HTML 4 named character references and decimal or hex numeric references with the characters they stand for. Names are case-sensitive (Ω is not ω). Unknown names are left unchanged.
- HTML Encoder Turn the five HTML text specials into character references so the string can sit in HTML text. Named entities for ampersand, less-than, greater-than, and quotes; numeric ' for apostrophe. Other characters, including emoji, are left as they are.