HTML Entity for Slash (/)

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

What Is the Slash?

Slash (/) is the Basic Latin character at Unicode U+002F. Official name: SOLIDUS (forward slash). You can type / directly in HTML, or write it with a named or numeric entity when encoding must be explicit.

Remember
Character     /
Unicode       U+002F
Named entity  /
Hex entity    /
Decimal       /
CSS escape    \2F
Not the same  \ · ⁄ · ∕

Prefer typing / in normal page text, URLs, and paths. Use / or numeric forms when you need an explicit entity reference.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Direct character/HTML text (default choice)
Named entity/HTML markup (explicit)
Hex entity/HTML markup
Decimal entity/HTML markup
CSS escape\2FStylesheet content
Backslash (related)\ (\, U+005C)Windows paths / escapes

When to Use Which

SituationUse
URLs, Unix paths, dates, fractions in textType /
Need an explicit entity in HTML source/, /, or /
Windows path / escape character\ / \
Typographic fraction slash⁄ (U+2044)
Generated text via ::before / ::aftercontent: "\2F"

Live Preview

Slash rendered in common web and text contexts.

URL https://example.com/path
Large glyph /
Date 09/24/2026
Compared /   \   ⁄
With entities Named: / | Hex: / | Decimal: /

Complete HTML Example

One page that shows the slash 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 produce /, plus URL and date examples.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Slash (/) in HTML</title>
  <style>
    #point::after {
      content: "\2F";
    }
  </style>
</head>
<body>
  <p>Slash using Named Entity: &sol;</p>
  <p>Slash using Hex Code: &#x2F;</p>
  <p>Slash using HTML Code: &#47;</p>
  <p id="point">Slash using CSS Entity: </p>
  <p>Typed directly: /</p>
  <p>URL: https:&sol;&sol;example.com</p>
  <p>Date: 09&sol;24&sol;2026</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &sol; is the HTML5 name for U+002F → /. Useful when an entity must be explicit.

2. Hex: U+002F → &#x2F; in HTML. Same glyph as named and typed forms.

3. Decimal: same code point as 47 → &#47;. Same result as hex and named.

4. CSS: use \2F in content (not an HTML entity). #point::after appends that / after the paragraph text.

5. Typed / uses: type / for everyday text. https:&sol;&sol;example.com shows the same URL as typing the slashes.

Pitfalls & Tips

Common mistakes when working with the slash.

Default

Type / when you can

Unlike & or <, slash is safe in normal HTML text. Entities are optional.

\

Not a backslash

/ is U+002F. \ is U+005C (&bsol;) — used in Windows paths and escapes.

⁄

Fraction slash is different

U+2044 (⁄) is for typographic fractions. Everyday dates and URLs use U+002F.

CSS vs HTML

Do not mix escapes

\2F belongs in CSS strings. &sol; / &#x2F; / &#47; belong in HTML.

Semicolon

End named entities

Always finish with ; — write &sol;, not &sol.

Tags

Closing tags need a real /

Write </div> with a typed slash. Do not replace the tag slash with &sol;.

Browser Support

Slash (U+002F) and its entity forms (&sol;, &#x2F;, &#47;, CSS \\2F) are supported in all mainstream browsers.

✓ Universal support

Slash (/)

Type /, or encode with named, hex, decimal, or CSS escape — same glyph everywhere.

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+002F / entities Full support

Bottom line: Use a typed / for normal text, URLs, and paths. Prefer &sol; when encoding must be explicit, and \\2F only inside CSS content.

Key Takeaways

  • Unicode: slash is U+002F (decimal 47) — solidus /.
  • HTML: type /, or use &sol; / &#x2F; / &#47; when needed.
  • CSS: use \2F inside content for generated text.
  • Meaning: / ≠ \ ≠ fraction slash ⁄.

One line: U+002F → type /, or &sol; / &#x2F; / &#47; / CSS \2F.

Frequently Asked Questions

Type / directly in most HTML text, or use &sol; (named), &#x2F; (hex), &#47; (decimal), or the CSS escape \2F in content. Prefer typing / unless you need an explicit entity.
U+002F (SOLIDUS). Hex 2F, decimal 47. It belongs to the Basic Latin (ASCII) block.
Yes. Use &sol;. Numeric forms &#47; and &#x2F; also work. Typing / is usually best for normal body text.
No. / is U+002F (solidus, &sol;). \ is U+005C (backslash, &bsol;). ⁄ is U+2044 (fraction slash) — a different typographic slash for fractions.
Use &sol; when generating markup that must be escaped consistently, or when an explicit entity is clearer for tooling. For URLs, paths, and dates in normal HTML, type /.
HTML entities (&sol;, &#47;, or &#x2F;) go in markup. The CSS escape \2F goes in stylesheet strings (usually content on ::before/::after).

Did you know?

Slash (solidus) is Unicode U+002F (decimal 47). HTML5 names it &sol;. In normal page text you can usually type / directly — it is not reserved like & or <. Do not confuse it with backslash &bsol; (\, U+005C) or fraction slash ⁄ (U+2044).

Next: Small Contains Overbar

Continue to the next entity in the HTML entities series.

Small Contains Overbar 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