The hyphen, the en dash, and the em dash, at first glance, are hard to tell apart. Of these three dashes, the dash most commonly used is the hyphen. It’s the dash you see on most computer keyboards — and because of this presence, it’s often misused. The hyphen is used to form “compound” phrases such as “three-year-old”, “know-nothing”, or “free-for-all”. In other contexts in which you might see a dash, such as when reporting a score or a range of dates — or in place of commas, like this — different kinds of dashes are used.
The first of these dashes is the en dash. Only slightly longer than the hyphen, and named because it is the same length as a lowercase letter “n,” the en dash is used when reporting scores or a range of dates. For example, if a pop star’s tour was going on from July 20 through 22, it would be written with an en dash as “July 20–22”. When connecting the names of two places, such as the Massapequa–Penn Station train, an en dash would also be used.
The em dash is the second of these dashes, and the longest dash of the three. It got its name because it is the same length as a lowercase letter “m,” The dash you see used in place of commas or parentheses — with the purpose of inserting a dependent clause in the middle of a compound sentence — is the em dash.
As these dashes cannot be found on the conventional computer keyboard save for the hyphen, to type them requires an Alt code. An Alt code can be used to type a “special character,” such as the aforementioned dashes, by simply holding the Alt key on a computer keyboard down and typing a numerical code with the number pad on the right side of the keyboard at the same time. The Alt code for the en dash is Alt+0150, while the em dash requires Alt+0151.
En and em dashes are not always necessary to use when writing, but they are technically considered “proper” and add some nice visual interest.