What the Backslash key does
The backslash separates folders in Windows paths (C:\Users), escapes characters in programming (\n for newline), and starts commands in LaTeX. Shift+\ types the vertical bar |, the pipe used to chain commands in terminals.
On a Mac
Same key above return. Mac paths use forward slashes, so backslash is mainly for code and escaping.
On a laptop
Its position depends on the layout more than the laptop: US above Enter, UK/ISO next to left Shift.
Shortcuts that use the Backslash key
| Shortcut | What it does |
|---|---|
| \ | Backslash |
| Shift+\ | Pipe | |
| Alt+92 | Backslash via Alt code |
| \\ in code | A literal backslash |
| Alt Gr+- (some European layouts) | Backslash |
If the Backslash key is missing or not working
If the key types # or ~, the wrong layout is active (UK vs US). Test the key below; it reports as Backslash on ANSI layouts and IntlBackslash on ISO layouts.
Test it here: click the tester, press the key, and it should light up green. A red key is stuck; a key that never lights up is dead or intercepted by the system. The full keyboard tester has the press log and more detail.
Click the tester, then press any key. Browser shortcuts are blocked while it has focus.
—
- key
- —
- code
- —
- keyCode
- —
none
Max at once: 0 (rollover)
None detected. A key held for more than 2 seconds is flagged.
Frequently asked questions
Where is the backslash on a UK keyboard? +
Next to the left Shift key, below Caps Lock. On US keyboards it is above Enter.
How do I type a backslash on a laptop without the key? +
Hold Alt and type 92 on the numpad, or use Win+. and search "backslash". On many European layouts Alt Gr+- or Alt Gr+ß types it.
What is the difference between \ and /? +
The backslash leans left and is used in Windows paths and code escapes; the forward slash leans right and is used in URLs, fractions and Mac/Linux paths.