HTML Entity for En Dash (–)

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

What You'll Learn

How to display the En Dash (–) in HTML using hexadecimal, decimal, named entity, and CSS escape methods. This character is U+2013 (EN DASH) in the General Punctuation block (U+2000–U+206F)—shorter than the em dash (—) and longer than the hyphen-minus (-).

Render it with –, –, the named entity –, or CSS escape \2013. Use en dashes for ranges and spans (e.g. 2020–2025, pages 10–20); use em dashes for breaks in thought, not ranges.

⚡ Quick Reference — En Dash

Unicode U+2013

General Punctuation

Hex Code –

Hexadecimal reference

HTML Code –

Decimal reference

Named Entity –

Most common in HTML

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

Complete HTML Example

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

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\2013";
  }
 </style>
</head>
<body>
<p>En Dash using Hexadecimal: &#x2013;</p>
<p>En Dash using HTML Code: &#8211;</p>
<p>En Dash using HTML Entity: &ndash;</p>
<p id="point">En Dash using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The En 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 en dash (–) in range examples and compared with em dash (—) and hyphen (-):

Date range 2020–2025
Large glyph
Dash lengths Em —   En –   Hyphen -
Entities &ndash; –   vs   &mdash;
Numeric refs &#x2013; &#8211; &ndash;

🧠 How It Works

1

Hexadecimal Code

&#x2013; uses the Unicode hexadecimal value 2013 to display the en dash. The x prefix indicates hexadecimal format.

HTML markup
2

Decimal HTML Code

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

HTML markup
3

Named Entity

&ndash; is the standard named entity for U+2013. It is readable and easy to remember for ranges and spans in HTML.

HTML markup
4

CSS Entity

\2013 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 en dash: . Unicode U+2013 in the General Punctuation block (U+2000–U+206F).

Use Cases

The En Dash (–) commonly appears in:

📅 Date ranges

Years, seasons, or periods (2020–2025).

🔢 Number ranges

Pages, chapters, scores (10–20).

📰 Editorial

Articles and blogs with proper typographic spans.

🔗 Connections

Compound links (New York–London flight).

📚 Docs

Version ranges and specification spans in technical writing.

🌐 Web copy

Schedules, events, and product lineups with clear ranges.

💡 Best Practices

Do

  • Prefer &ndash; for ranges and spans in HTML
  • Use en dash for 2020–2025, not em dash or hyphen
  • Serve pages with UTF-8 (<meta charset="utf-8">)
  • Match your style guide for spaces around en dashes
  • Test rendering with your site’s body font

Don’t

  • Use – for sentence breaks (use — em dash instead)
  • Confuse – (en) with — (em) or - (hyphen)
  • Use a hyphen-minus in published date ranges
  • Put CSS escape \2013 in HTML text nodes
  • Mix entity styles randomly in one file

Key Takeaways

1

Three HTML references plus CSS all render –

&#x2013; &#8211; &ndash;
2

For CSS stylesheets, use the escape in the content property

\2013
3

Unicode U+2013 — General Punctuation en dash

4

&ndash; is the standard named entity

5

Em dash is — (&mdash;, U+2014), longer than en

❓ Frequently Asked Questions

Use &#x2013; (hex), &#8211; (decimal), &ndash; (named), or \2013 in CSS content. All produce –.
U+2013 (EN DASH). General Punctuation block (U+2000–U+206F). Hex 2013, decimal 8211.
For date ranges, number ranges, compound connections, and spans between items—not for dramatic breaks in sentences (use the em dash for that).
The en dash (–, U+2013, &ndash;) is shorter and used for ranges and connections. The em dash (—, U+2014, &mdash;) is longer and used for breaks in thought or emphasis in sentences.
HTML entities (&#8211;, &#x2013;, or &ndash;) go directly in markup. The CSS escape \2013 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