How to escape or unescape HTML
- Choose Encode to turn special characters into HTML entities, or Decode to turn entities back into characters.
- Paste your text. The result updates as you type.
- Copy the result, or click Swap to reverse it.
Why escape HTML?
In HTML, the characters <, > and & have special meanings. To show them as text – for example, to display a code sample on a web page or in a blog post – they must be written as entities: <, > and &. Escaping user input is also an important defense against cross-site scripting (XSS).
Common HTML entities
| Character | Entity |
|---|---|
| < | < |
| > | > |
| & | & |
| " | " |
| ' | ' or ' |
| non-breaking space | |
| © | © |
| € | € |
FAQ
Do I need to encode accented letters and emoji?
Usually not. Modern pages use UTF-8, which can contain any character directly. Encoding non-ASCII characters is only needed for old systems or emails that don’t support UTF-8.
Which entities can be decoded?
All of them: named entities such as é and ♥, decimal ones like é and hexadecimal ones like é.