HTML Entity for Em Dash (—)

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 1 Code Example
Unicode U+2014

What You'll Learn

How to display the Em Dash (—) in HTML using hexadecimal, decimal, named entity, and CSS escape methods. This character is U+2014 (EM DASH) in the General Punctuation block (U+2000–U+206F)—a long dash used to separate clauses, create a break in thought, or replace parentheses.

Render it with —, —, the named entity —, or CSS escape \2014. Do not confuse the em dash with the en dash (–, U+2013, –), hyphen-minus (-), or minus sign (−, U+2212).

⚡ Quick Reference — Em Dash

Unicode U+2014

General Punctuation

Hex Code —

Hexadecimal reference

HTML Code —

Decimal reference

Named Entity —

Most common in HTML

Reference Table
Name           Value
────────────   ──────────
Unicode        U+2014
Hex code       —
HTML code      —
Named entity   —
CSS code       \2014
Related        U+2013 = En dash (– –); U+002D = Hyphen-minus (-)
1

Complete HTML Example

This example demonstrates the Em Dash (—) using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\2014";
  }
 </style>
</head>
<body>
<p>Em Dash using Hexadecimal: &#x2014;</p>
<p>Em Dash using HTML Code: &#8212;</p>
<p>Em Dash using HTML Entity: &mdash;</p>
<p id="point">Em Dash using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The Em Dash entity is universally supported in modern browsers:

Chrome 1+
Firefox 1+
Safari 1+
Edge 12+
Opera 4+
Android 4.4+
iOS Safari 1+

👀 Live Preview

See the em dash (—) compared with the en dash (–) and a hyphen-minus (-):

Inline text One thing—and only one—matters.
Large glyph
Dash lengths Em —   En –   Hyphen -
Entities &mdash; —   vs   &ndash;
Numeric refs &#x2014; &#8212; &mdash;

🧠 How It Works

1

Hexadecimal Code

&#x2014; uses the Unicode hexadecimal value 2014 to display the em dash. The x prefix indicates hexadecimal format.

HTML markup
2

Decimal HTML Code

&#8212; uses the decimal Unicode value 8212 to display the same character.

HTML markup
3

Named Entity

&mdash; is the standard named entity for U+2014. It is readable and easy to remember for punctuation in HTML.

HTML markup
4

CSS Entity

\2014 is used in CSS stylesheets, particularly in the content property of pseudo-elements like ::before and ::after.

CSS stylesheet
=

Same visual result

All four methods produce the em dash: . Unicode U+2014 in the General Punctuation block (U+2000–U+206F).

Use Cases

The Em Dash (—) commonly appears in:

📝 Clauses

Separate related clauses with more emphasis than a comma.

📰 Blogs

Editorial articles and posts with clear, stylish punctuation.

📚 Docs

Technical guides and tutorials for readable typography.

💬 Asides

Replace parentheses when an aside should stand out.

📄 Lists

Introduce a list or summary after a clause, like a colon with more pause.

🌐 Web copy

Landing pages and marketing text with professional tone.

💡 Best Practices

Do

  • Prefer &mdash; for readable HTML punctuation
  • Use UTF-8 (<meta charset="utf-8">) on every page
  • Pick one spacing style (no spaces vs thin spaces) and stay consistent
  • Use the correct dash: em, en, or hyphen for each purpose
  • Test rendering with your site’s body font

Don’t

  • Replace every comma or colon with an em dash
  • Confuse — (em) with – (en) or - (hyphen)
  • Use two hyphens (--) when an em dash is intended
  • Put CSS escape \2014 in HTML text nodes
  • Overuse em dashes in dense technical prose

Key Takeaways

1

Three HTML references plus CSS all render —

&#x2014; &#8212; &mdash;
2

For CSS stylesheets, use the escape in the content property

\2014
3

Unicode U+2014 — General Punctuation em dash

4

&mdash; is the standard named entity for writers

5

En dash is – (&ndash;, U+2013), shorter than em

❓ Frequently Asked Questions

Use &#x2014; (hex), &#8212; (decimal), &mdash; (named), or \2014 in CSS content. All produce —.
U+2014 (EM DASH). General Punctuation block (U+2000–U+206F). Hex 2014, decimal 8212.
When you need to separate clauses, create a break in thought, add emphasis, or replace parentheses or a colon in editorial and web copy.
The em dash (—, U+2014, &mdash;) is longer and often used for breaks in sentences. The en dash (–, U+2013, &ndash;) is shorter and often used for ranges (e.g. pages 10–20).
HTML entities (&#8212;, &#x2014;, or &mdash;) go directly in markup. The CSS escape \2014 is used in stylesheets, typically in the content property of pseudo-elements. Same visual result, different layers of the stack.

Explore More HTML Entities!

Discover 1500+ HTML character references — punctuation, math symbols, and more.

All HTML Entities →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful