Hyphens and dashes look similar, but they’re not interchangeable.
option + hyphen
option + shift + hyphen
The hyphen (-) is the smallest of these marks. It has three uses.
A hyphen appears at the end of a line when a word breaks onto the next line. These hyphens are added and removed automatically by the automatic hyphenation in your word processor or web browser.
Some multipart words are spelled with a hyphen (topsy-turvy, cost-effective, bric-a-brac). But a prefix is not typically followed with a hyphen (nonprofit, not non-profit).
A hyphen is used in phrasal adjectives (listener-supported radio, dog-and-pony show, high-school grades) to ensure clarity. Nonprofessional writers often omit these hyphens. As a professional writer, you should not.
For instance, consider the unhyphenated phrase five dollar bills. Is five the quantity of dollar bills, or are the bills each worth five dollars? As written, it suggests the former. If you mean the latter, then you’d write five-dollar bills.
Dashes come in two sizes—the en dash and the em dash. The em dash (—) is typically about as wide as a capital H. The en dash (–) is about half as wide.
En and em dashes are often approximated by typing two or three hyphens in a row (-- or --- ). Don’t do that—it’s another typewriter habit. Use real dashes.
The en dash has two uses.
It indicates a range of values (1880–1912, pages 330–39, Exhibits A–E). If you open with from, pair it with to instead of an en dash (from 1880 to 1912, not from 1880–1912).
It denotes a connection or contrast between pairs of words (conservative–liberal split, Arizona–Nevada reciprocity, Sarbanes–Oxley Act).
The em dash is used to make a break between parts of a sentence. Use it when a comma is too weak, but a colon, semicolon, or pair of parentheses is too strong. The em dash puts a nice pause in the text—and it is underused in professional writing.
by the way
Don’t use a slash ( / ) where an en dash is correct.
Even though the en dash is used for joint authors (Sarbanes–Oxley Act), use a hyphen for compound names. If the children of Sarbanes and Oxley married, they’d be known as Mr. & Mrs. Sarbanes-Oxley (with a hyphen), not Mr. & Mrs. Sarbanes–Oxley (with an en dash).
Em and en dashes are typically set flush against the surrounding text. Some fonts include a little white space around the em dash; some don’t. If your em dashes look like they’re being crushed—particularly if you’re setting type on screen—it’s fine to add word spaces before and after.
An en dash makes an acceptable minus sign in spreadsheets or mathematical expressions. (See also math symbols.)
Em and en refer to units of typographic measurement, not to the letters M and N. In a traditional metal font, the em was the vertical distance from the top of a piece of type to the bottom. The en was half the size of the em. Originally, the width of the em and en dashes corresponded to these units. In today’s digital fonts, they run narrower.
Fans of Robert Bringhurst’s book The Elements of Typographic Style (and I am among them—see bibliography) may know that he recommends using en dashes with spaces rather than em dashes. Perhaps this practice is common in Mr. Bringhurst’s native Canada. But in American typography, it’s not.