HTML Entity Encoder

Convert special characters like < > & and quotes to HTML entities and decode entities back to text. Free online HTML escape and unescape tool.

How to escape or unescape HTML

  1. Choose Encode to turn special characters into HTML entities, or Decode to turn entities back into characters.
  2. Paste your text. The result updates as you type.
  3. 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: &lt;, &gt; and &amp;. Escaping user input is also an important defense against cross-site scripting (XSS).

Common HTML entities

CharacterEntity
<&lt;
>&gt;
&&amp;
"&quot;
'&#39; or &apos;
non-breaking space&nbsp;
©&copy;
€&euro;

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 &eacute; and &hearts;, decimal ones like &#233; and hexadecimal ones like &#xE9;.