How to type the vertical bar (|) on any device

Published on May 11, 2026
Updated on May 11, 2026
reading time

Keyboard with highlighted vertical bar

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!

Advertisement

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.

Read also →

macOS

How to type the vertical bar (|) on any device - Summary Infographic
Summary infographic of the article “How to type the vertical bar (|) on any device” (Visual Hub)

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 .

Discover more →

iOS (iPhone and iPad)

Step-by-step tutorial showing keyboard shortcuts to type the vertical bar symbol on various devices.
This practical guide reveals the exact keyboard shortcuts to easily type the vertical bar symbol on any device. (Visual Hub)

Keyboard

To type the vertical bar on an iPhone with iOS, follow these steps:

  1. Press the “123” key to access the numeric and symbol keypad .
  2. Press the “#+ =” key.
  3. Press the third button from the left on the second row from the top.
Discover more →

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:

  1. Press the “?123” key to access the symbol keyboard.
  2. Press the “=<” key.
  3. 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.

List: How to type the vertical bar (|) on any device
This guide reveals the exact keyboard shortcuts to type the vertical bar symbol quickly on any operating system. (Visual Hub)

Conclusions

disegno di un ragazzo seduto a gambe incrociate con un laptop sulle gambe che trae le conclusioni di tutto quello che si è scritto finora
Advertisement

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

disegno di un ragazzo seduto con nuvolette di testo con dentro la parola FAQ
How do you make the vertical bar on a Windows keyboard?

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.

Where is the pipe symbol on the Mac keyboard?

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.

What is the vertical bar used for in computer science?

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.

How to type the vertical bar on Android smartphones and iPhones?

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 =.

What is the difference between a vertical bar and a broken bar?

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.

This article is for informational purposes only and does not constitute financial, legal, medical, or other professional advice.
Francesco Zinghinì

Engineer and digital entrepreneur, founder of the TuttoSemplice project. His vision is to break down barriers between users and complex information, making topics like finance, technology, and economic news finally understandable and useful for everyday life.

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.

Icona WhatsApp

Subscribe to our WhatsApp channel!

Get real-time updates on Guides, Reports and Offers

Click here to subscribe

Icona Telegram

Subscribe to our Telegram channel!

Get real-time updates on Guides, Reports and Offers

Click here to subscribe

Advertisement
Condividi articolo
1,0x
Table of Contents