Side by side
| Slash | Backslash | |
|---|---|---|
| Character | / | \ |
| Unicode name | SOLIDUS | REVERSE SOLIDUS |
| Codepoint | U+002F | U+005C |
| HTML entity | / or / | \ or \ |
| Windows Alt code | Alt 47 | Alt 92 |
| Mac (US layout) | / key (with ?) | \ key above Return (with |) |
| Typical use | URLs, Unix/macOS paths, fractions, dates, “and/or” | Windows paths, escape sequences, regex, LaTeX commands |
Names and a way to remember which is which
The forward slash goes by several names: slash, forward slash,stroke (common in British English, as in “24/7” read “twenty-four stroke seven”), oblique and virgule. Unicode's formal name is SOLIDUS. The backslash has fewer names; Unicode calls it REVERSE SOLIDUS, and almost everyone else just says backslash. Nobody needs to say “forward slash” except to rule out the backslash, which is why the phrase mostly turns up when someone is reading a URL aloud.
Mnemonic: read the character left to right, the way you read text. The forward slash rises as it moves forward, like a person leaning into a walk. The backslash leans back, like someone leaning back in a chair. Another reliable test: a web address never needs a backslash, so if it's in a URL, it's the forward one.
Where each one belongs
Forward slash (/)
- URLs. Every web address separates its path with /, as in
https://example.com/docs/page. Browsers often silently “fix” a backslash typed into the address bar, but links in emails, documents and code will break. - Unix, Linux and macOS paths.
/Users/sam/Documentsor/etc/hosts. In these systems a backslash in a path is not a separator at all. - Division and fractions.
7/2in code and spreadsheets, “1/2 cup” in recipes. For typeset fractions there are dedicated characters: the fraction slash ⁄ (U+2044) and the division slash ∕ (U+2215), plus precomposed fractions like ½ — see our fractions page. - Alternatives and short forms. “and/or,” “he/she,” “w/o,” “24/7,” and dates like 16/11/2026 or 11/16/2026.
- Closing tags in HTML (
</p>) and comments in many languages (// note).
Backslash (\)
- Windows paths.
C:\Users\Sam\Documentsand network shares like\\server\share. Most Windows APIs and PowerShell also accept forward slashes, but Explorer, Command Prompt and many older tools expect backslashes. - Escape sequences. In C, Java, JavaScript, Python and most other languages,
\nis a newline,\ta tab and\"a literal quote. To get one literal backslash inside a string you usually type two:"C:\\Temp". - Regular expressions.
\dfor a digit,\.for a literal dot. - LaTeX and Markdown. LaTeX commands start with one (
\frac,\alpha); in Markdown a backslash escapes formatting characters, so\*prints a literal asterisk.
The backslash has essentially no role in ordinary prose. If you see it in a sentence like “yes\no,” it should be a forward slash.
Where they are on different keyboards
| Layout | Slash / | Backslash \ |
|---|---|---|
| US (Windows & Mac) | Key left of right Shift (shares with ?) | Key above Enter/Return (shares with |) |
| UK (Windows) | Key left of right Shift (shares with ?) | Extra key between left Shift and Z (shares with |) |
| German QWERTZ (Windows) | Shift + 7 | AltGr + ß |
| German (Mac) | Shift + 7 | Option + Shift + 7 |
| French AZERTY (Windows) | Shift + : (bottom row) | AltGr + 8 |
| Spanish (Windows) | Shift + 7 | AltGr + º (key left of 1) |
The UK position catches out people who learned on a US keyboard: the backslash key moves down to the bottom-left, and the key above Enter becomes # and ~. If your backslash prints # or your “@” and quote marks have swapped, Windows is probably using the wrong layout: our backslash key not working and wrong keyboard layout fixes walk through it.
Why a backslash can look like ¥ or ₩
On Japanese systems, Windows paths often appear as C:¥Users¥Sam, and on Korean systems as C:₩Users₩Sam. The character stored in the file is still the backslash, U+005C. Older Japanese and Korean national character sets put their currency sign at the byte where ASCII has the backslash, and system fonts such as MS Gothic and Meiryo kept drawing that byte as ¥ (or ₩ in Korean fonts) for compatibility. Change the font to one without that mapping and the same text shows backslashes.
This matters when you copy: a ¥ copied from such a screen is usually a backslash and works as a path separator, but a real yen sign (U+00A5) or won sign (U+20A9) typed from a currency menu is a different character and will not. On a Japanese Mac keyboard the ¥ key types the real yen sign by default; Option + ¥ gives a backslash.
How to type each one
Windows: use the keys in the table above. If a key is missing or broken, hold Alt and type 47 on the number pad for /, or 92 for \. In Word you can also type 005C then press Alt+X.
Mac: on US and UK Mac layouts both characters have their own keys. On layouts where the backslash is hidden, open the Keyboard Viewer and hold Option and Shift to find it.
iPhone: the slash is on the first symbols page (tap 123). For the backslash, tap 123, then #+=.
Android (Gboard): the slash is on the ?123 page; the backslash is on the second symbols page, =\<.
Linux: both are on the keyboard; for code-point entry use Ctrl+Shift+U then 5c and Enter in GTK apps.
Common mistakes
- Backslashes in URLs.
example.com\pagemay work when typed into one browser and fail everywhere else. Always use /. - Single backslashes in code strings.
"C:\new\table"contains a newline and a tab, not folder names. Double the backslashes, use a raw string (Pythonr"C:\new"), or use forward slashes, which Windows accepts in most APIs. - Saying “backslash” when reading a URL. It's a habit in spoken English, and it sends listeners hunting for the wrong key.
- Using / as a division sign in typeset maths. It's fine in code and plain text; in formal maths, use a fraction or ÷ — see division sign.
FAQ
Is it “forward slash” or just “slash”?
Both are correct. “Slash” on its own means /. People add “forward” to distinguish it from the backslash.
Why does Windows use backslashes for paths?
Early MS-DOS commands already used / to introduce options (as in dir /w), so when directories arrived in DOS 2.0 the backslash was chosen as the separator. Windows inherited the choice.
Can I use forward slashes in Windows paths?
Often, yes. PowerShell, most programming languages and the Windows file APIs accept C:/Users/Sam. Command Prompt built-ins and some older programs do not, so use backslashes when typing paths for people to paste.
What is the Alt code for backslash?
Hold Alt and type 92 on the numeric keypad. The forward slash is Alt 47.

