Why escape HTML?
Five characters have special meaning in HTML: < and > start and end tags, & starts an entity, and " and ' delimit attribute values. To show them as text — for example code samples in a blog post — they must be written as entities: <, >, &, " and '. Escaping user input before inserting it into a page is also the core defence against cross-site scripting (XSS).
Encoding non-ASCII characters
With UTF-8 pages (the standard today) characters like é, ₹ or emoji can be written directly. Encoding them as numeric entities is only needed for systems that can’t handle UTF-8, such as some old email clients or databases. Decoding turns every named ( , ©), decimal and hex entity back into its character — handy for cleaning text scraped from web pages or APIs.
Everything runs in your browser — your code and data are never uploaded, so it is safe to paste private config files and API responses.
Frequently asked questions
What is &nbsp;?
A non-breaking space — a space that won’t wrap to a new line.
Is escaping enough to prevent XSS?
It is essential for text in HTML content; attributes, URLs and scripts need context-specific encoding too.
Named or numeric entities?
Both work everywhere; named ones are more readable, numeric ones cover every Unicode character.
Last updated 2026-11-21 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)