HTML Entity Encoder
Encode and decode HTML entities instantly with surgical precision for web applications.
Encoding Format
Strategy
list_altNamed Entities Matrix
HTML Entity Knowledge
The Characters That Break HTML
The five you must encode, and friends
HTML gives some characters jobs. Use them as plain text without encoding, and the parser takes them as instructions:
| Character | Entity | What happens unencoded |
|---|---|---|
| < | < | Starts a tag — following text can vanish |
| > | > | Closes a tag prematurely |
| & | & | Starts an entity — © in text becomes © |
| double quote | " | Ends an attribute value early |
| single quote | ' | Same, in single-quoted attributes |
| ©, ™, —, ₨ | © ™ — etc. | Usually fine as UTF-8, entities are the safe fallback |
When encoding is mandatory
Two situations demand it. Displaying code on a web page: a tutorial showing HTML examples must encode every angle bracket, or the browser renders your example instead of showing it. User-supplied content: anything visitors type — comments, names, search terms — must be entity-encoded before display, because unencoded user input is how script-injection (XSS) attacks happen. Frameworks usually handle the second case; hand-written templates must do it deliberately.
Decode when content arrives pre-mangled
Scraped text, CMS exports and RSS feeds often arrive with & and " baked in — decoding here restores readable text. While cleaning markup, the HTML formatter untangles the structure itself, HTML to Markdown converts content into an editable format, and URL percent-encoding — a different scheme entirely — lives in the URL encoder.