Guide: HTML entities: encode and decode
When to use it
When you want to show code or symbols inside a page without the browser interpreting them, or clean text copied from HTML full of and ".
Tips
- & < > " and the single quote are always encoded: they are the ones that can break HTML.
- With the “non-ASCII” option, accents and emoji become numeric entities, useful in old systems.
- When decoding, both named entities (©) and numeric ones (©) are understood.
Frequently asked questions
Does it help prevent XSS attacks?
Escaping text helps, but real protection must be in the application’s code when displaying user data.