What is HTML Entity Encoder/Decoder?

An HTML entity encoder/decoder converts special characters like <, >, &, and quotes to their HTML entity equivalents (and back). This prevents XSS vulnerabilities when embedding user content in HTML and fixes display issues with special characters.

How to use

  1. Step 1 — Paste text containing special characters or HTML entities.
  2. Step 2 — Choose Encode to convert characters to entities, or Decode to convert entities back to characters.
  3. Step 3 — Copy the result or switch between named entities (&amp;) and numeric entities (&#38;).

Result

You need to display the code snippet <div class="hero"> inside an HTML paragraph. Encode it to &lt;div class=&quot;hero&quot;&gt; so the browser renders the text instead of interpreting it as markup.

Related Tools