HTML Entity for Slash (/)

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
U+002FBasic Latin (ASCII)
/Hexadecimal reference
/Decimal reference
/Solidus (readable)
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)Complete HTML Example
A simple example showing / using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:
<!DOCTYPE html>
<html>
<head>
<style>
#point::after{
content: "\2F";
}
</style>
</head>
<body>
<p>Path (hex): https://example.com</p>
<p>Path (decimal): https://example.com</p>
<p>Path (named): https://example.com</p>
<p id="point">Slash (CSS): </p>
</body>
</html>🌐 Browser Support
The forward slash (/) is universally supported in all browsers:
👀 Live Preview
See the forward slash in common contexts:
🧠 How It Works
Hexadecimal Code
/ uses Unicode hexadecimal 2F to display the solidus (forward slash).
Decimal HTML Code
/ uses decimal Unicode value 47 for the same character.
Named Entity
/ is the standard HTML named entity for U+002F—readable when an explicit reference is needed.
CSS Entity
\2F is used in CSS stylesheets in the content property of pseudo-elements.
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:
Web addresses, path segments, and hyperlink examples.
Unix-style directories and documentation paths.
MM/DD/YYYY, DD/MM/YYYY, and regional date formats.
Ratios, informal division, and mathematical notation.
Closing tags, self-closing elements, and route patterns.
Code samples, API paths, and technical writing.
💡 Best Practices
Do
- Type
/directly in most HTML text content - Use
/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
\0002Fwhen\2Fis 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
\2Fin HTML text nodes
Key Takeaways
Four ways to render U+002F when an entity is needed
/ /Usually you can type / directly—it is not reserved in HTML
Unicode U+002F — SOLIDUS (forward slash)
Pair knowledge with \ (U+005C) for backslash paths
Previous: Skull and Crossbones (☠) Next: Small Contains Overbar (⋾)
❓ Frequently Asked Questions
/ (hex), / (decimal), / (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 /./ 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, /) used in URLs and Unix paths. \ is U+005C (reverse solidus, \) used in Windows paths and escape sequences./, /, or /) 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.
8 people found this page helpful
