ESC
Entità HTML

Reserved Characters

Decimal Hex Named Char Description
& & & & Ampersand — must always be encoded in HTML
&#60; &#x3C; &lt; < Less-than — opens HTML tags
&#62; &#x3E; &gt; > Greater-than — closes HTML tags
&#34; &#x22; &quot; " Double quote — use inside attribute values
&#39; &#x27; &#39; ' Single quote / apostrophe — no named entity in HTML4
&#47; &#x2F; &#47; / Forward slash — safe to use unencoded in most contexts

Common Symbols

Decimal Hex Named Char Description
&#169; &#xA9; &copy; © Copyright sign
&#174; &#xAE; &reg; ® Registered trademark
&#8482; &#x2122; &trade; Trademark symbol
&#8364; &#x20AC; &euro; Euro sign
&#163; &#xA3; &pound; £ Pound sterling sign
&#165; &#xA5; &yen; ¥ Yen / yuan sign
&#167; &#xA7; &sect; § Section sign
&#176; &#xB0; &deg; ° Degree sign
&#177; &#xB1; &plusmn; ± Plus-minus sign
&#215; &#xD7; &times; × Multiplication sign
&#247; &#xF7; &divide; ÷ Division sign
&#178; &#xB2; &sup2; ² Superscript two / squared
&#179; &#xB3; &sup3; ³ Superscript three / cubed

Arrows

Decimal Hex Named Char Description
&#8592; &#x2190; &larr; Leftwards arrow
&#8594; &#x2192; &rarr; Rightwards arrow
&#8593; &#x2191; &uarr; Upwards arrow
&#8595; &#x2193; &darr; Downwards arrow
&#8596; &#x2194; &harr; Left-right arrow
&#8656; &#x21D0; &lArr; Leftwards double arrow
&#8658; &#x21D2; &rArr; Rightwards double arrow
&#8660; &#x21D4; &hArr; Left-right double arrow

Mathematical

Decimal Hex Named Char Description
&#8721; &#x2211; &sum; Summation / sigma
&#8730; &#x221A; &radic; Square root radical sign
&#8734; &#x221E; &infin; Infinity symbol
&#960; &#x3C0; &pi; π Greek letter pi
&#8776; &#x2248; &asymp; Almost equal to
&#8800; &#x2260; &ne; Not equal to
&#8804; &#x2264; &le; Less than or equal to
&#8805; &#x2265; &ge; Greater than or equal to
&#177; &#xB1; &plusmn; ± Plus or minus

Smart Quotes & Dashes

Decimal Hex Named Char Description
&#8220; &#x201C; &ldquo; Left double quotation mark (opening)
&#8221; &#x201D; &rdquo; Right double quotation mark (closing)
&#8216; &#x2018; &lsquo; Left single quotation mark (opening)
&#8217; &#x2019; &rsquo; Right single quotation mark (closing)
&#8212; &#x2014; &mdash; Em dash — used for parenthetical clauses
&#8211; &#x2013; &ndash; En dash — used in ranges (pages 5–10)

Whitespace

Decimal Hex Named Char Description
&#160; &#xA0; &nbsp; [nbsp] Non-breaking space — prevents line break
&#8194; &#x2002; &ensp; [ensp] En space — width of letter n
&#8195; &#x2003; &emsp; [emsp] Em space — width of letter m
&#8201; &#x2009; &thinsp; [thinsp] Thin space — about 1/5 of em

Domande Frequenti

Un'entità HTML è una stringa di testo che inizia con & e termina con ; utilizzata per rappresentare caratteri con significato speciale in HTML o difficili da digitare. Ad esempio &lt; viene visualizzato come < (segno minore di), che altrimenti verrebbe interpretato come l'inizio di un tag HTML.

Codifica sempre & come &amp;, < come &lt; e > come &gt; nel contenuto HTML per evitare che vengano analizzati come markup. Nei valori degli attributi codifica anche le virgolette. In pratica, i motori di template gestiscono questo automaticamente con funzioni come htmlspecialchars() in PHP o html.escape() in Python.

Uno spazio normale è un separatore di parole e i browser possono comprimere più spazi o andare a capo in uno spazio. &nbsp; (spazio non divisibile, U+00A0) impedisce gli a-capo in quel punto e non viene compresso. Usalo per le unità (10&nbsp;kg) o le abbreviazioni. Non usarlo per il layout — usa invece CSS padding/margin.