Identify Unicode Dash Characters

How to tell hyphens, en dashes, em dashes, minus signs and lookalikes apart by code point, and when converting between them preserves or changes meaning.

Several different characters can look like a short horizontal line. The hyphen on a keyboard, the en dash, the em dash, the minus sign and a few lookalikes are separate Unicode characters, each with its own code point. In many fonts they look nearly identical. They still behave differently when text is searched, parsed, read aloud or copied into another program. This guide explains how to identify which dash you have and how to judge whether swapping one for another is safe for your use.

Is converting or normalizing dashes suitable for your use?

Converting dashes is the right choice when the destination expects one specific character. Source code, command-line arguments, CSV fields, URLs-as-text, product codes and phone numbers usually expect the plain hyphen-minus (U+002D). Typographic dashes there can cause silent failures. In prose meant for human readers, the en dash and em dash carry real distinctions, such as ranges versus interruptions. Converting them all to hyphens loses those distinctions.

The tradeoff is between machine reliability and typographic meaning. Use plain hyphen-minus when text will be typed back in, matched by exact string comparison, or processed by software you do not control. Keep or add typographic dashes when the text is finished prose and the destination is known to render and handle them. If you cannot tell where the text will end up, plain hyphen-minus is the more predictable choice.

What dash characters exist, and how do they differ?

Unicode groups most dashes under the general category Pd (Dash_Punctuation). It also defines a separate binary property, Dash, that covers additional dash-like characters. The minus sign is not in Pd. It is classified as a math symbol (Sm), but it does carry the Dash property. The soft hyphen is a format character (Cf) and is not a visible dash at all. The table below lists the characters readers most often confuse.

Character | Code point | Unicode name | Typical use
• | U+002D | HYPHEN-MINUS | Keyboard hyphen; default in code, data and identifiers
‐ | U+2010 | HYPHEN | Typographic hyphen in compound words
‑ | U+2011 | NON-BREAKING HYPHEN | Hyphen that prevents a line break at that point
‒ | U+2012 | FIGURE DASH | Dash matching digit width, e.g. in tabular numbers
– | U+2013 | EN DASH | Ranges such as 10–12; some compound constructions
— | U+2014 | EM DASH | Interruptions, asides, sentence breaks
― | U+2015 | HORIZONTAL BAR | Introducing quoted dialogue in some styles
− | U+2212 | MINUS SIGN | Subtraction and negative numbers in typeset math
(invisible) | U+00AD | SOFT HYPHEN | Optional break point; shown only if a line wraps there
⸺ | U+2E3A | TWO-EM DASH | Marking omitted letters or words
- | U+FF0D | FULLWIDTH HYPHEN-MINUS | Fullwidth form used in East Asian text layouts

Some characters look like dashes but belong to unrelated categories. Examples include BOX DRAWINGS LIGHT HORIZONTAL (U+2500) and the KATAKANA-HIRAGANA PROLONGED SOUND MARK (U+30FC). They can slip into text through copy and paste from tables, terminals or Japanese text. A visual check alone will not catch them.

What does a dash conversion actually change?

Replacing one dash with another changes the stored character. It is not a visual effect. A font or style setting does not turn a hyphen into an en dash; the code point itself is replaced. This is different from CSS styling or font choice, which can change how a dash looks without changing which character it is. When a word processor's automatic formatting turns two typed hyphens into an em dash, it is substituting characters in the stored text.

Unicode normalization handles only some of these characters. Compatibility normalization (NFKC or NFKD) maps the fullwidth hyphen-minus and the small hyphen-minus (U+FE63) to U+002D. It maps the small em dash (U+FE58) to U+2014 and the non-breaking hyphen to U+2010. It does not convert en dashes, em dashes or the minus sign to the keyboard hyphen. A workflow that needs all dashes collapsed to U+002D therefore needs an explicit mapping, not just normalization.

A simple check shows how meaning can shift. The input "pages 10–12" uses an en dash to mean a range. Converting it to "pages 10-12" stays readable but becomes ambiguous in contexts where a hyphen could join parts of an identifier. The input "−3" with a true minus sign becomes "-3" with hyphen-minus. That is usually what spreadsheets and programming languages require. In typeset math, however, it may look slightly different.

Will the result stay readable and usable after copying or sharing?

Copying text generally preserves the exact code point, so a dash you cannot visually distinguish will travel with the text. This is the source of many practical problems:

  • Commands copied from formatted documents may contain an en dash where a hyphen-minus option flag was intended, and the command will not be recognized.
  • Exact-match searches, find-and-replace and spreadsheet formulas treat each dash as a different character, so a search for one may not find another.
  • Numbers written with a minus sign (U+2212) may not be parsed as negative values by software expecting hyphen-minus.
  • Soft hyphens are invisible but present, so two strings that look identical can fail to match.
  • An editor's automatic formatting may convert hyphens to dashes as you type, changing text you intended to keep literal.

How screen readers announce dashes depends on the specific software and its punctuation verbosity settings. Some settings name the character, and others pause or skip it. How search engines treat different dashes is also not uniform. No scoped tests of particular screen readers, search engines or destinations were available for this guide. Check the target environment directly instead of assuming one result applies everywhere.

Keep a plain-text version that uses U+002D wherever text will be pasted into a terminal, a form field with strict validation, code, data files or anything that will be matched programmatically. Typographic dashes are best kept to finished, human-read content.

How can you identify which dash you have?

Since dashes are often visually indistinguishable, reliable identification means looking up the code point. Useful search terms include "Unicode character inspector," "code point lookup" and the code point itself written as "U+2014." Operating systems include character viewers or symbol panels that show a character's name. The exact location and keyboard shortcuts vary by platform and version, and they were not verified here, so check your system's documentation.

If you can run a short script, you can inspect text without relying on any third-party tool. The Python standard library reports each character's code point, name and category:

import unicodedata

text = "pages 10–12 — see −3 and co-op"
for ch in text:
    if unicodedata.category(ch) == "Pd" or ch in "\u2212\u00ad":
        print(f"U+{ord(ch):04X}  {unicodedata.name(ch)}")

# U+2013  EN DASH
# U+2014  EM DASH
# U+2212  MINUS SIGN
# U+002D  HYPHEN-MINUS

In JavaScript, regular expressions with the u flag support Unicode property escapes. \p{Pd} matches dash punctuation, and \p{Dash} matches the broader Dash property, which includes the minus sign:

const text = "10–12 — −3 co-op";
const found = [...text.matchAll(/\p{Dash}/gu)].map(m =>
  "U+" + m[0].codePointAt(0).toString(16).toUpperCase().padStart(4, "0")
);
console.log(found); // ["U+2013", "U+2014", "U+2212", "U+002D"]

Neither pattern catches lookalikes from other categories, such as box-drawing lines or the katakana prolonged sound mark. If you suspect them, print the code point of every non-ASCII character instead of filtering by category. Without a script, a few visual clues can narrow things down. In many fonts the em dash is noticeably longer than the en dash, and the en dash is longer than the hyphen. The minus sign often sits at the height of a plus sign. These relationships depend on the font, so treat them as hints, not proof.