HTML Entity Encoder & Decoder

Escape special characters like &, <, and > into HTML entities, or decode entities back to plain text.

Last updated

Encoded or decoded text will appear here.
Copied

How to encode HTML entities

  1. Paste the text or HTML.
  2. Click Encode to escape special characters, or Decode to turn entities back into characters.
  3. Click Copy result.

Why entity-encode text

Characters like <, >, &, and quotes have special meaning in HTML, so inserting raw user text into a page can break markup or open the door to injection. Encoding replaces them with named entities — &amp;, &lt;, &gt;, &quot;, &#39; — so they render as literal text instead of being parsed as markup.

Conversion happens locally in your browser tab; nothing is uploaded.

Questions about HTML entities

What are HTML entities?

Codes that stand for characters with special meaning in HTML: &lt; for <, &gt; for >, &amp; for & and &quot; for a double quote.

Why encode text before putting it in a web page?

So it shows as text instead of being read as code. It stops user input from breaking the page or injecting scripts.

How do I show HTML code on a web page?

Encode it and paste the result inside a <pre> or <code> element; the browser then displays the tags instead of running them.

How do I decode &amp; and &#39;?

Paste the text and click Decode: &amp; becomes & and &#39; becomes an apostrophe.

☕ Support toolcrate