HTML Entities Encoder & Decoder

Escape characters such as < > & for safe display in HTML, or turn entities back into normal text.

Type or paste text to encode.

How to use the HTML entities tool

  1. Choose Encode to escape special characters, or Decode to turn entities back into characters.
  2. Paste your text or code. The result updates as you type.
  3. Optionally tick Also encode non-ASCII characters to turn letters such as é into numeric entities.
  4. Copy the result into your HTML.

About this tool

HTML uses characters such as <, > and & as part of its own syntax. To show them as text on a page, they must be written as entities: &lt;, &gt; and &amp;. Quotes are escaped too, so the result is safe inside attribute values.

Decoding understands the full set of named entities, such as &nbsp;, &mdash; and &euro;, and numeric entities such as &#169; and &#x1F600;. The decoder uses the browser’s own HTML parser in a way that never runs scripts or loads anything.

Frequently asked questions

Which characters are encoded?

& < > " and ' are always encoded. With the non-ASCII option on, every character above the basic ASCII range becomes a numeric entity such as &#233;.

Does encoding make my page secure?

Escaping text before it is placed into HTML is an important part of preventing cross-site scripting, but it must be done in the right context. Use your framework’s built-in escaping where you can.

What is &nbsp;?

A non-breaking space: a space that does not allow the line to wrap at that point. Decoding turns it into a real non-breaking space character.

Related tools