Encoding
encoding
html
web
What is HTML Entities?
Definition
HTML entities are special sequences that represent reserved or special characters in HTML. They start with & and end with ; — for example, &lt; for <, &amp; for &, and &nbsp; for a non-breaking space.
Why It Matters
HTML entities prevent browsers from misinterpreting special characters as markup. Displaying user-generated content without proper entity encoding can lead to broken layouts or XSS (cross-site scripting) vulnerabilities. Every web application must encode output correctly.
Code Example
<p>Price: $5 &amp; up</p>
<!-- Renders as: Price: $5 & up -->
Language: html