文字参照は、文字を直接記述するのではなく、文字コード(Unicode)の形式で記述することです。 「アンパサンド記号」+「シャープ記号」+10進数の文字コード+「セミコロン記号」の形式で指定します。
文字コードでは覚えづらいため、DTD で実体(エンティティ)定義を行ったものが実体参照です。 文字コードの代わりに文字列で指定できます。 「アンパサンド記号」+文字列+「セミコロン記号」の形式で指定します。
SGMLの応用言語であるHTMLやXML、XHTMLでは、2重引用符 (") やアンパサンド (&)、不等号 (< >) は特別な意味を持つ特殊文字として扱われるため、そのままでは文字データとして使えません。そこで、文字参照または実体参照という方法でこれらの文字を表します。
特殊文字の文字参照と実体参照の一覧を次に示します。
| 文字参照 | 実体参照 | 文字 | 備考 | 
|---|---|---|---|
" | 
        " | 
        " | 
        クォーテーションマーク (quotation mark) | 
& | 
        & | 
        & | 
        アンパサンド (ampersand) | 
< | 
        < | 
        < | 
        小なり (less-than) | 
> | 
        > | 
        > | 
        大なり (greater-than) | 
HTMLで「Jack & Betty」と表示させる例を次に示します。
<p>Jack & Betty</p>
 
  | 文字 | 実体参照 | 説明 | 
|---|---|---|
| ‐ | ‐ | hyphen | 
|  | ­ | soft hyphen | 
hyphen は2つ以上の単語を組み合わせるときに使用する。
well‐known
英単語は途中で改行してもよい切れ目が決まっています(英和辞典に載っています)。ソフトハイフンは、このつづり字の切れ目を指定します。英単語が途中で改行されるときは、このソフトハイフンの位置で改行されます。また、単語の切れ目に、単語が続くことを表すハイフンが表示されます。単語の途中で改行されないときは、ハイフンは表示されません。
ソフトハイフンの使用例を次に示します。
<p>ref­er­ence</p>
  reference reference reference reference reference reference reference reference reference
| 文字 | 文字参照 | 実体参照 | 説明 | 
|---|---|---|---|
| – | – | – | en dash | 
| — | — | — | em dash | 
n-dash は数値の範囲を表すときに使用する。
1940–2024
m-dash は2つの文章を接続するときに使用する。
Unicode にはチェックマークを表す文字が複数種用意されている。
| 文字 | 文字参照 | 説明 | 
|---|---|---|
| ✓ | ✓ | CHECK MARK | 
| ✔ | ✔ | HEAVY CHECK MARK | 
| ☑ | ☑ | BALLOT BOX WITH CHECK | 
| ✅ | &#x2705; | WHITE HEAVY CHECK MARK | 
| 🗸 | 🗸 | LIGHT CHECK MARK | 
| 🗹 | 🗹 | BALLOT BOX WITH BOLD CHECK | 
Unicode にはバツ印を表す文字が複数種用意されている。
| 文字 | 文字参照 | 説明 | 
|---|---|---|
| ✗ | ✗ | BALLOT X | 
| ✘ | ✘ | HEAVY BALLOT X | 
| ❌ | ❌ | CROSS MARK | 
| ❎ | ❎ | NEGATIVE SQUARED CROSS MARK | 
特殊文字だけでなく普通の文字も文字参照や実体参照で表すことができます。
| 文字参照 | 実体参照 | 文字 | 備考 | 
|---|---|---|---|
| # | # | ナンバー | |
| Œ | Œ | Œ | latin capital ligature OE | 
| œ | œ | œ | latin small ligature oe | 
| Š | Š | Š | latin capital letter S with caron | 
| š | š | š | latin small letter s with caron | 
| Ÿ | Ÿ | Ÿ | latin capital letter Y with diaeresis | 
| ˆ | ˆ | ˆ | modifier letter circumflex accent | 
| ˜ | ˜ | ˜ | small tilde | 
|   |   | en space | |
|   |   | em space | |
|   |   | thin space | |
| ‌ | ‌ |  | zero width non-joiner | 
| ‍ | ‍ |  | zero width joiner | 
| ‎ | ‎ |  | left-to-right mark | 
| ‏ | ‏ |  | right-to-left mark | 
| ‘ | ‘ | ‘ | left single quotation mark | 
| ’ | ’ | ’ | right single quotation mark | 
| ‚ | ‚ | ‚ | single low-9 quotation mark | 
| “ | “ | “ | left double quotation mark | 
| ” | ” | ” | right double quotation mark | 
| „ | „ | „ | double low-9 quotation mark | 
| † | † | † | dagger | 
| ‡ | ‡ | ‡ | double dagger | 
| ‰ | ‰ | ‰ | per mille sign | 
| ‹ | ‹ | ‹ | single left-pointing angle quotation mark | 
| › | › | › | single right-pointing angle quotation mark | 
| € | € | € | euro sign | 
| 文字参照 | 実体参照 | 文字 | 備考 | 
|---|---|---|---|
|   |   | スペースの前及び後の位置での自動的な改行を防ぐ特殊なスペース (no-break space) | |
| ¡ | ¡ | ¡ | inverted exclamation mark | 
| ¢ | ¢ | ¢ | cent sign | 
| £ | £ | £ | pound sign | 
| ¤ | ¤ | ¤ | currency sign | 
| ¥ | ¥ | ¥ | yen sign | 
| ¦ | ¦ | ¦ | broken vertical bar | 
| § | § | § | section sign | 
| ¨ | ¨ | ¨ | diaeresis = spacing diaeresis | 
| © | © | © | コピーライト | 
| ª | ª | ª | feminine ordinal indicator | 
| « | « | « | left-pointing double angle quotation mark = left pointing guillemet | 
| ¬ | ¬ | ¬ | not sign | 
| ­ | ­ |  | soft hyphen = discretionary hyphen 1 | 
| ® | ® | ® | registered sign = registered trade mark sign | 
| ¯ | ¯ | ¯ | macron = spacing macron = overline = APL overbar | 
| ° | ° | ° | degree sign | 
| ± | ± | ± | plus-minus sign = plus-or-minus sign | 
| ² | ² | ² | superscript two = superscript digit two = squared | 
| ³ | ³ | ³ | superscript three = superscript digit three = cubed | 
| ´ | ´ | ´ | acute accent = spacing acute | 
| µ | µ | µ | micro sign | 
| ¶ | ¶ | ¶ | 段落記号 (paragraph sign) | 
| · | · | · | middle dot = Georgian comma = Greek middle dot | 
| ¸ | ¸ | ¸ | cedilla = spacing cedilla | 
| ¹ | ¹ | ¹ | superscript one = superscript digit one | 
| º | º | º | masculine ordinal indicator | 
| » | » | » | right-pointing double angle quotation mark = right pointing guillemet | 
| ¼ | ¼ | ¼ | vulgar fraction one quarter = fraction one quarter | 
| ½ | ½ | ½ | vulgar fraction one half = fraction one half | 
| ¾ | ¾ | ¾ | vulgar fraction three quarters = fraction three quarters | 
| ¿ | ¿ | ¿ | inverted question mark = turned question mark | 
| À | À | À | latin capital letter A with grave = latin capital letter A grave | 
| Á | Á | Á | latin capital letter A with acute | 
| Â | Â | Â | latin capital letter A with circumflex | 
| Ã | Ã | Ã | latin capital letter A with tilde | 
| Ä | Ä | Ä | latin capital letter A with diaeresis | 
| Å | Å | Å | latin capital letter A with ring above = latin capital letter A ring | 
| Æ | Æ | Æ | latin capital letter A with acute = latin capital ligature AE | 
| Ç | Ç | Ç | latin capital letter C with cedilla | 
| È | È | È | latin capital letter E with grave | 
| É | É | É | latin capital letter E with acute | 
| Ê | Ê | Ê | latin capital letter E with circumflex | 
| Ë | Ë | Ë | latin capital letter E with diaeresis | 
| Ì | Ì | Ì | latin capital letter I with grave | 
| Í | Í | Í | latin capital letter I with acute | 
| Î | Î | Î | latin capital letter I with circumflex | 
| Ï | Ï | Ï | latin capital letter I with diaeresis | 
| Ð | Ð | Ð | latin capital letter ETH | 
| Ñ | Ñ | Ñ | latin capital letter N with tilde | 
| Ò | Ò | Ò | latin capital letter O with grave | 
| Ó | Ó | Ó | latin capital letter O with acute | 
| Ô | Ô | Ô | latin capital letter O with circumflex | 
| Õ | Õ | Õ | latin capital letter O with tilde | 
| Ö | Ö | Ö | latin capital letter O with diaeresis | 
| × | × | × | multiplication sign | 
| Ø | Ø | Ø | latin capital letter O with stroke = latin capital letter O slash | 
| Ù | Ù | Ù | latin capital letter U with grave | 
| Ú | Ú | Ú | latin capital letter U with acute | 
| Û | Û | Û | latin capital letter U with circumflex | 
| Ü | Ü | Ü | latin capital letter U with diaeresis | 
| Ý | Ý | Ý | latin capital letter Y with acute | 
| Þ | Þ | Þ | latin capital letter THORN | 
| ß | ß | ß | latin small letter sharp s = ess-zed | 
| à | à | à | latin small letter a with grave = latin small letter a grave | 
| á | á | á | latin small letter a with acute | 
| â | â | â | latin small letter a with circumflex | 
| ã | ã | ã | latin small letter a with tilde | 
| ä | ä | ä | latin small letter a with diaeresis | 
| å | å | å | latin small letter a with ring above = latin small letter a ring | 
| æ | æ | æ | latin small letter ae = latin small ligature ae | 
| ç | ç | ç | latin small letter c with cedilla | 
| è | è | è | latin small letter e with grave | 
| é | é | é | latin small letter e with acute | 
| ê | ê | ê | latin small letter e with circumflex | 
| ë | ë | ë | latin small letter e with diaeresis | 
| ì | ì | ì | latin small letter i with grave | 
| í | í | í | latin small letter i with acute | 
| î | î | î | latin small letter i with circumflex | 
| ï | ï | ï | latin small letter i with diaeresis | 
| ð | ð | ð | latin small letter eth | 
| ñ | ñ | ñ | latin small letter n with tilde | 
| ò | ò | ò | latin small letter o with grave | 
| ó | ó | ó | latin small letter o with acute | 
| ô | ô | ô | latin small letter o with circumflex | 
| õ | õ | õ | latin small letter o with tilde | 
| ö | ö | ö | latin small letter o with diaeresis | 
| ÷ | ÷ | ÷ | division sign | 
| ø | ø | ø | latin small letter o with stroke = latin small letter o slash | 
| ù | ù | ù | latin small letter u with grave | 
| ú | ú | ú | latin small letter u with acute | 
| û | û | û | latin small letter u with circumflex | 
| ü | ü | ü | latin small letter u with diaeresis | 
| ý | ý | ý | latin small letter y with acute | 
| þ | þ | þ | latin small letter thorn | 
| ÿ | ÿ | ÿ | latin small letter y with diaeresis | 
| 文字参照 | 実体参照 | 文字 | 備考 | 
|---|---|---|---|
| ƒ | ƒ | ƒ | latin small f with hook = function = florin | 
| Α | Α | Α | greek capital letter alpha | 
| Β | Β | Β | greek capital letter beta | 
| Γ | Γ | Γ | greek capital letter gamma | 
| Δ | Δ | Δ | greek capital letter delta | 
| Ε | Ε | Ε | greek capital letter epsilon | 
| Ζ | Ζ | Ζ | greek capital letter zeta | 
| Η | Η | Η | greek capital letter eta | 
| Θ | Θ | Θ | greek capital letter theta | 
| Ι | Ι | Ι | greek capital letter iota | 
| Κ | Κ | Κ | greek capital letter kappa | 
| Λ | Λ | Λ | greek capital letter lambda | 
| Μ | Μ | Μ | greek capital letter mu | 
| Ν | Ν | Ν | greek capital letter nu | 
| Ξ | Ξ | Ξ | greek capital letter xi | 
| Ο | Ο | Ο | greek capital letter omicron | 
| Π | Π | Π | greek capital letter pi | 
| Ρ | Ρ | Ρ | greek capital letter rho | 
| Σ | Σ | Σ | greek capital letter sigma | 
| Τ | Τ | Τ | greek capital letter tau | 
| Υ | Υ | Υ | greek capital letter upsilon | 
| Φ | Φ | Φ | greek capital letter phi | 
| Χ | Χ | Χ | greek capital letter chi | 
| Ψ | Ψ | Ψ | greek capital letter psi | 
| Ω | Ω | Ω | greek capital letter omega | 
| α | α | α | greek small letter alpha | 
| β | β | β | greek small letter beta | 
| γ | γ | γ | greek small letter gamma | 
| δ | δ | δ | greek small letter delta | 
| ε | ε | ε | greek small letter epsilon | 
| ζ | ζ | ζ | greek small letter zeta | 
| η | η | η | greek small letter eta | 
| θ | θ | θ | greek small letter theta | 
| ι | ι | ι | greek small letter iota | 
| κ | κ | κ | greek small letter kappa | 
| λ | λ | λ | greek small letter lambda | 
| μ | μ | μ | greek small letter mu | 
| ν | ν | ν | greek small letter nu | 
| ξ | ξ | ξ | greek small letter xi | 
| ο | ο | ο | greek small letter omicron | 
| π | π | π | greek small letter pi | 
| ρ | ρ | ρ | greek small letter rho | 
| ς | ς | ς | greek small letter final sigma | 
| σ | σ | σ | greek small letter sigma | 
| τ | τ | τ | greek small letter tau | 
| υ | υ | υ | greek small letter upsilon | 
| φ | φ | φ | greek small letter phi | 
| χ | χ | χ | greek small letter chi | 
| ψ | ψ | ψ | greek small letter psi | 
| ω | ω | ω | greek small letter omega | 
| ϑ | ϑ | ϑ | greek small letter theta symbol | 
| ϒ | ϒ | ϒ | greek upsilon with hook symbol | 
| ϖ | ϖ | ϖ | greek pi symbol | 
| • | • | • | bullet = black small circle | 
| … | … | … | horizontal ellipsis = three dot leader | 
| ′ | ′ | ′ | prime = minutes = feet | 
| ″ | ″ | ″ | double prime = seconds = inches | 
| ‾ | ‾ | ‾ | overline = spacing overscore | 
| ⁄ | ⁄ | ⁄ | fraction slash | 
| ℘ | ℘ | ℘ | script capital P = power set = Weierstrass p | 
| ℑ | ℑ | ℑ | blackletter capital I = imaginary part | 
| ℜ | ℜ | ℜ | blackletter capital R = real part symbol | 
| ™ | ™ | ™ | trade mark sign | 
| ℵ | ℵ | ℵ | alef symbol = first transfinite cardinal | 
| ← | ← | ← | leftwards arrow | 
| ↑ | ↑ | ↑ | upwards arrow | 
| → | → | → | rightwards arrow | 
| ↓ | ↓ | ↓ | downwards arrow | 
| ↔ | ↔ | ↔ | left right arrow | 
| ↵ | ↵ | ↵ | downwards arrow with corner leftwards = carriage return | 
| ⇐ | ⇐ | ⇐ | leftwards double arrow | 
| ⇑ | ⇑ | ⇑ | upwards double arrow | 
| ⇒ | ⇒ | ⇒ | rightwards double arrow | 
| ⇓ | ⇓ | ⇓ | downwards double arrow | 
| ⇔ | ⇔ | ⇔ | left right double arrow | 
| ∀ | ∀ | ∀ | for all | 
| ∂ | ∂ | ∂ | partial differential | 
| ∃ | ∃ | ∃ | there exists | 
| ∅ | ∅ | ∅ | empty set = null set = diameter | 
| ∇ | ∇ | ∇ | nabla = backward difference | 
| ∈ | ∈ | ∈ | element of | 
| ∉ | ∉ | ∉ | not an element of | 
| ∋ | ∋ | ∋ | contains as member | 
| ∏ | ∏ | ∏ | n-ary product = product sign | 
| ∑ | ∑ | ∑ | n-ary sumation | 
| − | − | − | minus sign | 
| ∗ | ∗ | ∗ | asterisk operator | 
| √ | √ | √ | square root = radical sign | 
| ∝ | ∝ | ∝ | proportional to | 
| ∞ | ∞ | ∞ | infinity | 
| ∠ | ∠ | ∠ | angle | 
| ∧ | ∧ | ∧ | logical and = wedge | 
| ∨ | ∨ | ∨ | logical or = vee | 
| ∩ | ∩ | ∩ | intersection = cap | 
| ∪ | ∪ | ∪ | union = cup | 
| ∫ | ∫ | ∫ | integral | 
| ∴ | ∴ | ∴ | therefore | 
| ∼ | ∼ | ∼ | tilde operator = varies with = similar to | 
| ≅ | ≅ | ≅ | approximately equal to | 
| ≈ | ≈ | ≈ | almost equal to = asymptotic to | 
| ≠ | ≠ | ≠ | not equal to | 
| ≡ | ≡ | ≡ | identical to | 
| ≤ | ≤ | ≤ | 小なりイコール (less-than or equal to) | 
| ≥ | ≥ | ≥ | 大なりイコール (greater than or equal to) | 
| ⊂ | ⊂ | ⊂ | subset of | 
| ⊃ | ⊃ | ⊃ | superset of | 
| ⊄ | ⊄ | ⊄ | not a subset of | 
| ⊆ | ⊆ | ⊆ | subset of or equal to | 
| ⊇ | ⊇ | ⊇ | superset of or equal to | 
| ⊕ | ⊕ | ⊕ | circled plus = direct sum | 
| ⊗ | ⊗ | ⊗ | circled times = vector product | 
| ⊥ | ⊥ | ⊥ | up tack = orthogonal to = perpendicular | 
| ⋅ | ⋅ | ⋅ | dot operator | 
| ⌈ | ⌈ | ⌈ | left ceiling = apl upstile | 
| ⌉ | ⌉ | ⌉ | right ceiling | 
| ⌊ | ⌊ | ⌊ | left floor = apl downstile | 
| ⌋ | ⌋ | ⌋ | right floor | 
| 〈 | ⟨ | 〈 | left-pointing angle bracket = bra | 
| 〉 | ⟩ | 〉 | right-pointing angle bracket = ket | 
| ◊ | ◊ | ◊ | lozenge | 
| ♠ | ♠ | ♠ | スペード | 
| ♣ | ♣ | ♣ | クラブ(クローバー) | 
| ♥ | ♥ | ♥ | ハート | 
| ♦ | ♦ | ♦ | ダイヤ(ダイヤモンド) | 
| ♯ | ♯ | シャープ | 
Thomas, Ken 2024. How to use the en dash, em dash and hyphen (also ndash, mdash)