How to encode and decode HTML entities (&, <, ₹)

Characters such as <, > and & have special meaning in HTML. To display them as text you write &lt;, &gt; and &amp;. HTML entities converts both ways.

Steps

  1. Choose Action: encode or decode.
  2. Optionally tick Also encode accented letters and symbols (such as é, ₹ and emoji) to get plain ASCII output.
  3. Paste your text and copy the result.

Examples

  • 5 < 7 & 8 > 3 becomes 5 &lt; 7 &amp; 8 &gt; 3.
  • Price &#8377;500 decodes to Price ₹500.

Why it matters

Showing user-supplied text without encoding it is the root of cross-site scripting (XSS) bugs. Encoding on output is a basic defence, but real applications should use their framework’s escaping rather than hand-pasting results.

Tips

  • Encode only once; double encoding shows up as &amp;lt;.
  • URLs use a different scheme: see URL encode/decode.
  • For JSON strings use the escape mode in JSON formatter.

All guides

↑ ↓ navigateEnter openEsc close