The hyphen (-), overused in American English, primarily functions to combine phrasal adjectives—two or more words understood together as an adjective modifying a noun: high-density tube, used-record store. Omitting the hyphen may result in a miscue (a used record store may be a record store that is used or a store that sells used records). Hyphens do not typically follow prefixes: prefer nonprofit to non-profit, though in some situations the hyphen may be necessary to avoid confusion: prefer re-sign to resign to indicate signing something again.
The dash comes in two flavors: en dash (–) and em dash (—), named due to their lengths approximating a capital N and M respectively. Reserve the en dash for a range of values, connection or contrast between word pairs, and in place of versus or to: Yankees are winning 6–3, 1990–2000, the North–South divide. Some editors use the en dash to connect phrasal adjectives: Man Booker–winning writer, used-record–store. I have not seen this often, so follow your preferred style guide on the matter. Type the en dash with option-hyphen on Macs and alt-0150 on Windows (or copy-paste the symbol). Don’t use hyphens in place of dashes; doing so was a typewriter habit, and since we no longer use typewriters, we no longer have reason to miuse the hyphen.
Most modern style guides reserve the em dash for interruptions in a sentence. It is stronger than a comma and more useful than a semicolon. Some compare it to parentheses in effect, though I prefer the em dash for its visual fluidity (see parentheses). The em dash can mark parenthetical thoughts or asides—like so—or clarifications of concepts, as demonstrated in this article’s first sentence. Two conjoined em dashes style missing or omitted names: I met Mrs. S—— yesterday on —— St. In creative writing, the em dash also functions to indicate an interruption, such as when one character cuts off another character’s dialogue: “I told him to—” / “You told whom?” Overusing em dashes in a single sentence can confuse the parenthetical for the main thought. Type the em dash with option-shift-hyphen on Macs and alt-0151 on Windows.
When formatting em dashes, The Chicago Manual of Style, APA Publication Manual, MLA Handbook, Garner’s Dictionary of Modern English Usage, and many American publishers require the em dash without spaces on either side, as shown in my writing. The AP Stylebook, which only some journalists should follow, spaces the em dash — as shown here. Occasionally you may see em dashes written as spaced en dashes – a rarity in American publishing, though the preferred method of The Elements of Typographic Style. Its author argues that the em dash cramps modern fonts while the spaced en dash does not. I disagree; the spaced en dash, castrated, dangles precariously in its empty space, suggesting rather than directing. Use the standard unspaced em dash unless you bear a strong editorial objection.