HTML Encoder / Decoder

Encode special characters to HTML entities or decode entities back to plain text — 100% browser-based, instant, no data sent anywhere.

Input
Output
Input: 0 chars Output: 0 chars

Common HTML Entities Reference

CharacterNamed EntityNumeric EntityDescription
&&&Ampersand
<&lt;&#60;Less-than sign
>&gt;&#62;Greater-than sign
"&quot;&#34;Double quote
'&#39;&#39;Single quote / apostrophe
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright sign
®&reg;&#174;Registered sign
&trade;&#8482;Trade mark sign
&mdash;&#8212;Em dash

How to Use

  1. Paste your plain text into the left panel if you want to encode it to HTML entities.
  2. Click Encode HTML to convert special characters (< > & ") to their safe HTML entity equivalents.
  3. To decode, paste HTML containing entities into the left panel and click Decode HTML to get the readable plain text.
  4. Use the Swap button to exchange input and output, making it easy to chain encode/decode operations.
  5. Enable Encode non-ASCII to convert all characters above ASCII 127 (accented letters, CJK, emoji) to numeric entities like &#8364; — useful for legacy HTML systems.

About This Tool

HTML entities are special sequences used to display reserved characters in HTML without the browser interpreting them as markup. The five most important are &amp; (ampersand), &lt; (less-than), &gt; (greater-than), &quot; (double quote), and &#39; (single quote). Encoding these characters is essential when inserting user-supplied content into HTML, generating HTML emails, writing XML, or building template strings. Decoding is equally important when parsing HTML from external sources or reading entity-escaped content from a database. This tool handles all standard named and numeric HTML entities via the browser’s built-in DOM parser — no external libraries needed, no data sent to any server.

Frequently Asked Questions

Why must I encode & before < and >?

Because the ampersand & is itself the entity escape character. If you replace < first and produce &lt;, you must not re-encode the & or you would get &amp;lt;. This tool always encodes & first to avoid double-encoding. If you paste already-encoded text and click Encode again, use Decode first.

When should I use numeric entities vs. named entities?

Named entities like &copy; are more readable, but only work in HTML5-aware parsers. Numeric entities like &#169; are universally supported in HTML, XHTML, XML, and most legacy parsers. Use numeric entities when you need the widest compatibility — for example, in RSS feeds, XHTML documents, or SVG files.

Does this tool handle all HTML5 named entities?

For decoding, yes — the browser’s DOM parser handles all ~2,000 HTML5 named entities automatically. For encoding, this tool produces the five most critical named entities (&amp;, &lt;, &gt;, &quot;, &#39;) plus optional numeric encoding for non-ASCII characters. This covers the vast majority of real-world encoding needs.

Related Tools