HTML Entity Encoder & Decoder

Escape and unescape HTML entities like &, <, >.

Convert characters to their HTML entity equivalents and back. Useful for safely embedding user content in HTML, displaying code on a webpage, or de-escaping copied source.

Common use cases

  • Embed code snippets in blog posts without breaking the surrounding markup
  • Sanitise user-generated content before rendering as HTML
  • Decode escaped entities copied from email source or webpage view-source
  • Safely include angle brackets, ampersands and quotes in static HTML

Frequently asked questions

Why escape HTML entities?
To prevent user-controlled text from being interpreted as HTML or executed as script. Escaping <, >, &, " and ' is the foundation of XSS-safe rendering.
Should I use named or numeric entities?
Named entities (&amp;, &lt;) are more readable; numeric (&#38;, &#60;) work everywhere. Both are valid HTML5 — pick named for clarity, numeric for universal compatibility.

Related tools