HTML Named Entity Encoder/Decoder

Convert special characters to named entities like & and <

Ad placeholder (leaderboard)

HTML named entities let you show characters that would otherwise be interpreted as markup. This tool escapes the critical characters and a useful table of common symbols into their &name; form, and decodes them back to plain text.

How it works

Encoding replaces the ampersand first, then the remaining special characters, so no escape sequence is ever double-processed:

& -> &
< -> &lt;
> -> &gt;
" -> &quot;
' -> &#39;
© -> &copy;     (non-breaking space) -> &nbsp;

Decoding scans for &...; references, looks each named entity up in the table, and also expands numeric references such as &#160; and &#xA0; so mixed input is handled cleanly.

Tips and notes

Always encode the ampersand before any other character — this is the single most common bug in hand-rolled escapers. When putting user text inside an HTML attribute, the double quote must be escaped (&quot;), which this tool does. For content that will be parsed as XML rather than HTML, prefer the dedicated XML escaper, since HTML defines hundreds of named entities that XML does not.

Ad placeholder (rectangle)