The backslash \ has its own key on a full-size keyboard, usually above Enter or beside the left Shift. Its Unicode name is Reverse Solidus. It separates folders in Windows paths, and in almost every programming language it is the escape character that changes the meaning of whatever follows it.
01 All shortcuts at a glance
| Platform | Shortcut | |
|---|---|---|
| Standard US keyboard | Press \ key (no shift) directly, it's a printable key, no code needed |
|
| Windows (any app) | Win+. or Win+; emoji/symbol picker, or Character Map (Win+R → charmap) |
|
| Mac | Control+Command+Space to open Character Viewer, search "Reverse Solidus" |
|
| Word / Outlook | Type 005C, then press Alt+X |
|
| Linux (IBus) | Ctrl+Shift+U, then 005c, then Enter |
|
| HTML / CSS | \ · \005c (CSS) |
02 Step by step, per platform
A real, followable procedure for every platform, not a thin restatement of the shortcut.
Any device (US keyboard)
- Press \ key (no shift), it's printed on the keycap.
- On other layouts (AZERTY, QWERTZ) the key may be in a different position or need a modifier, use the picker methods below if you can't find it.
Windows
- Open Character Map: Win+R, type charmap, press Enter.
- Search or scroll for Reverse Solidus (U+005C).
- Select it, click Copy, then paste where you need it.
Mac
- Press Control+Command+Space to open the Character Viewer.
- Type "Reverse Solidus" in the search field.
- Double-click the result to insert it.
Microsoft Word
- Type 005C.
- Press Alt+X immediately after, it converts the hex code to \.
03 Characters in this set
04 Troubleshooting & confusables
| Looks like it | But it's actually | When to use |
|---|---|---|
| / (U+002F) | Solidus, the forward slash | Use the forward slash in URLs and in Mac and Linux paths. The two are not interchangeable. |
| ⁄ (U+2044) | Fraction slash | Only for building fractions, where a good font will set the digits above and below it. |
| \ | An escaped backslash, not two characters of path | Inside a string literal, two backslashes produce one. This is the usual cause of a broken path. |
05 FAQ
What is the Unicode code point for the backslash?
It is U+005C, decimal 92. Unicode names it Reverse Solidus, since Solidus is the formal name for the forward slash.
When do I use a backslash instead of a forward slash?
Windows file paths use the backslash. URLs, Mac paths and Linux paths use the forward slash. Windows itself accepts either in most places, but a URL never accepts a backslash.
Why does my backslash disappear from text?
Something has read it as an escape character. In a string, n becomes a line break rather than a backslash and an n. Double it to keep a literal backslash.
What does the backslash do in a regular expression?
It changes the meaning of the next character. It makes a special character literal, as in . for a real full stop, and turns some plain letters into classes, as in d for any digit.
My keyboard has no backslash key. How do I type it?
On many non-US layouts it needs AltGr, often AltGr+minus or AltGr+7. Failing that, press Win+. on Windows or open the Character Viewer on a Mac and search for "reverse solidus".