HTML Entity Encode / Decode

Escape HTML special characters (< > & " ') into entities to safely display raw text/code on a page, or decode entities back.

How it works

Encode replaces the five XML-safe special characters (&, <, >, ", ') with their named entities, so HTML/code can be rendered as literal text on a page instead of being parsed as markup. Decode reverses common named entities (like &nbsp;, &copy;, &hellip;) plus any numeric entity (&#65; or &#x41;).