[{"data":1,"prerenderedAt":1240},["ShallowReactive",2],{"guide-html-entity-reference":3},{"id":4,"title":5,"body":6,"date":1230,"description":1231,"extension":1232,"meta":1233,"navigation":1234,"path":1235,"readingTime":1236,"seo":1237,"stem":1238,"__hash__":1239},"guides\u002Fguides\u002Fhtml-entity-reference.md","HTML Entity Reference: Named, Decimal, and Hex Formats",{"type":7,"value":8,"toc":1212},"minimark",[9,14,18,21,25,28,186,193,197,560,564,569,572,613,616,620,627,652,671,675,678,857,860,864,950,954,1016,1019,1023,1077,1081,1084,1114,1136,1140,1171,1175,1196,1200,1208],[10,11,13],"h2",{"id":12},"what-are-html-entity-formats","What Are HTML Entity Formats?",[15,16,17],"p",{},"HTML entities represent special characters using code sequences instead of the literal character. Three formats exist — named, decimal numeric, and hexadecimal numeric — and each serves a different purpose.",[15,19,20],{},"All three formats produce the same result. Choosing the right one depends on readability, compatibility, and the character you need.",[10,22,24],{"id":23},"core-named-entities","Core Named Entities",[15,26,27],{},"These five named entities cover the characters that HTML itself reserves. You will use them constantly:",[29,30,31,53],"table",{},[32,33,34],"thead",{},[35,36,37,41,44,47,50],"tr",{},[38,39,40],"th",{},"Character",[38,42,43],{},"Named Entity",[38,45,46],{},"Decimal",[38,48,49],{},"Hex",[38,51,52],{},"Use Case",[54,55,56,86,111,136,161],"tbody",{},[35,57,58,65,70,75,80],{},[59,60,61],"td",{},[62,63,64],"code",{},"&",[59,66,67],{},[62,68,69],{},"&amp;",[59,71,72],{},[62,73,74],{},"&#38;",[59,76,77],{},[62,78,79],{},"&#x26;",[59,81,82,83,85],{},"Any time ",[62,84,64],{}," appears as data",[35,87,88,93,98,103,108],{},[59,89,90],{},[62,91,92],{},"\u003C",[59,94,95],{},[62,96,97],{},"&lt;",[59,99,100],{},[62,101,102],{},"&#60;",[59,104,105],{},[62,106,107],{},"&#x3C;",[59,109,110],{},"Less-than sign in text",[35,112,113,118,123,128,133],{},[59,114,115],{},[62,116,117],{},">",[59,119,120],{},[62,121,122],{},"&gt;",[59,124,125],{},[62,126,127],{},"&#62;",[59,129,130],{},[62,131,132],{},"&#x3E;",[59,134,135],{},"Greater-than sign in text",[35,137,138,143,148,153,158],{},[59,139,140],{},[62,141,142],{},"\"",[59,144,145],{},[62,146,147],{},"&quot;",[59,149,150],{},[62,151,152],{},"&#34;",[59,154,155],{},[62,156,157],{},"&#x22;",[59,159,160],{},"Quotes inside attribute values",[35,162,163,168,173,178,183],{},[59,164,165],{},[62,166,167],{},"'",[59,169,170],{},[62,171,172],{},"&apos;",[59,174,175],{},[62,176,177],{},"&#39;",[59,179,180],{},[62,181,182],{},"&#x27;",[59,184,185],{},"Apostrophes inside attribute values",[15,187,188,192],{},[189,190,191],"strong",{},"Rule:"," Encode these five characters every time they appear as data inside HTML. Failing to do so can break your markup or open XSS vulnerabilities.",[10,194,196],{"id":195},"common-symbols","Common Symbols",[29,198,199,214],{},[32,200,201],{},[35,202,203,205,207,209,211],{},[38,204,40],{},[38,206,43],{},[38,208,46],{},[38,210,49],{},[38,212,213],{},"Description",[54,215,216,239,262,285,308,331,354,377,400,423,446,469,492,515,538],{},[35,217,218,221,226,231,236],{},[59,219,220],{},"©",[59,222,223],{},[62,224,225],{},"&copy;",[59,227,228],{},[62,229,230],{},"&#169;",[59,232,233],{},[62,234,235],{},"&#xA9;",[59,237,238],{},"Copyright",[35,240,241,244,249,254,259],{},[59,242,243],{},"®",[59,245,246],{},[62,247,248],{},"&reg;",[59,250,251],{},[62,252,253],{},"&#174;",[59,255,256],{},[62,257,258],{},"&#xAE;",[59,260,261],{},"Registered trademark",[35,263,264,267,272,277,282],{},[59,265,266],{},"™",[59,268,269],{},[62,270,271],{},"&trade;",[59,273,274],{},[62,275,276],{},"&#8482;",[59,278,279],{},[62,280,281],{},"&#x2122;",[59,283,284],{},"Trademark",[35,286,287,290,295,300,305],{},[59,288,289],{},"€",[59,291,292],{},[62,293,294],{},"&euro;",[59,296,297],{},[62,298,299],{},"&#8364;",[59,301,302],{},[62,303,304],{},"&#x20AC;",[59,306,307],{},"Euro",[35,309,310,313,318,323,328],{},[59,311,312],{},"£",[59,314,315],{},[62,316,317],{},"&pound;",[59,319,320],{},[62,321,322],{},"&#163;",[59,324,325],{},[62,326,327],{},"&#xA3;",[59,329,330],{},"Pound sterling",[35,332,333,336,341,346,351],{},[59,334,335],{},"¥",[59,337,338],{},[62,339,340],{},"&yen;",[59,342,343],{},[62,344,345],{},"&#165;",[59,347,348],{},[62,349,350],{},"&#xA5;",[59,352,353],{},"Yen",[35,355,356,359,364,369,374],{},[59,357,358],{},"°",[59,360,361],{},[62,362,363],{},"&deg;",[59,365,366],{},[62,367,368],{},"&#176;",[59,370,371],{},[62,372,373],{},"&#xB0;",[59,375,376],{},"Degree",[35,378,379,382,387,392,397],{},[59,380,381],{},"±",[59,383,384],{},[62,385,386],{},"&plusmn;",[59,388,389],{},[62,390,391],{},"&#177;",[59,393,394],{},[62,395,396],{},"&#xB1;",[59,398,399],{},"Plus-minus",[35,401,402,405,410,415,420],{},[59,403,404],{},"×",[59,406,407],{},[62,408,409],{},"&times;",[59,411,412],{},[62,413,414],{},"&#215;",[59,416,417],{},[62,418,419],{},"&#xD7;",[59,421,422],{},"Multiplication",[35,424,425,428,433,438,443],{},[59,426,427],{},"÷",[59,429,430],{},[62,431,432],{},"&divide;",[59,434,435],{},[62,436,437],{},"&#247;",[59,439,440],{},[62,441,442],{},"&#xF7;",[59,444,445],{},"Division",[35,447,448,451,456,461,466],{},[59,449,450],{},"—",[59,452,453],{},[62,454,455],{},"&mdash;",[59,457,458],{},[62,459,460],{},"&#8212;",[59,462,463],{},[62,464,465],{},"&#x2014;",[59,467,468],{},"Em dash",[35,470,471,474,479,484,489],{},[59,472,473],{},"–",[59,475,476],{},[62,477,478],{},"&ndash;",[59,480,481],{},[62,482,483],{},"&#8211;",[59,485,486],{},[62,487,488],{},"&#x2013;",[59,490,491],{},"En dash",[35,493,494,497,502,507,512],{},[59,495,496],{},"«",[59,498,499],{},[62,500,501],{},"&laquo;",[59,503,504],{},[62,505,506],{},"&#171;",[59,508,509],{},[62,510,511],{},"&#xAB;",[59,513,514],{},"Left angle quote",[35,516,517,520,525,530,535],{},[59,518,519],{},"»",[59,521,522],{},[62,523,524],{},"&raquo;",[59,526,527],{},[62,528,529],{},"&#187;",[59,531,532],{},[62,533,534],{},"&#xBB;",[59,536,537],{},"Right angle quote",[35,539,540,542,547,552,557],{},[59,541],{},[59,543,544],{},[62,545,546],{},"&nbsp;",[59,548,549],{},[62,550,551],{},"&#160;",[59,553,554],{},[62,555,556],{},"&#xA0;",[59,558,559],{},"Non-breaking space",[10,561,563],{"id":562},"numeric-entities-explained","Numeric Entities Explained",[565,566,568],"h3",{"id":567},"decimal-format","Decimal format",[15,570,571],{},"Decimal entities use the character's Unicode code point in base 10:",[573,574,579],"pre",{"className":575,"code":576,"language":577,"meta":578,"style":578},"language-html shiki shiki-themes github-light github-dark","\u003Cp>Copyright &#169; 2026\u003C\u002Fp>\n\u003C!-- Renders: Copyright © 2026 -->\n","html","",[62,580,581,606],{"__ignoreMap":578},[582,583,586,589,592,595,598,601,603],"span",{"class":584,"line":585},"line",1,[582,587,92],{"class":588},"sVt8B",[582,590,15],{"class":591},"s9eBZ",[582,593,594],{"class":588},">Copyright ",[582,596,230],{"class":597},"sj4cs",[582,599,600],{"class":588}," 2026\u003C\u002F",[582,602,15],{"class":591},[582,604,605],{"class":588},">\n",[582,607,609],{"class":584,"line":608},2,[582,610,612],{"class":611},"sJ8bj","\u003C!-- Renders: Copyright © 2026 -->\n",[15,614,615],{},"The decimal value matches the number you find in Unicode charts — U+00A9 has decimal value 169.",[565,617,619],{"id":618},"hexadecimal-format","Hexadecimal format",[15,621,622,623,626],{},"Hex entities use the code point in base 16, prefixed with ",[62,624,625],{},"x",":",[573,628,630],{"className":575,"code":629,"language":577,"meta":578,"style":578},"\u003Cp>Copyright &#xA9; 2026\u003C\u002Fp>\n\u003C!-- Renders: Copyright © 2026 -->\n",[62,631,632,648],{"__ignoreMap":578},[582,633,634,636,638,640,642,644,646],{"class":584,"line":585},[582,635,92],{"class":588},[582,637,15],{"class":591},[582,639,594],{"class":588},[582,641,235],{"class":597},[582,643,600],{"class":588},[582,645,15],{"class":591},[582,647,605],{"class":588},[582,649,650],{"class":584,"line":608},[582,651,612],{"class":611},[15,653,654,655,658,659,662,663,666,667,670],{},"Hex format maps directly to the standard Unicode notation. U+00A9 becomes ",[62,656,657],{},"&#x00A9;"," — you simply drop the ",[62,660,661],{},"U+"," prefix and add ",[62,664,665],{},"&#x"," ... ",[62,668,669],{},";",".",[565,672,674],{"id":673},"when-numeric-is-your-only-option","When numeric is your only option",[15,676,677],{},"Most characters beyond the common symbols lack named entities:",[29,679,680,695],{},[32,681,682],{},[35,683,684,686,689,691,693],{},[38,685,40],{},[38,687,688],{},"Named",[38,690,46],{},[38,692,49],{},[38,694,213],{},[54,696,697,717,737,757,777,797,817,837],{},[35,698,699,702,704,709,714],{},[59,700,701],{},"≠",[59,703,450],{},[59,705,706],{},[62,707,708],{},"&#8800;",[59,710,711],{},[62,712,713],{},"&#x2260;",[59,715,716],{},"Not equal",[35,718,719,722,724,729,734],{},[59,720,721],{},"≤",[59,723,450],{},[59,725,726],{},[62,727,728],{},"&#8804;",[59,730,731],{},[62,732,733],{},"&#x2264;",[59,735,736],{},"Less than or equal",[35,738,739,742,744,749,754],{},[59,740,741],{},"≥",[59,743,450],{},[59,745,746],{},[62,747,748],{},"&#8805;",[59,750,751],{},[62,752,753],{},"&#x2265;",[59,755,756],{},"Greater than or equal",[35,758,759,762,764,769,774],{},[59,760,761],{},"→",[59,763,450],{},[59,765,766],{},[62,767,768],{},"&#8594;",[59,770,771],{},[62,772,773],{},"&#x2192;",[59,775,776],{},"Right arrow",[35,778,779,782,784,789,794],{},[59,780,781],{},"←",[59,783,450],{},[59,785,786],{},[62,787,788],{},"&#8592;",[59,790,791],{},[62,792,793],{},"&#x2190;",[59,795,796],{},"Left arrow",[35,798,799,802,804,809,814],{},[59,800,801],{},"₹",[59,803,450],{},[59,805,806],{},[62,807,808],{},"&#8377;",[59,810,811],{},[62,812,813],{},"&#x20B9;",[59,815,816],{},"Indian rupee",[35,818,819,822,824,829,834],{},[59,820,821],{},"₽",[59,823,450],{},[59,825,826],{},[62,827,828],{},"&#8381;",[59,830,831],{},[62,832,833],{},"&#x20BD;",[59,835,836],{},"Russian ruble",[35,838,839,842,844,849,854],{},[59,840,841],{},"…",[59,843,450],{},[59,845,846],{},[62,847,848],{},"&#8230;",[59,850,851],{},[62,852,853],{},"&#x2026;",[59,855,856],{},"Ellipsis",[15,858,859],{},"If a character has no named entity, use decimal or hex. Both work identically in all modern browsers.",[10,861,863],{"id":862},"when-to-use-which-format","When to Use Which Format",[29,865,866,879],{},[32,867,868],{},[35,869,870,873,876],{},[38,871,872],{},"Context",[38,874,875],{},"Best Format",[38,877,878],{},"Reason",[54,880,881,895,905,916,926,937],{},[35,882,883,890,892],{},[59,884,885,886,889],{},"Core five (",[62,887,888],{},"& \u003C > \" '",")",[59,891,688],{},[59,893,894],{},"Most readable, universally understood",[35,896,897,900,902],{},[59,898,899],{},"Common symbols (©, €, —)",[59,901,688],{},[59,903,904],{},"Self-documenting in source code",[35,906,907,910,913],{},[59,908,909],{},"Rare symbols, math, arrows",[59,911,912],{},"Decimal or hex",[59,914,915],{},"No named entity exists",[35,917,918,921,923],{},[59,919,920],{},"Email templates",[59,922,46],{},[59,924,925],{},"Most reliable across email clients",[35,927,928,931,934],{},[59,929,930],{},"XML documents",[59,932,933],{},"Named (limited) or decimal",[59,935,936],{},"XML supports only 5 named entities",[35,938,939,942,944],{},[59,940,941],{},"Dynamic output from JavaScript",[59,943,49],{},[59,945,946,947,889],{},"Matches Unicode escape syntax (",[62,948,949],{},"\\uXXXX",[565,951,953],{"id":952},"readability-comparison","Readability comparison",[573,955,957],{"className":575,"code":956,"language":577,"meta":578,"style":578},"\u003C!-- Same character, three formats -->\n\u003Cp>Price: &euro;49\u003C\u002Fp>\n\u003Cp>Price: &#8364;49\u003C\u002Fp>\n\u003Cp>Price: &#x20AC;49\u003C\u002Fp>\n",[62,958,959,964,982,999],{"__ignoreMap":578},[582,960,961],{"class":584,"line":585},[582,962,963],{"class":611},"\u003C!-- Same character, three formats -->\n",[582,965,966,968,970,973,975,978,980],{"class":584,"line":608},[582,967,92],{"class":588},[582,969,15],{"class":591},[582,971,972],{"class":588},">Price: ",[582,974,294],{"class":597},[582,976,977],{"class":588},"49\u003C\u002F",[582,979,15],{"class":591},[582,981,605],{"class":588},[582,983,985,987,989,991,993,995,997],{"class":584,"line":984},3,[582,986,92],{"class":588},[582,988,15],{"class":591},[582,990,972],{"class":588},[582,992,299],{"class":597},[582,994,977],{"class":588},[582,996,15],{"class":591},[582,998,605],{"class":588},[582,1000,1002,1004,1006,1008,1010,1012,1014],{"class":584,"line":1001},4,[582,1003,92],{"class":588},[582,1005,15],{"class":591},[582,1007,972],{"class":588},[582,1009,304],{"class":597},[582,1011,977],{"class":588},[582,1013,15],{"class":591},[582,1015,605],{"class":588},[15,1017,1018],{},"All three render identically, but the named version communicates intent fastest when reading source code.",[10,1020,1022],{"id":1021},"compatibility-notes","Compatibility Notes",[1024,1025,1026,1037,1055,1065,1071],"ul",{},[1027,1028,1029,1032,1033,1036],"li",{},[189,1030,1031],{},"HTML4"," supports roughly 250 named entities. ",[189,1034,1035],{},"HTML5"," expanded this to over 2,000.",[1027,1038,1039,1042,1043,1045,1046,1045,1048,1045,1050,1045,1052,1054],{},[189,1040,1041],{},"XML"," recognizes only five named entities: ",[62,1044,69],{},", ",[62,1047,97],{},[62,1049,122],{},[62,1051,147],{},[62,1053,172],{},". Use numeric entities for everything else in XML.",[1027,1056,1057,1061,1062,1064],{},[189,1058,1059],{},[62,1060,172],{}," was invalid in HTML4 but works in HTML5 and XML. Use ",[62,1063,177],{}," for maximum compatibility.",[1027,1066,1067,1070],{},[189,1068,1069],{},"Numeric entities"," work everywhere — HTML4, HTML5, XML, XHTML, and all browsers.",[1027,1072,1073,1076],{},[189,1074,1075],{},"UTF-8 documents"," can often display characters directly without entities, but you still need entities for the core five to avoid parsing conflicts.",[10,1078,1080],{"id":1079},"character-sets-and-encoding","Character Sets and Encoding",[15,1082,1083],{},"Your document's character encoding determines how the browser interprets bytes before entity resolution occurs.",[573,1085,1087],{"className":575,"code":1086,"language":577,"meta":578,"style":578},"\u003C!-- Always declare UTF-8 in your HTML -->\n\u003Cmeta charset=\"utf-8\">\n",[62,1088,1089,1094],{"__ignoreMap":578},[582,1090,1091],{"class":584,"line":585},[582,1092,1093],{"class":611},"\u003C!-- Always declare UTF-8 in your HTML -->\n",[582,1095,1096,1098,1101,1105,1108,1112],{"class":584,"line":608},[582,1097,92],{"class":588},[582,1099,1100],{"class":591},"meta",[582,1102,1104],{"class":1103},"sScJk"," charset",[582,1106,1107],{"class":588},"=",[582,1109,1111],{"class":1110},"sZZnC","\"utf-8\"",[582,1113,605],{"class":588},[15,1115,1116,1117,1045,1119,1045,1121,1123,1124,1045,1126,1045,1128,1045,1130,1132,1133,1135],{},"With UTF-8, you can safely paste most characters directly: ",[62,1118,220],{},[62,1120,289],{},[62,1122,450],{},". However, the characters ",[62,1125,92],{},[62,1127,117],{},[62,1129,64],{},[62,1131,142],{},", and ",[62,1134,167],{}," still require entities when they appear as data — your charset does not change their structural meaning in HTML.",[10,1137,1139],{"id":1138},"key-takeaways","Key Takeaways",[1024,1141,1142,1153,1159,1162,1165,1168],{},[1027,1143,1144,1145,1147,1148,1150,1151,889],{},"Three entity formats exist: named (",[62,1146,69],{},"), decimal (",[62,1149,74],{},"), and hexadecimal (",[62,1152,79],{},[1027,1154,1155,1156,1158],{},"Encode the core five characters (",[62,1157,888],{},") every time they appear as data",[1027,1160,1161],{},"Named entities improve source readability; numeric entities offer full Unicode coverage",[1027,1163,1164],{},"Use decimal entities for email templates and XML where named support is limited",[1027,1166,1167],{},"UTF-8 charset lets you write most characters directly, but reserved characters always need entities",[1027,1169,1170],{},"Always include the semicolon — omitting it creates parser ambiguity",[10,1172,1174],{"id":1173},"related-guides","Related Guides",[1024,1176,1177,1184,1190],{},[1027,1178,1179],{},[1180,1181,1183],"a",{"href":1182},"\u002Fguides\u002Fhtml-encoding-guide","HTML Encoding Guide",[1027,1185,1186],{},[1180,1187,1189],{"href":1188},"\u002Fguides\u002Fweb-encoding-tools","Web Encoding Tools",[1027,1191,1192],{},[1180,1193,1195],{"href":1194},"\u002Fguides\u002Fhtml-encoding-vs-url-encoding","HTML Encoding vs URL Encoding",[10,1197,1199],{"id":1198},"try-it-yourself","Try It Yourself",[15,1201,1202,1203,1207],{},"Look up, encode, and decode HTML entities instantly with our free ",[1180,1204,1206],{"href":1205},"\u002Ftools\u002Fhtml-encoder","HTML Encoder\u002FDecoder"," tool. Search by character or entity name and get all three formats at once.",[1209,1210,1211],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}",{"title":578,"searchDepth":608,"depth":608,"links":1213},[1214,1215,1216,1217,1222,1225,1226,1227,1228,1229],{"id":12,"depth":608,"text":13},{"id":23,"depth":608,"text":24},{"id":195,"depth":608,"text":196},{"id":562,"depth":608,"text":563,"children":1218},[1219,1220,1221],{"id":567,"depth":984,"text":568},{"id":618,"depth":984,"text":619},{"id":673,"depth":984,"text":674},{"id":862,"depth":608,"text":863,"children":1223},[1224],{"id":952,"depth":984,"text":953},{"id":1021,"depth":608,"text":1022},{"id":1079,"depth":608,"text":1080},{"id":1138,"depth":608,"text":1139},{"id":1173,"depth":608,"text":1174},{"id":1198,"depth":608,"text":1199},"2026-05-28","Complete reference of HTML entities — named, decimal, and hexadecimal — for special characters in web development.","md",{"immutable":1234},true,"\u002Fguides\u002Fhtml-entity-reference",5,{"title":5,"description":1231},"guides\u002Fhtml-entity-reference","mHniNPTxYfuFafTWQ64NFKfBMcZwZ8wZHk0QANRhdng",1780401330376]