1. Home
  2. Developer
  3. HTML Entity Converter

HTML Entity Converter

Turn < > & into entities, and &lt; &copy; back into characters.

For every format and option in one place, use Encoder and Decoder →

Runs in your browser · No upload
Result
&lt;p class=&quot;note&quot;&gt;Tom &amp; Jerry&#39;s café © 2026 | hello 😀&lt;/p&gt;
Replaced
8

How to use

  1. Choose Encode and enter text. <, >, &, " and ' come out as entities, ready to show HTML source on a page or to place inside an attribute.
  2. To convert letters with accents, symbols and emoji too, change the encode scope to + non-ASCII or Everything but letters, digits, spaces.
  3. Pick a reference style: named (&copy;), decimal (&#169;) or hex (&#xA9;). Characters without a name fall back to decimal, even in named-first mode.
  4. To turn text like &lt;p&gt; back into characters, choose Decode. Names the tool does not know are left alone and counted.

The five characters you must escape

Character Entity Without escaping
& &amp; the text after it may be read as an entity
< &lt; read as the start of a tag
> &gt; read as the end of a tag
" &quot; cuts a double-quoted attribute short
' &#39; cuts a single-quoted attribute short

Putting user-supplied text into HTML without escaping lets a <script> tag run, which is the classic XSS hole. A sentence like 5 < 6 can also be parsed as a tag and break the layout. In body text &, < and > are enough, but inside attribute values the quotes need escaping too. The default scope (The 5 required characters) covers both cases.

Named, decimal and hex references

The same © sign can be written three ways with identical results.

Style Example Notes
Named &copy;, &mdash;, &euro; easy to read, only for characters that have a name
Decimal &#169;, &#8212;, &#54620; works for every character
Hex &#xA9;, &#x2014;, &#xD55C; matches the Unicode chart number (U+00A9), easy to look up

Characters outside the BMP, such as emoji, become one code point rather than two surrogate halves: 😀 is &#128512; or &#x1F600;. Encoding café © | 한 😀 with the + non-ASCII scope gives:

  • Named first: caf&eacute; &copy; &mdash; &#54620; &#128512; (Hangul has no names, so decimal)
  • Decimal: caf&#233; &#169; &#8212; &#54620; &#128512;
  • Hex: caf&#xE9; &#xA9; &#x2014; &#xD55C; &#x1F600;

Decoding rules and caveats

  • Named references use a table of about 250 common names: Latin-1 letters, Greek, math symbols, arrows, quotes and dashes. It is not the full HTML5 list of 2,000+ names. A name that is not in the table stays as written and is counted.
  • Old forms without a semicolon, such as &amp, &lt, &gt, &quot, &copy, &reg and &nbsp, are read as well. Numeric references (&#169, &#xA9) work without a semicolon too.
  • &#0;, the surrogate range (&#xD800; to &#xDFFF;) and values above 10FFFF become the replacement character � (U+FFFD).
  • Decoding is plain string processing and never uses the browser’s HTML parser, so a <script> in the input is never executed.
  • Text is decoded once: &amp;lt; becomes &lt;, not <. If text was encoded twice, decode it a second time.
  • In a UTF-8 document there is no need to encode accented letters or Hangul. Keep the scope on The 5 required characters.

The text you enter is processed in your browser only and never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.