Long Dash Code: How to Identify the Em Dash Code Point and Confirm You Have the Right Character
Find the code for the long dash (em dash, U+2014), tell it apart from look-alike dashes, and verify the exact character in your text step by step.
The long dash is usually the em dash (—). Its Unicode code point is U+2014, officially named EM DASH. When people search for the code of a long dash, they usually want one of two things: the code that will type or insert the character, or a way to check which dash is already in their text. Several dash characters look almost identical on screen, so checking the actual code point is the reliable way to tell them apart.
What a Unicode inspector does with your text
A Unicode inspector, also called a character identifier or code point viewer, takes text you paste or type and reports what each character is. It does not change the text. The input can be a single character or a longer string, including characters you cannot see, such as non-breaking spaces. For each character, the output typically shows the code point (for example U+2014), the official Unicode name (EM DASH), and often the encoded bytes (for example E2 80 94 in UTF-8). For the long dash, this tells you whether the character is an em dash or a look-alike, without guessing from its appearance.
No specific inspector tool was evaluated for this guide. The features listed above describe common behavior, and individual tools may show more or fewer details. The steps below use built-in programming and command-line functions that work the same way and do not depend on any particular website or app.
Long dash codes at a glance
| Representation | Em dash (—) value |
| Unicode code point | U+2014 |
| Unicode name | EM DASH |
| Decimal value | 8212 |
| UTF-8 bytes | E2 80 94 |
| UTF-16 code unit | 2014 |
| HTML named entity | — |
| HTML numeric entity | — or — |
| CSS escape | \2014 |
| JavaScript / JSON escape | \u2014 |
| Python escape | \u2014 or \N{EM DASH} |
| Windows Alt code (numeric keypad, Windows-1252) | Alt+0151 |
| macOS keyboard | Option+Shift+Hyphen |
| Microsoft Word | type 2014, then press Alt+X |
Dashes that are easy to confuse
Many different characters look like a horizontal line. If a search, replace, or validation step fails on text that seems correct, the cause is often a dash with a different code point than you expected.
| Character | Code point | Unicode name | Typical use |
| • | U+002D | HYPHEN-MINUS | Keyboard hyphen; also used as a minus sign in code |
| ‐ | U+2010 | HYPHEN | Typographic hyphen |
| ‑ | U+2011 | NON-BREAKING HYPHEN | Hyphen that prevents a line break |
| ‒ | U+2012 | FIGURE DASH | Dash with the width of a digit, as in phone numbers |
| – | U+2013 | EN DASH | Ranges, such as 10–20 |
| — | U+2014 | EM DASH | The long dash; breaks or pauses in a sentence |
| ― | U+2015 | HORIZONTAL BAR | Introducing quotations in some typographic styles |
| − | U+2212 | MINUS SIGN | Mathematical minus |
In Russian typography, the длинное тире (long dash) normally corresponds to the em dash, U+2014. The shorter короткое тире corresponds to the en dash, U+2013.
Step by step: find the code of the dash in your text
- 1. Copy only the dash character from your text, without any surrounding spaces. Spaces next to a dash may be ordinary spaces (U+0020) or non-breaking spaces (U+00A0), so check them separately if they matter.
- 2. Paste it into an inspector, or use one of the commands below.
- 3. Read the code point. U+2014 means you have an em dash. Any other value means it is a different character, even if it looks the same.
- 4. If you need to insert the character elsewhere, use the representation from the table that fits your context: an HTML entity for web pages, an escape sequence for code, or a keyboard method for typing.
Python
Example: the comments show the output defined by the Unicode standard for an em dash. If your result is different, the character is not U+2014.
import unicodedata
ch = "—"
print(hex(ord(ch))) # 0x2014
print(ord(ch)) # 8212
print(unicodedata.name(ch)) # EM DASH
print(ch.encode("utf-8")) # b'\xe2\x80\x94'
JavaScript (browser console or Node.js)
"—".codePointAt(0).toString(16) // "2014"
"—" === "\u2014" // true
Linux or macOS terminal
Example: in a UTF-8 terminal, a hex dump of an em dash should show the three bytes e2 80 94. A plain hyphen-minus shows the single byte 2d instead.
printf '—' | xxd
# 00000000: e280 94
Microsoft Word
Place the cursor directly after the dash and press Alt+X. Word replaces the character with its hexadecimal code, so an em dash becomes 2014. Press Alt+X again to turn the code back into the character. You can use the same shortcut in reverse to insert a dash: type 2014 and press Alt+X.
Verify the result without changing your content
- Inspect a copy of the text rather than the original, so that conversions such as Alt+X in Word do not leave codes inside your document.
- After inserting a dash, inspect it again to confirm that the code point is U+2014 and not U+2013 or U+002D.
- If you work with files, confirm that they are saved as UTF-8. If the file is opened with the wrong encoding, an em dash can appear as garbled characters such as — because its three UTF-8 bytes are read as separate characters.
- When you search and replace dashes, search for the exact code point (for example \u2014 in a regex that supports Unicode escapes). Searching for the visible glyph can miss look-alike characters or match the wrong one.
Limitations of this guide
The codes and names above come from the Unicode standard and from widely documented HTML, CSS, and programming-language conventions. Keyboard shortcuts can depend on your keyboard layout, operating system settings, and application. For example, Alt codes require a numeric keypad on Windows. This guide did not test any particular inspector website or app, so check how your chosen tool displays code points before relying on it.