What are HTML entities?
HTML entities are special codes that represent characters which would otherwise be interpreted as markup or
cannot be typed easily. They come in named form (& for &) and numeric form
(& or &). The browser displays the actual character while the
source stays valid. This tool encodes text into entities and decodes entities back to characters.
Why you need to encode
A few characters have structural meaning in HTML: < and > delimit tags,
& begins an entity, and quotes delimit attributes. If you want to display these literally,
or include a character your keyboard cannot produce, you must encode it so the browser shows it as text
rather than treating it as code.
Named vs. numeric entities
& (named) and & (numeric) render the same character. Named entities
are more readable but only exist for a defined set of characters; numeric entities work for any Unicode code
point, which is why this tool can encode emoji and non-Latin characters that have no name. Encode-essential
mode touches only the markup-sensitive characters, while encode-all converts everything non-ASCII.
A note on security
Encoding output before inserting it into a page is a key defence against cross-site scripting (XSS), because it stops user input from being parsed as HTML. However, encoding alone is not a complete security strategy: context matters (HTML, attributes, and JavaScript each need different handling), so treat this tool as one part of safe output handling, not a guarantee.
Last updated: July 2026