Quick Answer:
To type a backslash \ on Windows, hold Alt + 092. For the pipe symbol | on Windows, use Alt + 124. On Mac, press Shift + Option + 7 for backslash, and Option + Shift + L for pipe.
Want to boost your tech skills? Start a 7-day free trial of Treehouse Courses—55% off for new students for a limited time using this link!
Not having every special character readily available on your keyboard can be frustrating—especially when you’re programming, working in the command line, or writing technical documentation.
Two of the most commonly used symbols in coding and terminal environments are the backslash (\
) and pipe (|
). If these characters aren’t visible on your keyboard, don’t worry—there are simple methods to type them on both Windows and Mac.
Contents
For Windows Users
Method 1: Using Alt Codes
You can type special characters by holding the Alt key and entering a numeric code:
- Backslash (
\
):Alt + 092
- Pipe (
|
):Alt + 124
✅ Make sure Num Lock is turned on and use the numeric keypad (not the top number row).
Method 2: Using Character Map
Windows includes a built-in utility for typing and copying any symbol.
- Open the Start menu, type
Character Map
, and open the app. - Check the “Advanced view” box.
- Search for “backslash” or “vertical line.”
- Select the character → click Select → click Copy.
- Paste it wherever you need it.
For Mac Users
Method 1: Keyboard Shortcuts
Most special characters can be typed using key combinations:
- Backslash (
\
):Shift + Option + 7
- Pipe (
|
):Option + Shift + L
Note: These shortcuts may vary slightly depending on your keyboard layout (especially international ones).
Method 2: Keyboard Viewer
MacOS provides a virtual keyboard to help visualize and use special characters.
To enable it:
- Go to System Settings > Keyboard
- Under “Text Input,” click Edit…
- Enable “Show Input Menu in menu bar”
To use it:
- Click the Input Menu icon in the menu bar
- Select Show Keyboard Viewer
- Hold down the Option key to see available special characters
- Click a character to type it
Bonus: Keyboard Viewers & Symbol Tools
On Windows:
- Use the On-Screen Keyboard (
osk
in Start menu) as an alternative to the physical one.
On Mac:
- Try Emoji & Symbols (press
Control + Command + Space
) to browse a huge collection of characters and insert them anywhere.
Learn the Basics
Want to understand more than just symbols? Build your technical fluency in Treehouse’s Digital Literacy Track. It’s perfect for beginners navigating tech tools and workflows.
FAQs
How do I type a pipe symbol (|
) on Windows?
Use Alt + 124
on the numeric keypad.
How do I type a backslash (\
) on Windows?
Use Alt + 092
on the numeric keypad.
What if my laptop doesn’t have a numeric keypad?
Use the On-Screen Keyboard (Windows) or Keyboard Viewer (Mac) to access symbols visually.
Can I copy and paste the symbols instead?
Absolutely—use tools like Character Map or Emoji & Symbols to copy/paste special characters.
Conclusion: Mastering Special Characters
Lacking certain keys on your keyboard doesn’t have to hold you back. Whether you’re coding, writing, or navigating technical tools, learning how to type special characters like \
and |
gives you control and speed.
From Alt codes and keyboard shortcuts to on-screen viewers, there’s a solution for every system. Once you get familiar with these options, you’ll never be stuck hunting for a symbol again.
Read more: