The rules below are based on the Chicago Manual of Style (CMOS).  Please note that there are slight variations and preferences when using other style guides.

We often use the word “dash” when referring to any line symbol between words or numbers. But we could be talking about a hyphen, en dash, or em dash, and they all have different uses. (There is also a 2-em dash and 3-em dash, but I won’t go into those here.)

Also worth noting is the lack of a space before or after these marks.

Hyphen (-)

The hyphen is a separator of words or numbers that are considered a single unit. This includes telephone numbers, social security numbers, compound adjectives, and words spelled out letter by letter.

En Dash (–)

So named because it is the length of a capital letter “N”, the en dash has several uses in everyday writing. Most computer programs will automatically format the en dash, but you may need to look up how to do it with your specific program.

Number Ranges

Note: Parallel construction must be used, so pair “from” with an appropriate word such as “to” and “between” with “and.” In these cases, you cannot replace “to” or “and” with the en dash.

Signifying “To”

Compound Adjectives
Used to link compound adjectives when linking across more than two words: most commonly with proper nouns. (The hyphen is used for linking two words.)

Em Dash (—)

You can probably guess that the name is derived from its being the length of the capital letter “M”. Most computer programs will form this simply by typing the hyphen twice with no spaces—but you’ll want to verify that on your specific program.

Set Off Amplifying or Explanatory elements
In this way they can be used instead of commas, parentheses, or colons.

Sudden Breaks or Interruptions

It’s important to note that a question mark or exclamation point can precede an em dash. But a comma, colon, or semicolon may never precede an em dash. When the context would normally call for a comma (as in the final example), the comma should be omitted. A period can be used if it is part of an abbreviation.