HTML Entity
Character references for representing special characters in HTML. Starts with & and ends with ;.
HTML entities are character references used to safely represent special characters in HTML documents. Common examples include & (&), < (<), and > (>).
HTML entities come in two types: named references (&) and numeric references (&, &). Named references are more readable, while numeric references can directly specify Unicode code points. HTML/CSS fundamentals books cover the basics comprehensively.
For XSS prevention, when outputting user input to HTML, the five characters <, >, &, ", and ' must always be converted to entities.
From a character count perspective, entities display as one character but occupy multiple characters in source code. & is 5 characters in source but displays as 1. Web frontend development books provide additional context.