HTML Entity for Backslash (\)

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

What Is the Backslash Entity?

Backslash (\) is Unicode U+005C (reverse solidus) in the Basic Latin (ASCII) block. It appears in Windows-style paths, escape sequences, regex, and code documentation. HTML provides the named entity \.

Remember
Character     \
Unicode       U+005C
Hex entity    \
Decimal       \
Named entity  \
CSS escape    \5C
Not the same  / (U+002F solidus)

All of these produce the same glyph: \. Prefer a typed \ in ordinary HTML; use \ / numeric forms when you want an explicit escape; use CSS for generated content.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Direct character\HTML text (UTF-8) — fine in normal text
Named entity\HTML markup (preferred name)
Hex entity\HTML markup
Decimal entity\HTML markup
CSS escape\5CStylesheet content

When to Use Which

SituationUse
Show a backslash in docs / pathsType \ or \
Web URL / folder separator/ (U+002F) — not backslash
Need an entity in HTML source\, \, or \
Generated text via ::before / ::aftercontent: "\5C"
At sign / other ASCII punctuation@ / &

Live Preview

Backslash in everyday documentation contexts.

Path-style C:\Users\Student
Large glyph \
vs. slash \  vs.  /
Escape cue word1\word2
With entities Named: \ | Hex: \ | Decimal: \

Complete HTML Example

One page that shows \ with hex, decimal, named entity, CSS escape, and a typed character. Use View Output or open the live editor.

Hex + Decimal + Named + CSS + Typed

Five ways to produce \ in a single document.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Backslash (\) in HTML</title>
  <style>
    #point::after {
      content: "\5C";
    }
  </style>
</head>
<body>
  <p>Backslash using Hex Code: &#x5C;</p>
  <p>Backslash using HTML Code: &#92;</p>
  <p>Backslash using Named Entity: &bsol;</p>
  <p id="point">Backslash using CSS Entity: </p>
  <p>Typed directly: \</p>
</body>
</html>
Try It Yourself

How It Works

1. Hex: U+005C → &#x5C; in HTML. The browser turns it into \.

2. Decimal: same code point as 92 → &#92;. Same result as hex.

3. Named: &bsol; is the standard HTML name for reverse solidus — clear in tutorials.

4. CSS: use \5C in content (not an HTML entity). In CSS, \ starts an escape, so \5C is the safe way to emit U+005C.

5. Typed \: fine in UTF-8 HTML text. All five lines show the same glyph.

Pitfalls & Tips

Common mistakes when working with the backslash (\).

/

Not a forward slash

Web paths and URLs use / (U+002F). Backslash is a different character.

CSS

Escape carefully in CSS

In CSS, \ starts an escape. Prefer content: "\5C" for a literal backslash.

Prefer

Type \ when you can

In normal HTML text a literal \ is fine. Use &bsol; when you want an explicit entity.

CSS vs HTML

Do not mix escapes

\5C belongs in CSS. &bsol; / &#x5C; belong in HTML.

JS

Different in JavaScript strings

In JS source, \\ is often needed for one backslash. That is language syntax — not an HTML entity.

Semicolon

End references

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

Browser Support

Backslash (U+005C) and its entity forms (&bsol;, &#x5C;, &#92;, CSS \\5C) are supported in all mainstream browsers. It is a core ASCII character.

✓ Universal support

Backslash (\)

Type \, or encode with named, hex, decimal, or CSS escape — same glyph 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+005C / entities Full support

Bottom line: Prefer a typed \ or &bsol; for normal text. Use numeric forms when generating markup, and \\5C only inside CSS content.

Key Takeaways

  • Unicode: backslash is U+005C (decimal 92).
  • HTML: prefer &bsol; (or &#x5C; / &#92; / typed \).
  • CSS: use \5C inside content (backslash is an escape starter).
  • Watch out: \ ≠ / (forward slash).

One line: U+005C → &bsol; / &#x5C; / &#92; / CSS \5C.

Frequently Asked Questions

Use &#x5C; (hex), &#92; (decimal), &bsol; (named), a literal \ in UTF-8, or the CSS escape \5C in the content property. All render a backslash.
U+005C (hex 5C, decimal 92). Unicode names it REVERSE SOLIDUS. It belongs to the Basic Latin (ASCII) block.
Yes. &bsol; maps to U+005C. Prefer it in tutorials; a typed \ is fine in ordinary HTML text.
\ is reverse solidus (U+005C). / is solidus / forward slash (U+002F). They are different characters — paths and URLs usually use / on the web.
HTML entities (&#92;, &#x5C;, or &bsol;) go in markup. The CSS escape \5C is used in stylesheets (usually in the content property of ::before/::after). Both render a backslash.
In CSS, \ starts an escape. To emit a literal backslash via content, use \5C (or an equivalent CSS escape) — do not paste a lone \ without a valid escape form.

Did you know?

Backslash is Unicode U+005C (decimal 92) in Basic Latin — official name REVERSE SOLIDUS. HTML’s named reference is &bsol;. A typed \ is fine in UTF-8 HTML; use entities when you want an explicit escape in docs or generated markup.

Next: Balloon Spoked Asterisk

Learn the HTML entity for the balloon-spoked asterisk (❉).

Next 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