Have you ever had to type the vertical bar (|) and not known where it was on the keyboard? This symbol, also called a ” pipe ,” is more common than you think, especially in computer science and programming. It is used to separate elements, write mathematical formulas, or give commands to the terminal. But finding it can be a challenge, especially if you use different devices.
In this comprehensive guide, you’ll discover how to type the vertical bar on Windows, Mac, iOS, and Android quickly and easily. You’ll learn the different key combinations, Alt codes, and other tricks so you’ll never get stuck again when you need this special character . Read on and become a vertical bar expert!
Windows
Keyboard
In Windows, the easiest way to type the vertical bar is to use the Alt Gr + key combination. The Alt Gr key is usually located to the right of the spacebar, while the key is located above the Enter key.
Alt Codes
You can also type the vertical bar using Alt codes . To do this, hold down the left Alt key and type 124 on the numeric keypad. Release the Alt key and the vertical bar will appear. Note that this combination requires the use of the numeric keypad, which is usually found on desktop keyboards. If you are using a laptop without a numeric keypad, you can try using the number keys located above the letters.
macOS

Keyboard
On macOS, to type the vertical bar , just press Shift + .
Character Map
On a MacBook Air, you can use the keyboard viewer to insert the vertical bar . To do this, hold down the Ctrl key and press the first key on the second row from the top .
iOS (iPhone and iPad)

Keyboard
To type the vertical bar on an iPhone with iOS, follow these steps:
- Press the “123” key to access the numeric and symbol keypad .
- Press the “#+ =” key.
- Press the third button from the left on the second row from the top.
Android
Typing the vertical bar on Android may vary slightly depending on the device, operating system version, and keyboard used. Here are some common methods:
Standard keyboard
On most Android keyboards, the vertical bar is located on the symbols keyboard. To access it, press the “?123” or “12#” key, depending on the keyboard layout. You may need to scroll through the pages of the symbol keyboard to find the vertical bar. In some cases, it can be found by pressing the “Alt” key on the symbol keyboard. .
Gboard
If you use Gboard, Google’s keyboard, you can type the vertical bar by following these steps:
- Press the “?123” key to access the symbol keyboard.
- Press the “=<” key.
- The vertical bar should be present on this screen.
Third-party keyboards
If you use a third-party keyboard, the location of the vertical bar may vary. In general, you can find it in the symbols keyboard or by exploring the keyboard settings. Some keyboards also offer the option to customize the layout and add specific symbols. .
Additional tips
- Explore the keyboard settings: Many Android keyboards offer customization options that allow you to add symbols or change the layout.
- Use the search function: If you can’t find the vertical bar, try using the search function on your keyboard.
- Copy and paste: If you have difficulty typing the vertical bar, you can always copy it from another document or web page and paste it where you want.
Uses of the vertical bar in computer science
It is important to note that the vertical bar can have different functions depending on the context in which it is used. The vertical bar has several uses in computer science. For example, in Backus-Naur form , the vertical bar separates symbols and/or sequences with which the symbol being defined can be replaced. Therefore, it indicates a choice. In some programming languages , the vertical bar is used as an “OR” (or logical) operator. In the Linux and macOS terminal, the vertical bar (“pipe”) is used to chain commands, passing the output of one command as input to the next.
In regular expressions , the vertical bar is used to indicate an alternation. For example, the expression “a|b” corresponds to “a” or “b”.
In addition, the symbol (|) is called a vertical bar or pipe (especially in the Unix community). In Unicode, it has the code U+007C. There is also the broken bar or vertical broken bar (in English, broken bar, ¦), which is a distinct character and in Unicode has the code U+00A6.
In Brief (TL;DR)
The vertical bar, a versatile and fundamental symbol in computer science, can be typed in different ways depending on the operating system.
In Windows, use the Alt Gr + combination or the Alt 124 code. On macOS, just press Shift + .
On iOS, the procedure requires access to the numeric and symbol keyboard.

Conclusions

Typing the vertical bar opens up a world of possibilities in the IT field. This seemingly simple special character plays a crucial role in various contexts, from programming to regular expressions . As we have seen, the methods for typing it vary depending on the device and operating system.
In Windows , the Alt Gr + key combination or the Alt 124 code offer quick and effective solutions. On macOS , however, simply press Shift + to insert the vertical bar without difficulty. On Android mobile devices, typing may require exploring secondary keyboards or using third-party apps.
It is important to remember that the vertical bar can have different meanings depending on the context. In some programming languages, for example, it acts as an ” OR ” operator, while in the Linux and macOS terminal it is used to chain commands, like a ” pipe ” that carries data from one process to another.
Its versatility and widespread use in various IT fields make it an essential symbol for anyone working with computers. Knowing the different ways to type the vertical bar on Windows , Mac , and iOS allows you to use it efficiently and productively, simplifying various operations and opening up new possibilities in computer use.
Frequently Asked Questions

To type the vertical bar on Windows, the quickest method is to simultaneously press the Alt Gr key and the key with the bar symbol, usually located above the Enter key or next to the number one. Alternatively, if you have a numeric keypad, you can use the ASCII code by holding down the left Alt key and typing the numbers 1, 2, and 4 in sequence. When you release the Alt key, the desired symbol will appear.
On Apple computers with the macOS operating system, the vertical bar or pipe is obtained with a simple combination of two keys. You need to hold down the Shift key and press the backslash key, which is generally located in the first row of the keyboard next to the number one or near the Enter key, depending on the keyboard layout in use. If you can’t find it, you can activate the keyboard viewer from the settings to locate its exact position.
In the field of computing, the vertical bar has multiple crucial functions. In Unix, Linux, and macOS operating systems, it is called a pipe and is used to chain commands, passing the output of one process as input to the next. In programming, it is often used as a logical OR operator, while in regular expressions it indicates an alternative between two values. It is also used in mathematical syntax and to separate elements in various markup languages.
On mobile devices, the symbol is located in the keyboard’s secondary menus. On iOS (iPhone and iPad), you need to press the 123 key, then the key with mathematical symbols (#+=), and look for the bar in the second row. On Android, the procedure varies slightly depending on the installed keyboard (such as Gboard or Samsung Keyboard), but it is generally found by accessing the symbols menu via the ?123 key and then pressing the key to display additional special characters like =.
Although visually similar, the solid vertical bar and the broken bar are two distinct Unicode characters. The vertical bar (U+007C) is the one functionally used in programming and in terminals for piping. The broken bar (U+00A6), which appears as a vertical line broken in the middle, is a historical graphic character that today has very limited use and cannot replace the pipe symbol in writing code or system commands.
Still have doubts about How to type the vertical bar (|) on any device?
Type your specific question here to instantly find the official reply from Google.
Sources and Further Reading






Did you find this article helpful? Is there another topic you’d like to see me cover?
Write it in the comments below! I take inspiration directly from your suggestions.