Backslash (\)

The backslash \ is Unicode U+005C, the backward-sloping punctuation mark used for Windows file paths, escape sequences, and LaTeX commands. Press Copy to put it on your clipboard.

Unicode
U+005C
HTML
\
Word
005C Alt+X

How to type the backslash (\)

The quickest way is to press Copy above and paste. To type \ yourself, use the method for your device below.

Windows

  1. In Word or Outlook, type 005C and press Alt + X. Alt + X converts the hex code before the cursor into the character, and back again.
  2. Press Win + R, type charmap and press Enter. Tick “Advanced view”, search for Reverse Solidus, then Select and Copy. Character Map is built into every version of Windows.

Mac

  1. Press Control + Command + Space to open the Character Viewer, search for backslash and double-click it.
  2. With the Unicode Hex Input keyboard enabled (System Settings → Keyboard → Input Sources), hold Option and type 005C.

Linux & ChromeOS

  1. Press Ctrl + Shift + U, type 5c, then press Enter or Space. Works in GTK and IBus apps (GNOME, Firefox, Chrome, LibreOffice) and on ChromeOS.

iPhone & iPad

  1. Copy \ from this page, then go to Settings → General → Keyboard → Text Replacement and add it with a shortcut such as ;back. The shortcut then turns into the symbol as you type, in every app.

Android

  1. In Gboard, tap ?123, then =\<. \ is on that page.
  2. Copy \ here, then open Gboard settings → Dictionary → Personal dictionary and add it with a shortcut.

Microsoft Word

  1. Type 005C, then press Alt + X.
  2. Insert → Symbol → More Symbols. Set “from” to Unicode (hex), type 005C in “Character code” and click Insert.

Google Docs

  1. Insert → Special characters, then search for “backslash” or draw it in the box.

Excel & Google Sheets

  1. Enter =UNICHAR(92) in a cell. It works in Excel 2013 and later and in Google Sheets.

HTML

  1. Write &bsol; or &#92; in your HTML.

What does \ mean?

The \ symbol, formally titled REVERSE SOLIDUS in Unicode (U+005C), was invented in June 1960 by American computer scientist Bob Bemer at IBM. Bemer noticed that while standard forward slashes (/) existed on mechanical typewriters, ALGOL and formal computer logic lacked operators for boolean logical conjunction (AND ∧) and disjunction (OR ∨). Bemer introduced \ into the ASCII telecommunications standard so that programmers could compose ∧ by striking / over \, and ∨ by striking \ over /.

Today, the backslash is famous for two primary computational duties. First, in Microsoft MS-DOS and Windows operating systems, \ serves as the standard directory path separator in file systems, distinguishing paths like C:\Users\Documents from the forward slash conventions used across UNIX, Linux, macOS, and internet web URLs. This distinction originated because early MS-DOS versions reserved the forward slash for command-line option switches (like DIR /W), forcing DOS 2.0 to adopt \ for subdirectories.

Second, across virtually every modern programming language (including JavaScript, Python, C, C++, and Java), the backslash serves as the universal escape character. Preceding characters with \ gives them special meaning, such as \n for newlines, \t for tab stops, or \" to escape literal quotes inside string literals. In LaTeX, every formatting macro begins with a backslash. Compare \ with the vertical bar |, the tilde ~, and the asterisk * in our keyboard symbols index.

Common uses

  • Windows file paths: separating drive letters, folders, and filenames (e.g., C:\Program Files\App)
  • String escape sequences: producing special formatting in programming like \n (newline) and \t (tab)
  • LaTeX markup: initiating typesetting macros and mathematical formulas (e.g., \alpha or \frac{a}{b})
  • Regular expressions: escaping metacharacters like \. or \* to match literal characters

Backslash codes for HTML, CSS and programming

Every code below produces \. Use the HTML entity in web pages, the CSS escape in content, and the escape sequence in source code.

Codes for \
Unicode code pointU+005C
HTML entity (named)&bsol;
HTML decimal&#92;
HTML hex&#x5C;
CSS contentcontent: "\5C";
JavaScript"\u005C"
Python"\u005C"
Python (by name)"\N{REVERSE SOLIDUS}"
Java / C#"\u005C"
UTF-8 bytes5C
UTF-16005C
URL encoded%5C

\ vs look-alike characters

These characters look similar to \ but have a different meaning and code. Pasting the wrong one can break search, sorting and screen readers.

CharNameWhen to use it
Solidus
U+002F
Forward slash (solidus), used in internet URLs and UNIX directory paths.
Fullwidth Reverse Solidus
U+FF3C
Fullwidth reverse solidus, used in East Asian typography to match ideograph widths.
Set Minus
U+2216
Set minus symbol, a mathematical operator denoting set difference.

Symbols similar to \

Click to copy, or open a symbol for its codes. See the full line symbols collection.

  • Horizontal Bar Details
  • Em Dash Details
  • En Dash Details
  • Figure Dash Details
  • Vertical Line Details

\ character properties

Official Unicode name
REVERSE SOLIDUS
Also known as
reverse solidus, backward slash, escape character, path separator, down slash
Code point
U+005C
Unicode block
Basic Latin (U+0000–U+007F)
General category
Other punctuation (Po)
Added in
Unicode 1.1 (1993)
Plane
Basic Multilingual Plane (0)
Emoji
No, it is a text symbol

Frequently asked questions

Why does Windows use backslashes while websites use forward slashes?

Early MS-DOS 1.0 adopted the forward slash / for command options (such as DIR /P). When directory folders were added in DOS 2.0, Microsoft adopted the backslash \ as the folder separator to avoid breaking backwards compatibility with existing command switches.

Why does my backslash display as a yen sign ¥ in Japanese fonts?

Early Japanese JIS X 0201 character sets replaced ASCII code point 0x5C (backslash) with the Japanese yen currency sign ¥. On Japanese Windows installations, file paths often appear as C:¥Users, though the operating system still interprets them as backslashes.

How do I type a literal backslash inside a programming string?

Because the backslash is an escape character in most programming languages, you must write a double backslash \\ inside strings to output a single literal backslash.

What is the alt code for the backslash?

On Windows, hold Alt and type 92 on the numeric keypad to get \. On a laptop without a keypad, copy it from this page or use 005C then Alt + X in Word.

How do I type the backslash on a Mac?

There is no single Option shortcut for \ on the US layout. Press Control + Command + Space to open the Character Viewer, search for “backslash” and double-click it, or copy it from this page.

What is the HTML code for the backslash?

Use the named entity \ or the numeric reference \ (hex \). All three display \ in every browser.

What is the Unicode for the backslash?

\ is U+005C, officially named REVERSE SOLIDUS, in the Basic Latin block. It has been part of Unicode since version 1.1 (1993).