There’s a difference between hyphens and dashes and the two should not be interchanged.
- (—) the em dash (—)
- (–) the en dash (–)
- (-) the hyphen
The em dash is the standard typographical dash and is often “faked” with a hyphen or double hyphen. The em dash is used to indicate a strong break in or pause in a sentence—think of it as a super comma—and can be used in pairs like parentheses. The em dash can also used before a quotation when displayed on its own line.
—I told you not to use the hyphen or double hyphen instead of the em and en dashes.
The en dash (half as wide) is used as a connector in expressions(3–4, 1971–72, etc.). It could be said that the en dash is short for “through.”
The hyphen is only used to create compound words and to hyphenate words. This is typically done by software where needed and is not manually set—especially in web applications where the hyphenation break may change dynamically with the column width of the page. Currently, dynamic hyphenation is not well supported (if supported at all) in modern web browsers.
(see also: Typesetting Tip #3: Emphasis)