What are HTML entities?+
HTML entities are escape sequences for characters with special meaning in HTML. For example, < becomes <, > becomes >, & becomes &, and " becomes ".
When should I encode HTML entities?+
Always encode user-supplied content before inserting it into HTML to prevent XSS (cross-site scripting) attacks. Also encode special symbols like © (©) and ™ (™) for maximum compatibility.
What is the difference between named and numeric HTML entities?+
Named entities use a descriptive name (& for &, © for ©). Numeric entities use the Unicode code point (& for &, © for ©). Both are equivalent.
Do modern browsers need HTML entity encoding?+
For XSS prevention, yes - always encode user content. For international characters, modern UTF-8 HTML can include them directly, though encoding is still valid.