HTML Entity Encoder / Decoder

Escape text so it displays safely inside HTML, or turn entities like < & © back into normal characters. Includes a cheat sheet of the most common HTML entities.

Characters to convert
Entity style
HTML entities cheat sheet (58 common entities)
CharNamedDecimalDescription
& & & Ampersand
< &lt; &#60; Less-than sign
> &gt; &#62; Greater-than sign
" &quot; &#34; Double quote
' &apos; &#39; Apostrophe / single quote (HTML5)
(space) &nbsp; &#160; Non-breaking space
© &copy; &#169; Copyright sign
® &reg; &#174; Registered trademark
™ &trade; &#8482; Trademark
° &deg; &#176; Degree sign
± &plusmn; &#177; Plus-minus sign
× &times; &#215; Multiplication sign
÷ &divide; &#247; Division sign
· &middot; &#183; Middle dot
• &bull; &#8226; Bullet
… &hellip; &#8230; Ellipsis
– &ndash; &#8211; En dash
— &mdash; &#8212; Em dash
‘ &lsquo; &#8216; Left single quote
’ &rsquo; &#8217; Right single quote / curly apostrophe
“ &ldquo; &#8220; Left double quote
” &rdquo; &#8221; Right double quote
« &laquo; &#171; Left guillemet
» &raquo; &#187; Right guillemet
§ &sect; &#167; Section sign
&para; &#182; Pilcrow (paragraph sign)
€ &euro; &#8364; Euro
£ &pound; &#163; Pound sterling
¥ &yen; &#165; Yen / yuan
¢ &cent; &#162; Cent
← &larr; &#8592; Left arrow
→ &rarr; &#8594; Right arrow
↑ &uarr; &#8593; Up arrow
↓ &darr; &#8595; Down arrow
↔ &harr; &#8596; Left-right arrow
≤ &le; &#8804; Less than or equal to
≥ &ge; &#8805; Greater than or equal to
≠ &ne; &#8800; Not equal to
≈ &asymp; &#8776; Approximately equal to
∞ &infin; &#8734; Infinity
½ &frac12; &#189; One half
¼ &frac14; &#188; One quarter
¾ &frac34; &#190; Three quarters
² &sup2; &#178; Superscript 2 (squared)
³ &sup3; &#179; Superscript 3 (cubed)
µ &micro; &#181; Micro sign
α &alpha; &#945; Greek small alpha
β &beta; &#946; Greek small beta
π &pi; &#960; Greek small pi
Ω &Omega; &#937; Greek capital Omega
é &eacute; &#233; e with acute accent
ü &uuml; &#252; u with umlaut
ñ &ntilde; &#241; n with tilde
‰ &permil; &#8240; Per mille sign
(space) &ensp; &#8194; En space
(space) &emsp; &#8195; Em space
(space) &thinsp; &#8201; Thin space
(space) &shy; &#173; Soft hyphen

How to use the HTML Entity Encoder / Decoder

  1. Choose “Encode (escape)” or “Decode (unescape)” at the top.
  2. When encoding, pick which characters to convert (“Special characters only” or “Also all non-ASCII”) and the entity style: named, decimal or hex.
  3. Paste your text. The result appears instantly; click “Copy result”, or use “Convert result back” to check the round trip.

Which characters must be escaped in HTML?

Five characters have special meaning in HTML: & starts an entity, < and > delimit tags, and " and ' close attribute values. To show them as literal text, write &amp; &lt; &gt; &quot; and &#39;. For example, to display the code <b>AT&T</b> on a page, write &lt;b&gt;AT&amp;T&lt;/b&gt;.

With UTF-8, which nearly every site uses today, you don’t need to escape other characters such as é, €, © or emoji. Choose “Also all non-ASCII” only when the output must be pure ASCII, for example in some email templates, legacy systems or source files with an unknown encoding.

Named, decimal and hex character references

The same character can be written three ways: named (&copy;), decimal (&#169;) and hexadecimal (&#xA9;). Named entities are easiest to read, but only about 2,000 characters have names. Numeric references work for every Unicode code point; the hex form matches the U+00A9 notation used in Unicode charts.

&apos; is defined in HTML5 and XML but not in HTML 4, so this tool writes a single quote as &#39; for maximum compatibility. When decoding, every HTML5 named entity your browser knows is supported, not just the ones in the table.

Escaping and XSS

Inserting user input into a page without escaping it is the root cause of cross-site scripting (XSS): if someone enters <script>…</script> and it is written straight into the HTML, the browser runs it. Escaping turns it into plain, harmless text.

HTML escaping only protects HTML content and quoted attributes. JavaScript strings, URLs and CSS each need their own escaping (for example, encodeURIComponent for URL parameters). In real projects, rely on your template engine or framework’s automatic escaping, such as React’s JSX or Jinja’s autoescape, and use this tool for one-off conversions and debugging.

Non-breaking spaces and other invisible characters

&nbsp; is a space that never breaks across lines. It is useful between a number and its unit (10&nbsp;kg) or in names like “Mr.&nbsp;Smith”. Avoid using rows of &nbsp; for layout; use CSS margins and padding instead.

&shy; marks a place where a long word may be hyphenated if needed, and &thinsp; is a narrow space often used in typography, for example around an em dash or between digit groups. They are invisible, so the table labels them “(space)”.

Frequently asked questions

What is the difference between &nbsp; and a normal space?

A normal space can be a line break point and several in a row collapse into one. &nbsp; (non-breaking space, U+00A0) keeps the words on either side on the same line, and consecutive &nbsp; characters are not collapsed.

Do I need to escape quotes in HTML text?

Not in normal text content. Quotes only need escaping inside attribute values that use the same quote character, for example title="She said &quot;hi&quot;". Escaping them everywhere is harmless, which is why this tool does it.

Why does decoding leave some entities unchanged?

Unknown names such as &foo; and entities missing their final semicolon are left as they are, because guessing could corrupt your text. Check the spelling: entity names are case-sensitive, so &Omega; and &omega; are different characters.

Should I write © or &copy;?

If your page is UTF-8, which it almost certainly is, you can type © directly. Use &copy; when you want the source to stay ASCII-only or when you can’t easily type the character.

How do I show HTML code on a web page?

Escape it first: paste the code here in “Encode” mode and put the result inside <pre><code>…</code></pre>. Without escaping, the browser would treat the tags as real markup instead of showing them.

Is my text sent to a server?

No. Encoding and decoding happen entirely in your browser. Only your option choices are remembered on this device.

Last updated: View source code