- Home
- Tools
- Encoding & Decoding
- HTML Entities
- HTML Encode
HTML Encode
Escape the characters that HTML treats as markup, so text shows up literally on a page.
Example
- In
- <a href="/">Tom & Jerry</a>
- Out
- <a href="/">Tom & Jerry</a>
Good to know
- Five characters are replaced: & becomes &, < becomes <, > becomes >, " becomes " and ' becomes '. That is enough to place text safely in HTML content and in quoted attributes.
- Accented letters and emoji are left alone. On a UTF-8 page, which is practically every page today, they need no escaping.
- Escaping is what stops text typed by a visitor from being run as code. Do it at the moment the text is put into the page, not when it is stored.
How HTML entity works, with a worked example, is explained on the HTML Entity Encoder/Decoder page.