Backslash vs. forward slash
An easy way to remember: the top of a backslash leans back, to the left.
- Forward slash (/): web addresses (
https://example.com/page), dates (11/13/2026), fractions (1/2) and “and/or.” - Backslash: Windows file paths (
C:\Users\Jane\Documents) and programming.
Never use a backslash in a web address. Browsers often fix it quietly, but links typed with backslashes can break in emails, apps and code. In everyday writing there is almost no use for a backslash at all; and\or is always a typo for and/or.
What a backslash does in code
- Escape sequences: in most languages,
\nis a new line,\ta tab and\"a quote inside a string. To get one backslash, type two:\\. - Regular expressions:
\dmatches a digit and\.matches a literal period. - LaTeX: every command starts with a backslash, such as
\fracor\alpha. To print the character itself, use\textbackslash. - Markdown: a backslash before a symbol such as
*or_makes it literal. That is why the shrug kaomoji loses an arm in chat apps unless you add extra backslashes. - Windows paths in code: write
C:\\Tempinside a C# or Python string, or use forward slashes, which Windows file functions also accept.
Look-alikes and a Japanese quirk
- ∖ (set minus) is the math operator for set difference, as in A ∖ B. In LaTeX it is
\setminus. - ⧵ (reverse solidus operator) is another math character that looks the same.
On Japanese systems that use the older Shift_JIS encoding and fonts, the backslash code displays as a yen sign, so Windows paths look like C:¥Users¥Jane. It is still the same character underneath. Korean systems have a similar quirk with the won sign ₩.
If pressing Shift with the backslash key gives you a vertical bar (|), that is expected: the pipe is the shifted character on the same key.
Frequently asked questions
Where is the backslash key on a keyboard?
On US keyboards, it is above Enter and below Backspace, on the same key as the vertical bar (|).
Which way does a backslash lean?
To the left: its top is further left than its bottom. The forward slash (/) leans right.
How do I type a backslash on a Mac?
Press the key above Return on a US keyboard. No modifier is needed.
Why does my backslash show up as ¥?
Older Japanese fonts and encodings display the backslash code as a yen sign. The underlying character is unchanged.
Unicode data: Unicode Character Database 18.0.0 (unicode.org).