HTML Entity for Em Dash (—)

Beginner
5 min read
Updated: Sep 2026
1 example
Unicode U+2014

What Is Em Dash?

Em dash (—) is the Unicode character at U+2014 in General Punctuation. Official name: EM DASH. It is a long dash used for strong breaks, asides, and abrupt pauses in sentences.

Remember
Character     —
Unicode       U+2014
Named entity  —
Hex entity    —
Decimal       —
CSS escape    \2014
Not the same  – (en dash) · ‐ (hyphen) · -

Prefer — in HTML markup. You can also use — / —, or type — in a UTF-8 document.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Named entity—HTML markup (preferred)
Hex entity—HTML markup
Decimal entity—HTML markup
Direct character—HTML text (UTF-8)
CSS escape\2014Stylesheet content
En dash (related)– (–, U+2013)Ranges and spans — shorter

When to Use Which

SituationUse
Strong break / aside in a sentence— or type —
Number or date rangesEn dash (–, –)
Compound wordsHyphen (‐, ‐) or keyboard -
Digit-width dashFigure dash (U+2012)
Generated text via ::before / ::aftercontent: "\2014"

Live Preview

Em dash rendered alone, in a sentence break, and compared with related dashes.

Glyph —
Large glyph —
In a sentence Wait—did you see that?
Compared —   –   ‐   -
With entities Named: — | Hex: — | Decimal: —

Complete HTML Example

One page that shows Em Dash with named, hex, decimal, CSS escape, and a typed character. Use View Output or open the live editor.

Named + Hex + Decimal + CSS + Typed

Five ways to display — in HTML and CSS.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Em Dash (U+2014) in HTML</title>
  <style>
    #point::after {
      content: "\2014";
    }
  </style>
</head>
<body>
  <p>Built with Named: &mdash;</p>
  <p>Built with Hex: &#x2014;</p>
  <p>Built with Decimal: &#8212;</p>
  <p id="point">Built with CSS: </p>
  <p>Typed: —</p>
  <p>Sentence: Wait&mdash;did you see that?</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &mdash; is the preferred HTML5 name for U+2014 → —.

2. Hex: &#x2014; inserts the same code point. Same visual as named.

3. Decimal: same code point as 8212 → &#8212;.

4. CSS: use \2014 in content (not an HTML entity). #point::after appends —.

5. Typed: paste — in a UTF-8 document, or write a break like Wait&mdash;did you see that?.

Pitfalls & Tips

Common mistakes when working with Em Dash.

Name

Prefer &mdash;

&mdash; is the readable named form for U+2014. Numeric forms still work when you need them.

–

Not an en dash

U+2013 (&ndash;) is shorter and usually used for ranges. Em dash is for sentence breaks.

-

Not a hyphen-minus

The keyboard - (U+002D) is not an em dash. Use &mdash; when you need the long typographic dash.

Spacing

Style the spaces deliberately

Some house styles put spaces around em dashes; others do not. Pick one style and stay consistent.

CSS vs HTML

Do not mix escapes

\2014 belongs in CSS strings. &mdash; / &#x2014; / &#8212; belong in HTML.

a11y

Keep sentence meaning clear

Screen readers usually treat an em dash as a pause. Keep the surrounding sentence clear so the break still makes sense aloud.

Semicolon

End references

Always finish entities with ; — write &mdash;, not &mdash.

Browser Support

Em dash (U+2014) and its entity forms (&mdash;, &#x2014;, &#8212;, CSS \\2014) are supported in all mainstream browsers. Visible glyphs depend on General Punctuation font coverage.

✓ Universal support

Em Dash (&#x2014;)

Encode with named, hex, decimal, CSS escape, or type the character — same code point everywhere encoding is supported.

100% Browser coverage
Google Chrome Supported
Yes
Microsoft Edge Supported
Yes
Mozilla Firefox Supported
Yes
Apple Safari Supported
Yes
Opera Supported
Yes
Internet Explorer All versions
Yes
U+2014 / &mdash; Full support

Bottom line: Prefer &mdash; in HTML. Use &#x2014; / &#8212; when numeric form is required, and \\2014 only inside CSS content.

Key Takeaways

  • Unicode: em dash is U+2014 (decimal 8212) — glyph —.
  • HTML: prefer &mdash; (named form).
  • CSS: use \2014 inside content for generated text.
  • Length: em — ≠ en – ≠ hyphen ‐ ≠ -.

One line: U+2014 → &mdash; / &#x2014; / CSS \2014.

Frequently Asked Questions

Use &mdash; (named), &#x2014; (hex), &#8212; (decimal), type — directly in UTF-8, or the CSS escape \2014 in content.
U+2014 (EM DASH). Hex 2014, decimal 8212. It belongs to the General Punctuation block (U+2000–U+206F).
Yes. &mdash; is the HTML5 named entity for U+2014 and is usually the most readable choice in typographic markup.
Use it for strong breaks, parenthetical asides, or abrupt pauses in sentences. Prefer &ndash; for number ranges (for example 2010–2020), and a hyphen for compound words.
HTML entities (&mdash;, &#8212;, or &#x2014;) go in markup. The CSS escape \2014 goes in stylesheet strings (usually content on ::before/::after).
No. U+2014 is — (em dash). U+2013 is – (en dash). U+2010 is ‐ (hyphen).

Did you know?

Em dash is Unicode U+2014 (decimal 8212) — glyph — (EM DASH) in General Punctuation. HTML5 names it &mdash;. It is longer than an en dash (&ndash;, –) and a hyphen (&hyphen;, ‐).

Next: Empty Set

Learn the HTML entity for empty set (U+2205).

Empty Set tutorial →

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