Quick answer: an HTML entity swaps a character for an &…; sequence so markup can't misread it: & renders as &, © as ©, and numeric © / © hit the same code point. Paste text below, pick a mode, and the conversion runs instantly in your browser.

Convert

Encode: named
Encode: & < > only
Encode: decimal
Encode: hex
Decode: named + numeric → characters
Input0 chars
Output0 chars
⇄ Use output as input
📋 Copy output
Ad

HTML Entity Reference Table (42 Most-Used Named Entities)

NamedCharacterDecimalHexCode Point
&amp;&&#38;&#x26;38
&lt;<&#60;&#x3c;60
&gt;>&#62;&#x3e;62
&quot;"&#34;&#x22;34
&apos;'&#39;&#x27;39
&nbsp; &#160;&#xa0;160
&copy;©&#169;&#xa9;169
&reg;®&#174;&#xae;174
&trade;™&#8482;&#x2122;8482
&deg;°&#176;&#xb0;176
&frac12;½&#189;&#xbd;189
&times;×&#215;&#xd7;215
&divide;÷&#247;&#xf7;247
&para;&#182;&#xb6;182
&laquo;«&#171;&#xab;171
&raquo;»&#187;&#xbb;187
&lsquo;‘&#8216;&#x2018;8216
&rsquo;’&#8217;&#x2019;8217
&ldquo;“&#8220;&#x201c;8220
&rdquo;”&#8221;&#x201d;8221
&hellip;…&#8230;&#x2026;8230
&ndash;–&#8211;&#x2013;8211
&mdash;—&#8212;&#x2014;8212
&euro;€&#8364;&#x20ac;8364
&pound;£&#163;&#xa3;163
&yen;¥&#165;&#xa5;165
&cent;¢&#162;&#xa2;162
&bull;•&#8226;&#x2022;8226
&dagger;†&#8224;&#x2020;8224
&larr;←&#8592;&#x2190;8592
&rarr;→&#8594;&#x2192;8594
&infin;∞&#8734;&#x221e;8734
&alpha;α&#945;&#x3b1;945
&pi;π&#960;&#x3c0;960
&sum;∑&#8721;&#x2211;8721
&aacute;á&#225;&#xe1;225
&eacute;é&#233;&#xe9;233
&ntilde;ñ&#241;&#xf1;241
&szlig;ß&#223;&#xdf;223
&aring;å&#229;&#xe5;229
&aelig;æ&#230;&#xe6;230
&ccedil;ç&#231;&#xe7;231

The converter knows 131 names in total, including 12 Greek letters and 22 lowercase accented or special Latin letters, but none for capital accented letters such as É. When you encode, any character outside the list falls back to a numeric form, so nothing is lost.

How the Entity Converter Works

Entities exist because HTML parses certain characters as structure. An ampersand might begin an entity reference, an angle bracket might open a tag, and plenty of Unicode characters can't be typed at all. The escape hatch is the same in every case: write the character's name or code point between an ampersand and a semicolon.

The three forms

Named: &eacute; → é. Decimal: &#233; → é. Hex: &#xE9; → é. All three address Unicode code point 233, and each of the 2,125 semicolon-terminated names in the HTML Standard can also be written numerically from its code point or points.

How to use it

Paste your text, pick a mode, and the output updates as you type. "Encode: named" is the everyday choice — it escapes &, <, > and converts every non-ASCII character to its named entity when the converter knows one. "Encode: & < > only" produces the smallest safe output for HTML text nodes. The decimal and hex modes write every non-ASCII character as a number and keep names only for &amp;, &lt; and &gt;, which is what you want for email templates and code generation. Decode handles all three forms in one pass and leaves unknown sequences untouched.

A worked example

The input box starts with Tom & Jerry <3 "Café" — €5 — real characters, including é (code point 233), an em dash (8212), and € (8364). In "Encode: named" mode that becomes Tom &amp; Jerry &lt;3 "Caf&eacute;" &mdash; &euro;5: the ampersand and angle bracket get escaped first so nothing can be misread as markup, then each non-ASCII character swaps for its name.

Switch to hex mode and the same input comes out with &#xe9; for é and &#x20ac; for €, skipping names entirely. Emoji have no names in HTML at all, so 😀 encodes as &#128512; in named and decimal modes and &#x1f600; in hex mode, while the "& < > only" mode leaves it as typed. Hit decode on any of these outputs and the original text comes back in a single pass.

Which characters do you have to escape in HTML?

Two in ordinary text, plus the matching quote inside an attribute. The HTML Standard says text between tags can't contain a literal < or an ambiguous ampersand (an & followed by letters or digits and a semicolon that isn't a real name). A double-quoted attribute value can't contain a literal ", and a single-quoted one can't contain a literal '. Most code escapes all five every time because that's simpler.

CharacterEntityIn text between tagsIn an attribute valueThis tool (all 4 encode modes)
&&amp;Escape itEscape it&amp;
<&lt;Escape itOptional inside quotes&lt;
>&gt;Not required; usual practiceOptional inside quotes&gt;
"&quot;Not neededRequired inside a double-quoted valueLeft as "
'&#39; or &apos;Not neededRequired inside a single-quoted valueLeft as '

Here's the gap to know about: this converter never escapes quotes. Paste <a title="5 > 3">it's</a> and every encode mode returns &lt;a title="5 &gt; 3"&gt;it's&lt;/a&gt;. That's fine for text you're showing between tags. If the result is going inside an attribute value, replace " with &quot; (or ' with &#39;) yourself. And always quote the attribute, because an unquoted value can't hold spaces, quotes, =, <, > or a backtick.

What does each mode output for the same character?

We ran these 7 characters through the page's own encode functions. The fourth mode, "Encode: & < > only", leaves every one of them exactly as typed, so it isn't in the table.

CharacterCode pointEncode: namedEncode: decimalEncode: hex
©U+00A9&COPY;&#169;&#xa9;
™U+2122&TRADE;&#8482;&#x2122;
€U+20AC&euro;&#8364;&#x20ac;
non-breaking spaceU+00A0&nbsp;&#160;&#xa0;
— (em dash)U+2014&mdash;&#8212;&#x2014;
šU+0161&#353;&#353;&#x161;
😀U+1F600&#128512;&#128512;&#x1f600;

Three things stand out. First, named mode writes &COPY;, &REG; and &TRADE; in capitals. Those are real names in the HTML Standard and render the same, but if you want &copy;, change the case by hand. Second, a character missing from the tool's list falls back to decimal even in named mode: HTML defines &scaron; for š, but you get &#353;. Third, an emoji gets one reference per code point. The family emoji 👨‍👩‍👧 is three people joined by two zero-width joiners, so it becomes five references: &#128104;&#8205;&#128105;&#8205;&#128103;.

Named or numeric: which should you use?

If your page is served as UTF-8, you usually need neither. Type © or é directly and escape only the markup characters, which is what the "& < > only" mode does. Entities earn their place when a file has to stay pure ASCII or when a character is invisible, like a non-breaking space.

Formé€😀CoverageWorks in XML
Named&eacute; (8 characters)&euro; (6)No name exists2,125 names in HTML, 131 in this toolOnly amp, lt, gt, apos and quot
Decimal&#233; (6)&#8364; (7)&#128512; (9)Any code pointYes
Hex&#xe9; (6)&#x20ac; (8)&#x1f600; (9)Any code pointYes

Names are easier to read, numbers work everywhere. XML parsers only have to know five names, so &nbsp; in an RSS feed or SVG file is an error unless the file declares it, while &#160; is fine. Size is close to a wash: the 25-character example Crème brûlée €7.50 © 2026 comes out at 55 characters in named mode, 51 in decimal and 52 in hex.

How is the decoder different from a browser?

It's stricter, and it knows fewer names. The decoder converts a reference only when it ends in a semicolon, it makes one pass, and it recognises 131 names out of the 2,231 in the HTML Standard (2,125 that end in a semicolon and 106 legacy forms that don't need one). We ran each input below through the page's decode function and compared it with the standard's parsing rules.

You pasteThis tool returnsA browser shows
&copy (no semicolon)Unchanged© in text, with a parse error
&#169 (no semicolon)Unchanged©, with a parse error
&Eacute;Unchanged (not in the 131)É
&amp;amp;&amp;&amp;
&#128;The invisible control character U+0080€ (remapped to U+20AC)
&#0;A NUL character (U+0000)The replacement character U+FFFD
&#x110000; (past the end of Unicode)UnchangedU+FFFD

A browser accepts 106 legacy names such as &amp, &lt, &nbsp and &copy without the semicolon in text. Inside an attribute it backs off when the next character is = or a letter or digit, which is why a link like ?a=1&copy=2 survives.

The other trap is the range 128 to 159. Browsers remap 27 of those numbers to the Windows-1252 characters old pages meant, so &#150; displays as an en dash. The tool gives you the raw control character, which is invisible.

Is entity encoding enough to stop XSS?

No, not by itself. The OWASP Cross Site Scripting Prevention Cheat Sheet recommends HTML entity encoding for one situation, which is untrusted data placed between two tags, and its version converts &, <, >, " and '. Other places need other encoding: attribute encoding for quoted attribute values, percent-encoding for URL parameters (the URL encoder does that), and separate rules for JavaScript and CSS. OWASP also lists contexts where no encoding saves you, such as untrusted data used as a whole event-handler value.

This page formats snippets for display. It isn't a security filter, so in an application rely on your template engine's automatic escaping.

For more, read the HTML entities guide. Related tools: minify HTML, HTML to Markdown and the Base64 encoder.

Frequently Asked Questions

What is an HTML entity?

An HTML entity is a stand-in sequence for a character that would otherwise be parsed as markup or that a keyboard can't type. It starts with an ampersand and ends with a semicolon, like &amp; for &, &lt; for <, or &copy; for the copyright sign. Numeric forms like &#169; or &#xA9; address the character's Unicode code point directly.

When do I need to escape & < > in HTML?

Inside element text, & < and > are the three that matter: & could start an entity, and < could start a tag. Escape & whenever it's followed by something that could look like an entity, and escape < always; > is technically forgiving in text but escaping it is standard practice. Inside attribute values you should also escape quotes that match the delimiter.

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

&nbsp; (U+00A0) is a non-breaking space. A browser will not wrap a line at it, and HTML collapses runs of normal spaces down to one, while nbsp sequences render in full. That's why old-school indenting used nbsp runs and why prices like 10 USD keep the unit glued to the number.

Are named entities case-sensitive?

Yes. &copy; is the copyright sign but &COPY; also works in HTML5, while Greek letters are strictly case-linked: &pi; is lowercase and &Pi; is uppercase. Numeric forms sidestep the whole issue, which is one reason code generators usually emit &#...; instead of names.

Why does the decoder leave &amp;lt; as &amp;lt; instead of turning it into <?

Because of single-pass decoding. The text &amp;lt; means the original string was literally &lt; (someone escaped an ampersand in front of lt;). Decoding in one pass preserves that; repeatedly re-decoding until nothing changes would corrupt double-escaped text, so well-behaved decoders stop after one pass.

How many named entities does HTML5 define?

HTML5 defines 2,231 named character references, 2,125 of them terminated with a semicolon (the rest are legacy forms that work without one). This converter maps 131 that cover everyday text: markup specials, currency, punctuation, math symbols, Greek letters, and accented Latin characters. Anything else still round-trips through numeric decimal or hex forms.

Does this converter escape quotes for attribute values?

No. All four encode modes leave double and single quotes exactly as typed, so <a title="5 > 3">it's</a> comes back as &lt;a title="5 &gt; 3"&gt;it's&lt;/a&gt;. For an attribute value, change the quote that matches your delimiter to &quot; or &#39; by hand. Decoding works both ways: &quot;, &apos; and &#39; all turn back into quote characters.

Why did my entity not decode?

Usually one of two reasons. The decoder needs the trailing semicolon, so &copy and &#169 stay as typed. And it only knows 131 names, so valid ones such as &Eacute;, &thorn; and &minus; are left alone. Numeric references always decode: &#201; gives É.