HTML Entity for Slash (/)

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

What You'll Learn

How to display the forward slash (/, Unicode U+002F, SOLIDUS) in HTML using named entity, numeric references, and CSS escapes. This Basic Latin character is essential for URLs, file paths, date formatting, fractions, closing tags, and everyday web development.

Render it with /, /, /, or CSS \2F. In most HTML text you can type / directly—it is not a reserved character. Do not confuse / with Backslash U+005C (\, \) or Fraction Slash U+2044 (⁄).

⚡ Quick Reference — Slash

Unicode U+002F

Basic Latin (ASCII)

Hex Code /

Hexadecimal reference

HTML Code /

Decimal reference

Named Entity /

Solidus (readable)

Reference Table
Name           Value
────────────   ──────────
Unicode        U+002F
Hex code       /
HTML code      /
Named entity   /
CSS code       \2F
Official name  Solidus
Not the same   U+005C = \ (\ backslash)
               U+2044 = ⁄ (fraction slash)
Block          Basic Latin (U+0000–U+007F)
1

Complete HTML Example

A simple example showing / using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point::after{
   content: "\2F";
  }
 </style>
</head>
<body>
<p>Path (hex): https:&#x2F;&#x2F;example.com</p>
<p>Path (decimal): https:&#47;&#47;example.com</p>
<p>Path (named): https:&sol;&sol;example.com</p>
<p id="point">Slash (CSS): </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The forward slash (/) is universally supported in all browsers:

Chrome1+
Firefox1+
Safari1+
Edge12+
Opera4+
Android4.4+
iOS Safari1+

👀 Live Preview

See the forward slash in common contexts:

Single symbol /
URL path https://example.com/docs/page
Date format 06/06/2026
Named entity &sol; renders as /
Numeric refs &#x2F; &#47; &sol; \2F

🧠 How It Works

1

Hexadecimal Code

&#x2F; uses Unicode hexadecimal 2F to display the solidus (forward slash).

HTML markup
2

Decimal HTML Code

&#47; uses decimal Unicode value 47 for the same character.

HTML markup
3

Named Entity

&sol; is the standard HTML named entity for U+002F—readable when an explicit reference is needed.

HTML markup
4

CSS Entity

\2F is used in CSS stylesheets in the content property of pseudo-elements.

CSS stylesheet
=

Solidus result

All four methods render /. Unicode U+002F. Usually typed directly in HTML. Next: Small Contains Overbar.

Use Cases

The forward slash (/) commonly appears in:

🌐 URLs

Web addresses, path segments, and hyperlink examples.

📁 File paths

Unix-style directories and documentation paths.

📅 Dates

MM/DD/YYYY, DD/MM/YYYY, and regional date formats.

➗ Fractions

Ratios, informal division, and mathematical notation.

💻 Web development

Closing tags, self-closing elements, and route patterns.

📖 Documentation

Code samples, API paths, and technical writing.

💡 Best Practices

Do

  • Type / directly in most HTML text content
  • Use &sol; when you want an explicit, readable entity reference
  • Use CSS content: "\2F" for injected separators in stylesheets
  • Distinguish / (U+002F) from \ (U+005C)
  • Set <meta charset="utf-8"> for reliable rendering

Don’t

  • Use CSS \0002F when \2F is the correct short escape
  • Confuse solidus / with reverse solidus \
  • Confuse U+002F with fraction slash U+2044 (⁄)
  • Over-escape / in plain text where a literal character works
  • Put CSS escape \2F in HTML text nodes

Key Takeaways

1

Four ways to render U+002F when an entity is needed

&#x2F; &sol;
2

Usually you can type / directly—it is not reserved in HTML

3

Unicode U+002F — SOLIDUS (forward slash)

4

Pair knowledge with &bsol; (U+005C) for backslash paths

❓ Frequently Asked Questions

Use &#x2F; (hex), &#47; (decimal), &sol; (named entity), or \2F in CSS content. In most cases you can type / directly in HTML text.
U+002F (SOLIDUS). Basic Latin (ASCII). Hex 2F, decimal 47, named entity &sol;.
Usually no. / is not reserved in HTML and can be typed directly. Entities are useful for explicit encoding, tutorials, or CSS content injection.
/ is U+002F (solidus, &sol;) used in URLs and Unix paths. \ is U+005C (reverse solidus, &bsol;) used in Windows paths and escape sequences.
HTML code (&sol;, &#47;, or &#x2F;) is used in markup. CSS entity \2F is used in stylesheets, particularly in the content property of pseudo-elements.

Explore More HTML Entities!

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