Escape and unescape HTML
Whenever you show code samples on a web page, insert user content into HTML, write text into XML or JSON templates, or read data that arrived full of & and ', you need to convert between characters and HTML entities. This tool does both: it escapes text so it displays safely in HTML, and it decodes any named or numeric entity back to the original character.
Features
- Encode the five HTML special characters:
& < > " '. - Optional numeric entities for every non-ASCII character, in decimal or hexadecimal.
- Decode all named entities plus decimal and hex numeric entities.
- Two-way switching that keeps your text.
- Safe: input is never rendered as HTML.
- Private: everything runs in your browser.
Common HTML entities
| Character | Named entity | Numeric |
|---|---|---|
| & | & |
& |
| < | < |
< |
| > | > |
> |
| " | " |
" |
| ' | ' |
' |
| non-breaking space | |
  |
| © | © |
© |
| € | € |
€ |
| … | … |
… |
| — | — |
— |
Related tools
Encode text for web addresses with URL Encode / Decode, encode binary data with Base64, turn Markdown into HTML with Markdown to HTML, or tidy XML with the XML Formatter.