HTML Entity for Hyphen (‐)

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

What You'll Learn

How to display the Hyphen (‐) in HTML using hexadecimal, decimal, named entity, and CSS escape methods. This character is U+2010 (HYPHEN) in the General Punctuation block (U+2000–U+206F). It is the proper Unicode hyphen for compound words and explicit hyphenation.

Render it with ‐, ‐, ‐, or CSS escape \2010. Prefer ‐ when you need a semantic hyphen rather than the ASCII hyphen-minus (-, U+002D).

⚡ Quick Reference — Hyphen

Unicode U+2010

General Punctuation

Hex Code ‐

Hexadecimal reference

HTML Code ‐

Decimal reference

Named Entity ‐

‐ — readable option

Reference Table
Name           Value
────────────   ──────────
Unicode        U+2010
Hex code       ‐
HTML code      ‐
Named entity   ‐
CSS code       \2010
Meaning        Unicode hyphen (compound words)
CSS note       \2010 or \02010 in content property
1

Complete HTML Example

This example demonstrates the Hyphen symbol (‐) using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\2010";
  }
 </style>
</head>
<body>
<p>Hyphen using Hexadecimal: &#x2010;</p>
<p>Hyphen using Decimal: &#8208;</p>
<p>Hyphen using Named Entity: &hyphen;</p>
<p id="point">Hyphen using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The Hyphen (‐) is supported in all modern browsers; most fonts include General Punctuation (U+2010):

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

👀 Live Preview

See the Hyphen (‐) in compound words and typography:

Large glyph
Named entity &hyphen; renders as ‐
Compound word well‐known
vs hyphen-minus ‐ (U+2010)   - (U+002D)
Numeric refs &#x2010; &#8208; &hyphen; \2010

🧠 How It Works

1

Hexadecimal Code

&#x2010; uses the Unicode hexadecimal value 2010 to display the symbol. The x prefix indicates hexadecimal format.

HTML markup
2

Decimal HTML Code

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

HTML markup
3

Named Entity

&hyphen; is the named entity for ‐—easy to remember and clear in source HTML.

HTML markup
4

CSS Entity

\2010 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 glyph: . Unicode U+2010 is in General Punctuation. Next: Hyphen Bullet.

Use Cases

The Hyphen symbol (‐) is commonly used in:

📝 Compound words

Join words in compound terms (e.g. well‐known, user‐friendly).

↩ Line-breaking

Indicate allowed break points; browsers can use the Unicode hyphen for hyphenation.

📰 Editorial

Published content and documents where the correct hyphen character matters.

🔗 Identifiers

Hyphenated slugs or identifiers where a true hyphen is required.

📅 Ranges

Date or number ranges (e.g. 2020‐2025) with the Unicode hyphen.

🎨 Typography

Consistent hyphen character across fonts and platforms.

💡 Best Practices

Do

  • Use &hyphen; for readable, semantic source markup
  • Use ‐ (U+2010) for hyphenation and compound words
  • Keep one method (named, hex, or decimal) consistent across the document
  • Use &shy; only for optional line-break hyphens (invisible until break)
  • Serve pages with UTF-8 (<meta charset="utf-8">)

Don’t

  • Put CSS escape \2010 in HTML text nodes
  • Confuse hyphen (‐) with en dash (–) or em dash (—)
  • Use &hyphen; when &shy; (soft hyphen) is what you need
  • Assume the keyboard hyphen (-) is always the same as U+2010
  • Skip font testing for pages heavy in Latin Extended punctuation

Key Takeaways

1

Three HTML references plus CSS all render ‐

&#x2010; &#8208; &hyphen;
2

For CSS stylesheets, use the escape in the content property

\2010
3

Unicode U+2010 — HYPHEN

4

Prefer &hyphen; for readability in HTML source

❓ Frequently Asked Questions

Use &#x2010; (hex), &#8208; (decimal), &hyphen; (named), or \2010 in CSS content. All produce ‐.
U+2010 (HYPHEN). General Punctuation block (U+2000–U+206F). Hex 2010, decimal 8208. Named entity: &hyphen;. Distinct from hyphen-minus (-, U+002D).
For compound words, explicit hyphenation and line-breaking hints, typography and editorial content, and when you need a semantic hyphen rather than the ASCII hyphen-minus.
&hyphen; (U+2010) is the Unicode hyphen for compound words and hyphenation. The keyboard hyphen (-) is hyphen-minus (U+002D). For semantic hyphenation, prefer &hyphen; or &#x2010;.
&hyphen; produces a visible hyphen (‐). &shy; is the soft hyphen: normally invisible and only appears when the browser breaks the line. Use &hyphen; when the hyphen should always show.
&hyphen; is used directly in HTML content. The CSS escape \2010 belongs in stylesheets, typically in the content property of pseudo-elements. Both render ‐.

Explore More HTML Entities!

Discover 1500+ HTML character references — punctuation, dashes, 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