Why HTML entities exist
A handful of characters are special in HTML: < and > start and end tags, & begins an entity, and quotes delimit attribute values. If you want to display those characters rather than have the browser act on them, you replace each with an entity — a name or number between & and ;. So <b> written as <b> appears on the page as literal text instead of turning the following words bold.
How to use this tool
- Paste your text on the left to encode the five special characters, or paste entity-laden HTML to decode it.
- Tick Encode every character to turn all non-ASCII characters into numeric entities too — handy when a system only accepts 7-bit ASCII.
Decoding understands named entities (©), decimal references (©) and hexadecimal ones (©) alike.
Security: escaping untrusted text
Entity-encoding is the core defence against cross-site scripting. Any text that comes from a user and gets placed into a page must be escaped first, so a string like <script> is rendered as characters, not executed as code. This tool is useful for inspecting and testing that escaping, though in production the encoding should happen automatically in your template layer.
Named vs numeric entities
Some characters have friendly names — , ©, — — while every character also has a numeric form. Numeric entities always work because they do not depend on the name being recognised, which is why the "encode every character" option emits numbers.
Examples
Frequently asked questions
Which characters need HTML encoding?
Does HTML encoding stop XSS?
What is the difference between named and numeric entities?
Is my input sent anywhere?
Related tools
Every tool on encoder.website converts your text and hands the result straight back — it is never stored. Pick another tool from the sidebar any time.