This HTML entity encoder and decoder converts characters like <, > and & into their HTML entities and back. Use it to display code or markup on a web page as text, without the browser trying to render it.
How to use the HTML entity tool
- Choose Encode or Decode.
- Paste your text, code or HTML.
- Copy the escaped or unescaped result.
When to escape HTML
If you want to show an HTML tag on a page — in a tutorial, a code sample or documentation — the special characters must be turned into entities first. Otherwise the browser interprets them as real markup, which breaks your layout and, when the text comes from users, opens the door to cross-site scripting. Escaping the five reserved characters neutralises both problems.
The reserved characters
| Character | Entity |
|---|---|
| & | & |
| < | < |
| > | > |
| " | " |
| ' | ' |