Identify the en dash character code

The en dash is Unicode U+2013 (decimal 8211, HTML –). Learn how it differs from hyphens and em dashes, how to type it, and when a plain hyphen is safer.

The en dash is Unicode code point U+2013, named EN DASH. In decimal that is 8211, so in HTML you can write it as –, – or –. This review covers the codes you are likely to need, what swapping a hyphen for an en dash actually changes in your text, and when a plain hyphen is the better choice.

Quick reference: en dash codes by context

Context | Representation
Unicode code point | U+2013
Unicode character name | EN DASH
Decimal value | 8211
HTML named entity | –
HTML numeric entity | – or –
CSS content escape | \2013
JavaScript, Java, JSON, Python string escape | \u2013
UTF-8 bytes | E2 80 93
UTF-16 code unit | 2013
Windows-1252 legacy byte | 0x96 (decimal 150)
LaTeX source | -- (two hyphens)

These values come from the Unicode character tables and the HTML and Windows-1252 encoding definitions. No source material was supplied for this article, so treat the table as standard reference values. Before relying on them in production, check them against your own toolchain.

<!-- HTML -->
<p>Pages 10&ndash;20</p>

/* CSS */
.range::after { content: "\2013"; }

// JavaScript
const enDash = "\u2013";

# Python
en_dash = "\u2013"  # or chr(8211)

How the en dash differs from similar characters

Several dash-like characters look alike in many fonts but are separate code points. Searches, parsers and string comparisons treat each one as a different character.

Character | Code point | Decimal | Typical use
Hyphen-minus | U+002D | 45 | The keyboard hyphen. Used in code, URLs, file names and compound words
Hyphen | U+2010 | 8208 | A typographic hyphen, rarely typed directly
Non-breaking hyphen | U+2011 | 8209 | A hyphen that prevents a line break
Figure dash | U+2012 | 8210 | A dash matching digit width, as in phone-style number groups
En dash | U+2013 | 8211 | Ranges (2010–2020), connections (New York–London route)
Em dash | U+2014 | 8212 | Breaks in a sentence; HTML entity —
Minus sign | U+2212 | 8722 | Mathematical subtraction and negative numbers

Some visual clues help you tell them apart. An en dash is usually longer than a hyphen and shorter than an em dash, often roughly the width of a capital N in the same font. Rendering varies by typeface, though, so appearance alone is not a reliable test. To be certain, paste the character into a Unicode inspector or code point lookup tool and read the reported value. You can also check its length in a programming language that reports code points.

What replacing a hyphen with an en dash actually changes

This is a change to the stored character, not a visual effect. When a hyphen becomes an en dash, the underlying text now holds U+2013 instead of U+002D. It is not a font setting, a CSS style or a mirrored glyph, so the change goes with the text wherever it is copied.

The substitution often happens without the writer intending it. Many word processors and some operating systems have a 'smart dashes' or autoformat feature. It converts typed hyphens, or a pair of hyphens between words, into en or em dashes. The result looks the same on screen but behaves differently wherever exact characters matter.

Unicode normalization does not undo this. U+2013 has no compatibility decomposition, so NFC, NFD, NFKC and NFKD all leave it as an en dash. A system will only treat an en dash and a hyphen as equivalent if it explicitly folds dash characters together. Whether a given search engine, database or app does so is not documented in the material available here, so test the specific system you depend on.

Is an en dash suitable for your use?

Use the en dash in prose meant for human readers, such as articles, reports, books and formatted documents. Many style guides call for it in number ranges and connections between paired terms. Its main benefit is typographic clarity: it signals 'to' or 'between' in a way a hyphen does not.

The key tradeoff is that a stored en dash stops matching anything that expects the keyboard hyphen. A plain hyphen-minus is the better choice in these cases:

  • Source code, configuration files and command-line arguments. An en dash pasted in place of a hyphen in an option such as --verbose will usually make the command fail or be misread.
  • URLs, slugs, file names, email-style identifiers and usernames.
  • Data that will be parsed, sorted or matched, such as CSV fields, product codes, date strings and spreadsheet formulas.
  • Passwords and access codes, where a smart-dash substitution creates a different string.
  • Plain-text channels with uncertain encoding support, where the character may be garbled.

Copying, sharing and accessibility

In environments that handle UTF-8 or UTF-16 correctly, an en dash copies and pastes as the same character. The common failure is an encoding mismatch. When the UTF-8 bytes E2 80 93 are read as Windows-1252, they display as the three characters –. If you see that sequence in text that should contain a dash, the cause is an encoding problem, not the en dash itself.

In older Windows-1252 content, the en dash is stored as the single byte 0x96. If that file is read as ISO-8859-1 or as UTF-8, the byte may appear as an invisible control character or a replacement symbol. When converting legacy files, decode them explicitly as Windows-1252.

How screen readers announce an en dash depends on the screen reader, its punctuation verbosity setting and the language. Some may say 'en dash', some may pause, and some may say nothing. No scoped test of any specific assistive technology was available for this article, so no particular behavior is claimed here. In a range where the meaning must come through, such as '9–5' for working hours, writing 'to' ('9 to 5') removes the ambiguity for every reader.

How to type or insert an en dash

The methods below are widely documented, but none was verified for this article on specific hardware or software versions. Availability depends on keyboard layout, input method and application, so confirm them in your own setup.

  • HTML: write – or – in the markup.
  • macOS: Option + Hyphen on standard US layouts.
  • Windows: hold Alt and type 0150 on the numeric keypad. This relies on the Windows-1252 code page and a physical numeric keypad, so it may not work on laptops without one.
  • Microsoft Word on Windows: type 2013 and press Alt+X to convert it to the character. Ctrl + the numeric keypad minus key also inserts an en dash.
  • Linux with GTK or IBus input: Ctrl+Shift+U, then 2013, then Enter or Space.
  • Linux and other systems with a Compose key enabled: Compose, Hyphen, Hyphen, Period.
  • LaTeX: type two hyphens (--) in the source.
  • Any system: use a character map or emoji and symbols picker and search for 'en dash'.

When searching for a tool or setting, the most useful terms are 'en dash', 'U+2013', 'Unicode code point lookup' and 'smart dashes' or 'autoformat dashes'. The last pair helps if you want to turn automatic substitution off rather than insert the character.

Gaps and limitations

No product documentation, measurements or test results were supplied with this brief. The code values above are standard Unicode and encoding reference data. The behavior described for keyboard shortcuts, search systems and screen readers is general and was not verified against particular versions. If an exact match matters for your workflow, test with the specific application, platform or assistive technology involved.