HTML Entity Encoder / Decoder
Convert characters like <, > and & into HTML entities so code shows as text on a web page, or decode entities back.
🔒 Everything you type stays in your browser. Nothing is sent to a server.
By Shah Rukh, software developer · Last updated:
Why escape HTML?
Browsers treat < as the start of a tag. To show code examples, or to display user-submitted text safely, special characters must be replaced by entities. That also protects against cross-site scripting (XSS).
| Character | Entity |
|---|---|
| < | < |
| > | > |
| & | & |
| " | " |
| ' | ' |
| © | © or © |
Frequently asked questions
Do I need to encode accented letters?
Not if your page uses UTF-8, which almost all do. Only < > & and quotes are required.
What’s the difference between named and numeric entities?
Named entities like © are easier to read; numeric ones like © work for any character.
Does decoding run any scripts?
No. Decoding only swaps entities for characters as plain text, so nothing is ever executed.
Related tools
QR Code Generator
Free QR codes for links, Wi-Fi, text and contacts.
Color Picker & Palette
HEX, RGB and HSL codes plus matching palettes.
Contrast Checker
Check WCAG AA/AAA colour contrast for text.
Base64 Encoder / Decoder
Encode or decode Base64 text (UTF-8 safe).
URL Encoder / Decoder
Percent-encode or decode URLs and query strings.
Binary / Hex Converter
Convert between binary, octal, decimal and hex.