← HTML Entities
Reserved Characters and Symbols
Encoding reserved and special characters securely in HTML texts.
Some characters are reserved in HTML. For example, if you use the less than (<) or greater than (>) signs, the browser might mistake them for tags. We use HTML entities to display these characters safely.
Essential HTML Entities
: Non-breaking space (adds inline spaces).<: Less than (<).>: Greater than (>).&: Ampersand (&).©: Copyright symbol (©).®: Registered trademark symbol (®).
Formatting Examples
- Write
<div>to render<div>safely on screen. - Write
Copyright © 2026to display copyright signs.
Interview questions
Sign in to saveWhy can we not just type '<' and '>' directly inside paragraph texts?
Because '<' and '>' are reserved delimiters in HTML that signify the start and end of tags. Writing them raw makes browsers try to parse subsequent text as tags, which corrupts layout rendering and triggers validation errors.
Practice
Write a line of text that displays the text 'p & q < r' on screen securely using entities.
Hint: Use & for '&' and < for '<'.
