Why the less-than sign needs special handling
In HTML, < normally starts a tag. Writing it as < tells the browser that the character itself should be displayed rather than interpreted as markup.
FREE WEB TOOL
Encode special HTML characters or restore entity references.
Encode the HTML-sensitive characters &, <, >, " and ' as entity references, or decode entity references back to ordinary text. This is useful when you want HTML code to appear as text instead of being interpreted as markup.
& < > " '<div> → <div><div class="sample">A & B</div> to appear inside documentation or an article, encoding the angle brackets and ampersand prevents those characters from being treated as normal markup delimiters.This is an entity conversion tool, not an HTML sanitizer. It does not decide whether arbitrary markup is safe to execute.
In HTML, < normally starts a tag. Writing it as < tells the browser that the character itself should be displayed rather than interpreted as markup.
& begins an entity reference, so literal ampersands are commonly written as & when they appear in HTML text. It is easy to miss in code examples and query-string samples.
The decoder can turn common named references such as < and numeric references back into ordinary characters. The result is shown as text rather than executed as HTML.
Escaping text for one HTML context does not automatically make data safe everywhere. Attributes, URLs and JavaScript contexts have different validation and encoding requirements.