More
More
En Dash HTML entity –
– is the HTML entity for En Dash – (U+2013). Copy the decimal – and hex – codes plus CSS, JavaScript, Python and URL escapes.
- Entity
–- Code point
- U+2013
- Unicode name
- EN DASH
- Block
- General Punctuation
- Category
- Dash punctuation (Pd)
- Since
- Unicode 1.1
- Defined in
- HTML 4.01 and HTML5
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: "\2013";In a stylesheet, for ::before and ::after. | |
| JavaScript | "\u2013"Also valid in JSON. | |
| Python | "\u2013"Python 3 string literal. | |
| Python by name | "\N{EN DASH}"Readable alternative using the Unicode name. | |
| URL | %E2%80%93Percent-encoded UTF-8 bytes, for a path or query value. | |
| UTF-8 bytes | E2 80 933 bytes. | |
| UTF-16 | 20131 code unit, which is what JavaScript length counts. |
When to use it
The en dash, half the width of an em dash, is used for ranges (pages 10–20, 9 am–5 pm) and for connections such as a London–Paris train. In British style a spaced en dash also sets off a phrase. It is longer than the keyboard hyphen.
The name dates from HTML 4, so it works in every browser and in old email clients.
More punctuation and typography
―Horizontal Bar˝Double Acute Accent‖Double Vertical Line˜Small Tilde‘Left Single Quote˛Ogonek’Right Single Quote˚Ring Above
All punctuation and typography · 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).