Encoding mode
How to use the HTML Entity Encoder
- Choose an encoding mode: Named for readable names (
<), Decimal for numeric codes (<), Hex for hexadecimal codes (<). - Paste text into the left box and click Encode.
- To decode HTML entities back to plain text, paste entities on the left and click Decode.
Common HTML entities
| Character | Named | Decimal | Hex |
|---|---|---|---|
| & | & | & | & |
| < | < | < | < |
| > | > | > | > |
| " | " | " | " |
| ' | ' | ' | ' |
| © | © | © | © |
| ® | ® | ® | ® |
| € | € | € | € |
| £ | £ | £ | £ |
| → | → | → | → |
Why encode HTML entities?
HTML entities are required when you need to display characters that have special meaning in HTML. For example, < and > delimit HTML tags, to display them as literal characters you must write < and >.
Common situations requiring encoding:
- Displaying user-generated content (preventing XSS injection)
- Embedding code samples in HTML documents
- Including special typographic characters (em dashes, curly quotes, arrows)
- Ensuring correct rendering of non-ASCII characters in older HTML (before UTF-8 became universal)