We are trying to type a pipe in a terminal, to separate two columns in a CSV file, or to write a condition in a script, and the symbol refuses to display. The problem almost never comes from a broken key. The vertical bar, the straight line denoted as |, primarily depends on the active software layout on the machine, not on what is engraved on the physical key.
Keyboard Software Layout: The Real Cause When the Pipe Doesn’t Display
Most guides simply list shortcuts by system. We start from the other end, because that’s where the blockages actually occur.
On Windows, the shortcut Windows + Space toggles between installed keyboard layouts. If a second language or variant (US English, German QWERTZ) is active, the usual combination Alt Gr + 6 no longer produces the correct character. The reflex: check the language indicator in the taskbar before concluding there is a hardware malfunction.
Since Windows 11 version 24H2, two AZERTY layouts coexist: “French (legacy, AZERTY)” and the new AFNOR standard. On the latter, the location of the pipe changes. The same physical keyboard can therefore produce different results from one workstation to another depending on the configured layout.
When working on a fleet of machines in a company or switching from a personal laptop to a shared workstation, this is the first thing to check. Feedback varies on this point, but in the majority of cases reported as “key not working,” the software layout is to blame.
For those who want to insert a vertical bar on the keyboard without fumbling, identifying the active layout remains the prerequisite for any shortcut.
Vertical Bar Shortcut on AZERTY Windows, Mac, and QWERTY
Here are the specific combinations according to the environment, starting with the most common case.

- AZERTY Windows (legacy layout): hold down Alt Gr, then press the 6 key on the top row (the one marked with the dash and the printed pipe). The symbol | is inserted directly.
- French Mac: the combination is Option (⌥) + 7. On a Mac configured with a US layout, use Shift + instead.
- QWERTY (US/UK English): Shift + produces the pipe. The key is usually located above the Enter key.
- Alt Code (Windows numeric keypad): hold down Alt, type 124 on the numeric keypad with Num Lock enabled, then release Alt. This method is useful on keyboards where Alt Gr is absent or remapped.
On a laptop without a dedicated numeric keypad, the Alt code requires activating the Fn function to simulate the keypad. In practice, this is unreliable depending on the models. It’s better to use Alt Gr + 6 or correct the layout.
Special Case of Linux
On Linux, a fallback method exists regardless of the layout: Ctrl + Shift + U, then type 7C, then Enter. This gives the Unicode character U+007C, the standard vertical bar. This sequence works in most desktop environments (GNOME, KDE) and helps when Alt Gr is reserved for another function by a custom remapping.
ASCII Pipe and Full Vertical Bar: Do Not Confuse Unicode Characters
You copy a | from a web page, paste it into a script, and the command fails. The character visually resembles the pipe, but its Unicode code is different.
The vertical bar used in programming and terminals corresponds to Unicode code U+007C (ASCII 124). There is another character, the full vertical bar (U+2502 or U+2758 depending on the variants), used in drawing tables or certain typographic documents. Both look similar on the screen, but a command interpreter or compiler does not treat them the same way at all.

| Character | Unicode | Usage |
|---|---|---|
| | | U+007C | Pipe, logical operator, CSV separator |
| │ | U+2502 | Box drawing, text tables |
| ❘ | U+2758 | Typographic ornament |
The trap mainly occurs when copying and pasting from a PDF, a Word document, or a poorly encoded page. To check, paste the character into a plain text editor and display its hexadecimal code (in Notepad++: Encoding menu, or via the xxd command in Linux). If the code is not 7C, you have the wrong character.
Keyboard Shortcut Not Working: Quick Diagnosis
When Alt Gr + 6 produces nothing or displays another symbol, check these points in order:
- The active layout (Windows + Space or indicator in the taskbar). Switch to “French (France) – AZERTY” legacy if necessary.
- Num Lock (Verr Num) for the Alt + 124 method. Without an active numeric keypad, the sequence yields nothing.
- A remapping software (AutoHotkey, SharpKeys, Karabiner on Mac) that intercepts the Alt Gr key or the 6 key. Temporarily disable to test.
- On Mac, check the input source in System Preferences (Keyboard section). An “ABC” layout instead of “French” changes all special character shortcuts.
On an external Bluetooth keyboard connected to a Mac, the Alt Gr key does not physically exist. The Option + 7 combination remains the only reliable method, regardless of the external keyboard model.
The symbol | always ends up displaying once the correct layout is identified. Before seeking an alternative shortcut or installing a third-party tool, a simple check of the keyboard layout resolves the vast majority of blockages.



