HTML Em Dash Code

This page contains HTML code for adding an em dash within the text of your website or blog.

The em dash is a punctuation mark that can be used in place of a comma, parentheses, or a colon — usually for the purposes of improved readibility.

Create an Em Dash

To create an em dash in HTML, use the appropriate HTML entity. Type either the entity number or entity name where you'd like the em dash to appear.

HTML Entity Number

Here's how you use the HTML entity number to display an em dash.

Source CodeResult

HTML Entity Name

This example uses the entity names to display the em dash.

Source CodeResult

Usage Example

Here's an example of using an em dash within a sentence.

Source CodeResult

After visiting the library—to read up on how mind affects matter—I proceeded to the gym and set a new world record for bench press.

Em Dash vs En Dash

To the untrained eye, an em dash could easily be mistaken for an en dash or even a hypen. This is because the only difference (visually) between those three characters is their width. The em dash is the widest. The en dash is slightly narrow than the em dash, and the hypen is slightly narrower again.

All three have different purposes, so be sure to use the correct character for your intended purpose.

About HTML.am

HTML.am was created in order to provide HTML tools, codes, tutorials, and other resources to help webmasters create and maintain their HTML documents.

HTML.am aims primarily at beginners, but may also be useful to web professionals.

About the HTML Codes

The HTML codes on this website are provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

Need Hosting?

Our partner site ZappyHost provides website hosting, domain names and related products at some of the best prices on the web. If you need web hosting, check them out!