More
More
Apostrophe HTML entity '
' is the HTML entity for Apostrophe ' (U+0027). Copy the decimal ' and hex ' codes plus CSS, JavaScript, Python and URL escapes.
- Entity
'- Code point
- U+0027
- Unicode name
- APOSTROPHE
- Block
- Basic Latin
- Category
- Other punctuation (Po)
- Since
- Unicode 1.1
- Defined in
- HTML5, and predefined in XML
Codes to copy
| HTML named | 'Works in HTML; in XML only & < > " ' are predefined. | |
|---|---|---|
| HTML decimal | 'Works in HTML and XML. | |
| HTML hex | 'Works in HTML and XML. | |
| CSS | content: "\27";In a stylesheet, for ::before and ::after. | |
| JavaScript | "\u0027"Also valid in JSON. | |
| Python | "\u0027"Python 3 string literal. | |
| Python by name | "\N{APOSTROPHE}"Readable alternative using the Unicode name. | |
| URL | %27Percent-encoded UTF-8 bytes, for a path or query value. | |
| UTF-8 bytes | 271 byte. | |
| UTF-16 | 00271 code unit, which is what JavaScript length counts. |
When to use it
The straight single quote. ' is defined in HTML5 and XML but was missing from HTML 4, so a few very old email clients show it literally; ' works everywhere. Escape it inside attribute values wrapped in single quotes. In prose, the typographic apostrophe is ’.
More html syntax and ascii punctuation
)Right Parenthesis%Percent Sign*Asterisk$Dollar Sign+Plus Sign#Number Sign,Comma"Quotation Mark
All html syntax and ascii punctuation · Every HTML entity · Encode or decode text
Source: the WHATWG HTML Standard list of named character references and the Unicode Character Database (Unicode 18.0).