HTML Entity Encoder / Decoder

Escape text into HTML entities or decode entities back to characters.

Popular toolCompress an imageShrink JPG & PNG file sizes without the quality tax.Open

How to encode or decode entities

Choose Encode or Decode, then type or paste into the box. Encoding escapes the reserved HTML characters; decoding turns entities back into the original characters. The result is ready to copy below.

Where this helps

Use encoding before inserting user text or code snippets into HTML to prevent broken layouts and injection. Use decoding to read scraped or stored markup that arrived with entities already in place.

Questions

Why escape HTML at all?
Characters like <, >, and & are structural in HTML. If you drop raw text containing them into a page, the browser may treat it as markup. Escaping turns them into entities so the text renders exactly as written.
Does it handle named and numeric entities?
Yes. Encoding produces the common named entities (&lt;, &gt;, &amp;, &quot;, &#39;). Decoding resolves both named entities and numeric ones — decimal (&#169;) and hexadecimal (&#xA9;) — back to their characters.