Skip to content

Découvertes Jeunesse

The blogs we liked

How to Type a Vertical Bar on Keyboard: Simple Tips and Handy Shortcuts

The vertical bar, or pipe (U+007C, VERTICAL LINE), remains one of the most used characters in command lines, regular expressions, and in…

Femme tapant une barre verticale sur un clavier d'ordinateur portable dans un bureau à domicile

The vertical bar, or pipe (U+007C, VERTICAL LINE), remains one of the most frequently used characters in command lines, regular expressions, and filtering syntaxes. However, its physical position on the keyboard varies from one layout to another, and alternative input methods are often poorly documented.

Hexadecimal input and Windows symbol panel: the overlooked methods

Most guides are limited to the direct key combination. Two other paths deserve the attention of users working on exotic keyboards or laptops without a numeric keypad.

Hexadecimal conversion in Word and Office applications works like this: type 007C and then press Alt + X. The code transforms into a pipe. This method is distinct from the classic Alt + 124 (decimal code) and does not depend on the keyboard layout or the numeric keypad.

Windows also includes a native symbol panel, accessible via Windows + . or Windows + ;. The symbols tab offers the vertical bar among the special characters. We recommend this approach on ultrabooks and compact keyboards where the physical numeric keypad is absent. To delve deeper into the keyboard vertical bar shortcuts, these two alternatives effectively complement the classic combinations.

Man using a keyboard shortcut to type a vertical bar at a workstation in an open space

Vertical bar on AZERTY, QWERTY, and French Mac keyboards: precise mappings

Each layout maps the pipe to a different key. The table below summarizes the verified combinations.

Layout Combination Note
AZERTY Windows Alt Gr + 6 Key 6 of the top row (printing 6-|)
French Mac Option + 7 On US layout: Shift +
Standard QWERTY Shift + Key located above Enter
Windows (numeric keypad) Alt + 124 Num Lock enabled, numbers from the keypad only

On an AZERTY keyboard, the physical key bears the printing “6” and the symbol “|”. The combination Alt Gr + 6 directly produces the character. On a French Mac, the logic differs: Option + 7 generates the pipe, which may be surprising since the key 7 does not have any visual indication of the symbol.

Common pitfall with Alt + 124

The Alt + 124 code only works with the physical numeric keypad. The numbers from the top row of the keyboard do not trigger the insertion of the character. On a laptop without a dedicated keypad, you need to activate the virtual numeric keypad (Windows visual keyboard) or switch to the hexadecimal method described above.

Pipe, broken bar, and backslash: distinguishing visually similar characters

The confusion between the pipe and nearby characters regularly causes syntax errors in scripts and shell commands.

  • Vertical bar | (U+007C): pipe character used for chaining Unix commands, regular expressions (alternation), and CSV separators.
  • Broken vertical bar ¦ (U+00A6): distinct character, inherited from EBCDIC encoding. It has no function in a modern terminal and should never replace the pipe.
  • Backslash (U+005C): directory separator in Windows, escape character in most languages. Visually slanted, but confusion arises in some low-resolution renders.

A quick way to check which character has been entered: paste the symbol into an editor capable of displaying the Unicode code point. If the result is not U+007C, the character is not a valid pipe.

Compose key in Linux: an approach absent from mainstream guides

Linux distributions offer a mechanism rarely mentioned in French tutorials. The Compose key allows you to generate the pipe without memorizing a numeric code.

The principle: activate the Compose key in the keyboard settings (often assigned to Caps Lock or the Menu key), then type the dedicated sequence for the pipe. This method is particularly useful on exotic layouts (bépo, Colemak) where the position of the pipe is not intuitive.

Variant for environments without a graphical interface

In TTY console, the Compose key is not always available. We then recommend direct Unicode input: Ctrl + Shift + U, then 7C, then Enter.

Close-up of hands pressing keyboard keys to enter a vertical bar with a tablet displaying the symbol

Pipe character on mobile and tablet: virtual keyboard and manual insertion

On both Android and iOS, the pipe is relegated to the secondary symbol pages of the virtual keyboard. You generally need to switch to the special characters view, then access a sub-page often identified by a button “=<” or “#+=”.

Gboard and the Apple keyboard place the pipe in different locations depending on the configured language. On a French keyboard, the symbol is found on the second page of special characters. On an English keyboard, it appears on the first page of symbols.

For recurring use (such as server administration from a tablet), setting up a text replacement shortcut remains the most reliable solution. On iOS: Settings, General, Keyboard, Text Replacement. On Android (Gboard): Settings, Dictionary, Personal Dictionary.

The code point U+007C remains the universal reference for identifying and inserting the vertical bar, regardless of the operating system or keyboard layout. Knowing the alternative methods (hexadecimal conversion, symbol panel, Compose key) avoids reliance on a single physical combination that may vary from one keyboard to another.

How to Type a Vertical Bar on Keyboard: Simple Tips and Handy Shortcuts