HTML entity encoder

Turn special characters into HTML entities (< โ†’ &lt;) or go the other way: essential whenever you need to display code inside a web page.

๐Ÿ”’ Your text stays in your browser: nothing is stored or sent anywhere.

The five reserved characters of HTML

Five characters have special meaning on a web page: < and > open and close tags, & introduces entities, and double quotes and the apostrophe delimit attributes. If you want the browser to display them instead of interpreting them โ€” say, in a code snippet on a blog, in a technical article, or in a CMS field โ€” they must be converted to the entities &lt;, &gt;, &amp;, &quot; and &#39;. The tool converts the ampersand first, so entities already present don't get encoded twice, and for the apostrophe it uses the numeric form &#39;, which is also compatible with older HTML where &apos; wasn't recognized.

Encode or decode: which one do you need?

Use encoding when you need to paste code into an HTML page, a technical comment, or an attribute without it being interpreted as markup. Use decoding when you receive text littered with &eacute;, &amp; or &#8217; โ€” a common sight in RSS feeds, database exports, and legacy CMS content โ€” and want it back as readable characters. Decoding relies on the browser's native parser, so it recognizes every named entity (over two thousand of them) as well as numeric ones, both decimal and hexadecimal.