What are HTML Entities?
HTML entities are special codes that represent characters with special meaning in HTML. The < character starts a tag, so to display it as text you write < instead. Similarly & becomes &, > becomes >, and " becomes ".
Most Common HTML Entities
& → & | < → < | > → > | " → " | © → © | ® → ® | ™ → ™ | nbsp → (non-breaking space)
When do I need HTML entities?
Use HTML entities when inserting text content into HTML that may contain reserved characters (< > & "). This prevents broken markup and XSS security vulnerabilities in web applications.
What is the difference between named and numeric entities?
Named: & — human readable. Decimal numeric: & — works everywhere. Hex numeric: & — compact. All three produce the same output character.