HTML Entity for En Dash (–)

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

What Is En Dash?

En dash (–) is the Unicode character at U+2013 in General Punctuation. Official name: EN DASH. It is a mid-length dash used mainly for ranges and spans, as in 2010–2020.

Remember
Character     –
Unicode       U+2013
Named entity  –
Hex entity    –
Decimal       –
CSS escape    \2013
Not the same  — (em 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\2013Stylesheet content
Em dash (related)— (—, U+2014)Sentence breaks — longer

When to Use Which

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

Live Preview

En dash rendered alone, in a date range, and compared with related dashes.

Glyph –
Large glyph –
Date range 2020–2025
Compared –   —   ‐   -
With entities Named: – | Hex: – | Decimal: –

Complete HTML Example

One page that shows En 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>En Dash (U+2013) in HTML</title>
  <style>
    #point::after {
      content: "\2013";
    }
  </style>
</head>
<body>
  <p>Built with Named: &ndash;</p>
  <p>Built with Hex: &#x2013;</p>
  <p>Built with Decimal: &#8211;</p>
  <p id="point">Built with CSS: </p>
  <p>Typed: –</p>
  <p>Range: 2020&ndash;2025</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &ndash; is the preferred HTML5 name for U+2013 → –.

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

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

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

5. Typed: paste – in a UTF-8 document, or write a range like 2020&ndash;2025.

Pitfalls & Tips

Common mistakes when working with En Dash.

Name

Prefer &ndash;

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

—

Not an em dash

U+2014 (&mdash;) is longer and used for sentence breaks. En dash is for ranges.

-

Not a hyphen-minus

The keyboard - (U+002D) is not an en dash. Use &ndash; when you need the typographic range dash.

Spaces

Usually no spaces in ranges

Most style guides write ranges closed, like 10–20, not 10 – 20. Follow your house style.

CSS vs HTML

Do not mix escapes

\2013 belongs in CSS strings. &ndash; / &#x2013; / &#8211; belong in HTML.

a11y

Keep range meaning clear

Screen readers may announce an en dash as a pause or “dash.” Nearby words like “from … to …” help when precision matters.

Semicolon

End references

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

Browser Support

En dash (U+2013) and its entity forms (&ndash;, &#x2013;, &#8211;, CSS \\2013) are supported in all mainstream browsers. Visible glyphs depend on General Punctuation font coverage.

✓ Universal support

En Dash (–)

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+2013 / &ndash; Full support

Bottom line: Prefer &ndash; in HTML. Use &#x2013; / &#8211; when numeric form is required, and \\2013 only inside CSS content.

Key Takeaways

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

One line: U+2013 → &ndash; / &#x2013; / CSS \2013.

Frequently Asked Questions

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

Did you know?

En dash is Unicode U+2013 (decimal 8211) — glyph – (EN DASH) in General Punctuation. HTML5 names it &ndash;. It is shorter than an em dash (&mdash;, —) and longer than a hyphen (&hyphen;, ‐). Common uses: number and date ranges.

Next: End Of Proof

Learn the HTML entity for end of proof (U+220E).

End Of Proof tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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