Skip to content

HTML Entity Encoder & Decoder

Escapes text for safe use in HTML (< becomes &lt;) and decodes entities like &eacute; back into characters.

Your text stays on this device

This tool runs entirely inside your web browser. Your text is processed on your own device and is never sent to our servers. How this works

Escaped HTML

HTML Entity Encoder & Decoder is a free tool that escapes text so it can be shown safely inside HTML, and turns HTML entities back into normal characters. Encoding changes < into &lt;so browsers display it instead of treating it as a tag. Everything runs in your browser.

How to use it

  1. Choose Encode to escape text or code, or Decode to turn entities back into characters.
  2. Paste your text; the result appears on the right.
  3. Switching direction moves the current result into the input, so you can check it round-trips.

What gets encoded

With the extra option, every non-ASCII character is also encoded as a numeric entity, soé becomes &#233;. That is only needed for old systems that can’t store UTF-8.

Why escaping matters for security

If text typed by a user is inserted into a web page without escaping, someone can type HTML or a<script> tag and have it run in other visitors’ browsers. This is called cross-site scripting (XSS). Escaping the five special characters prevents it. Modern frameworks do this automatically, but it still matters for templates, emails and hand-written HTML.

Decoding safely

Decoding supports every named entity in the HTML standard, such as &copy;,&eacute; and &nbsp;, as well as numeric ones like &#x1F600;. Tags in the input are left as text and never run.

Entities are one of several web encodings. For text inside a link or query string, useURL Encode instead; to write formatted content without HTML at all, try theMarkdown Previewer.

Frequently asked questions

When do I need to escape HTML?

Whenever text should appear literally on a web page rather than be treated as markup, for example when showing code samples, or displaying text typed by users. Escaping user input is an important defence against cross-site scripting (XSS).

Which characters are escaped?

The five with special meaning in HTML: & < > " and '. Optionally, every non-ASCII character too, for old systems that cannot handle UTF-8.

Which entities can be decoded?

All of them: named ones such as &copy; and &eacute;, and numeric ones such as &#169; and &#x1F600;.

Last updated

Missing a feature, or need a tool we don’t have? Suggest it.