How to Type Hyphens, En Dashes, and Em Dashes

Type an em dash, en dash, or hyphen on Windows, Mac, Linux, ChromeOS, phones, and in HTML or LaTeX, then confirm you inserted the right character.

Most keyboards have only one dash-like key, the hyphen. The en dash and em dash need a shortcut, a character picker, or an automatic substitution. This guide shows the quickest method on each common platform and explains how to check which character actually ended up in your text.

Hyphen vs. en dash vs. em dash

The three marks look similar, but they are separate characters with separate Unicode code points. A code point is the number that identifies a character. Software that searches, sorts, or validates text treats the three marks as different characters, so swapping one for another can change how that software handles your text.

Mark | Example | Unicode code point | Typical use
Hyphen (hyphen-minus) | well-known | U+002D | Joins words and splits words at line ends
En dash | pages 10–20 | U+2013 | Ranges of numbers, dates, or times, and some compound connections such as New York–London flight
Em dash | It was late—very late. | U+2014 | Breaks in a sentence, used like parentheses, a colon, or a pair of commas

Spacing around the em dash depends on the style guide. Chicago style uses no spaces (word—word). AP style puts a space on each side (word — word). Choose one and use it consistently. The hyphen key on a standard keyboard produces the hyphen-minus character, which is not the same as the true minus sign (U+2212) used in careful math typesetting.

Keyboard shortcuts by platform

The shortcuts below assume a standard US keyboard layout. Some applications override system shortcuts, and other layouts or older software versions may behave differently. If a shortcut does nothing, use the character picker for your platform.

Hyphen (every platform)

Press the key to the right of 0 on the top row. No modifier key is needed.

Windows

  • Em dash with an Alt code: turn on Num Lock, hold Alt, type 0151 on the numeric keypad, then release Alt.
  • En dash with an Alt code: hold Alt, type 0150 on the numeric keypad, then release Alt.
  • Alt codes need the numeric keypad. The number keys on the top row will not work.
  • No numeric keypad: press Windows key + period to open the emoji panel, open the Symbols section, and pick the dash from the punctuation symbols. This panel is available in recent versions of Windows.
  • Any Windows version: open the Character Map app, find the dash, select it, copy it, and paste it.

Microsoft Word

  • Em dash: Ctrl + Alt + Minus (the minus key on the numeric keypad).
  • En dash: Ctrl + Minus (on the numeric keypad).
  • Menu method: Insert > Symbol > More Symbols > Special Characters, then choose Em Dash or En Dash.
  • AutoFormat: by default, Word usually converts two hyphens between words (word--word) into an em dash once you keep typing. It can also convert a spaced single hyphen into an en dash. These conversions are controlled in the AutoCorrect options and may be turned off on your system.

Mac

  • Em dash: Option + Shift + Hyphen.
  • En dash: Option + Hyphen.
  • Character Viewer: press Control + Command + Space, search for "dash", and double-click the one you need.

Linux

  • Unicode entry in many GTK applications and IBus setups: press Ctrl + Shift + U, type 2014 for an em dash or 2013 for an en dash, then press Space or Enter.
  • Compose key, if you have one configured: Compose, then - - - gives an em dash. Compose, then - - . gives an en dash.
  • Support for both methods depends on your desktop environment and input method, so check them in your own applications.

ChromeOS

Press Ctrl + Shift + U, type the code (2014 or 2013), then press Space or Enter.

iPhone, iPad, and Android

  • Open the number and symbol layer of the on-screen keyboard.
  • Press and hold the hyphen key until a small menu appears.
  • Slide to the en dash (shorter) or the em dash (longer) and release.
  • On iPhone and iPad, Smart Punctuation (in keyboard settings) can turn two typed hyphens into an em dash automatically.

Typing dashes in HTML, LaTeX, and code

In markup languages you can write a dash as a named entity or a command instead of inserting the character itself. This is helpful when your editor or encoding makes direct input unreliable.

Context | En dash | Em dash
HTML named entity | – | —
HTML numeric entity | – | —
LaTeX source | -- | ---
Python, JavaScript, and similar string escapes | \u2013 | \u2014

If a file is saved as UTF-8, you can usually paste the dash characters in directly. If the file uses a different encoding, or if dashes later appear as garbled sequences, use the entities or escapes instead.

Check that you typed the right character

In many fonts the three marks look almost the same, especially at small sizes. That makes visual inspection unreliable. Use one of these checks:

  • Zoom in and compare the mark with a hyphen typed next to it. The en dash is usually about the width of a letter n, and the em dash about the width of a letter m.
  • Use your editor's find feature. Paste a known em dash into the search box and confirm that it matches your mark.
  • In Word, select the character and press Alt + X. Word replaces the character with its code (2014, 2013, or 002D). Press Alt + X again to restore the character.
  • In a script, print the code point of each character, as in the example below.

Example (Python 3): print the code point of every dash-like character in a string.

text = "pages 10–20 — see well-known note"
for ch in text:
    if ch in "-\u2013\u2014":
        print(ch, f"U+{ord(ch):04X}")

For this input, the script should print U+2013 for the range, U+2014 for the em dash, and U+002D for the hyphen in well-known. If you see U+002D where you expected a dash, a plain hyphen was inserted.

Converting double hyphens in existing text without breaking anything

Text written on a keyboard without dash shortcuts often uses two hyphens (--) in place of an em dash. A find-and-replace can fix this in bulk. A careless pattern, however, will also change content that must stay as it is, such as command-line options (--help), code comments, file names, or dates written with hyphens (2026-10-31). Save a copy of the original before running any bulk replacement.

Example (Python 3): replace a double hyphen with an em dash only when it sits directly between two word characters.

import re

text = "The draft--finished at last--was ready. Run tool --help."
fixed = re.sub(r"(?<=\w)--(?=\w)", "\u2014", text)
print(fixed)

Before: The draft--finished at last--was ready. Run tool --help.
After: The draft—finished at last—was ready. Run tool --help.

The --help option stays unchanged because a space comes before it, not a word character. This pattern still cannot tell prose from code. A sequence like value--count inside a code sample would also be converted, so leave code blocks out of the replacement or review each match by hand. A similar rule that turns a hyphen between digits into an en dash would also change phone numbers, ISO dates, and part numbers, so it needs the same review. After replacing, run the code-point check above on a few changed lines, and compare the result with your saved original to confirm that nothing else changed.

Quick reference

Platform or context | Em dash (—) | En dash (–)
Windows (numeric keypad) | Alt + 0151 | Alt + 0150
Microsoft Word | Ctrl + Alt + Num Minus | Ctrl + Num Minus
Mac | Option + Shift + Hyphen | Option + Hyphen
Linux and ChromeOS | Ctrl + Shift + U, 2014, Space | Ctrl + Shift + U, 2013, Space
Phones and tablets | Long-press the hyphen key | Long-press the hyphen key
HTML | — | –
LaTeX | --- | --