How to Type a Backslash (\) on Any Keyboard
Quick answer: on a US keyboard the backslash has its own key above Enter. On a UK keyboard it is on the key left of Z. On a German Windows keyboard press AltGr+ß, and on a German Mac Shift+Option+7. On any Windows PC, Alt+92 on the numeric keypad works.
Where \ is
| Keyboard / layout | Keys |
|---|---|
| US (Windows and Mac) | \ key above Enter |
| UK Windows PC | \ key left of Z (next to left Shift) |
| German, Windows | AltGr + ß |
| German, Mac | Shift + Option + 7 |
| Any Windows PC | Alt+92 (numeric keypad) |
Some compact laptops move the key or make it share space with another; look for \ printed small on a key and try Fn with it. If the layout setting doesn't match the keyboard, the key types something else; switch layouts with Win+Space. Without a numeric keypad, see Alt codes not working.
Backslash vs forward slash
| / forward slash | \ backslash | |
|---|---|---|
| Leans | right, like a / road sign | left |
| Used in | web addresses, dates (25/10), "and/or", division | Windows paths (C:\Users), escape codes (\n), LaTeX commands (\alpha) |
| Alt code | Alt+47 | Alt+92 |
Modern Windows also accepts / in most paths, but \ is the standard. Web addresses always use /.
Backslash in code
In most programming languages, \ starts an escape sequence: \n is a new line, \t a tab, and \\ a literal backslash. That is why Windows paths in code are often written with double backslashes ("C:\\Users"). In LaTeX, every command starts with \ (see LaTeX math symbols).
Phones
iPhone: 123 → #+=. Gboard: ?123 → =\<.
Related: pipe | (which shares the \ key), keyboard symbols and our backslash page (Unicode calls it "reverse solidus").
Frequently asked questions
Where is the backslash on a UK keyboard?
On the key to the left of Z, next to the left Shift key. On US keyboards it is above Enter.
How do I type a backslash on a German keyboard?
Press AltGr + ß on Windows. On a German Mac, press Shift + Option + 7.
What is the Alt code for backslash?
Alt+92, typed on the numeric keypad with Num Lock on.
What is the difference between \ and /?
The forward slash / is used in web addresses, dates and division. The backslash \ separates folders in Windows file paths and starts escape codes such as \n in programming.
Looking for something else? Browse 1,000+ copy-paste symbols, the full Alt Codes finder, or the emoji picker.