Pipe Symbol (|): How to Type the Vertical Bar

Igor R.

August 1, 2026

Short answer: Press *Shift + * — the backslash key, above Enter on a US keyboard or beside the left Shift on a UK one. On Windows you can also hold Alt and type 124 on the numeric keypad. Make sure you get the solid pipe |, not the broken bar ¦.

The pipe is one of many special keys — see the full set with names in the keyboard symbols guide, or grab any character from the Alt Code Finder.

The pipe, | (also called the vertical bar or vertical line), is a small key with big jobs — it powers the command line, appears all over code, and marks absolute value in maths. It also has a near-twin that causes real bugs, so let’s start there.

| vs ¦ — pipe vs broken bar

There are two similar characters:

  • | — the vertical line / pipe (U+007C): a solid, unbroken stroke. This is the one shells and code expect.
  • ¦ — the broken bar (U+00A6): a vertical bar with a small gap in the middle.

The mix-up is a hangover from old hardware — some early terminals and IBM PCs drew the pipe’s code point with a gap, and a few keyboards (especially older UK ones) still print ¦ on the key even though it types a solid |. For anything technical, you want the solid pipe; a stray broken bar dropped into a shell script produces mysterious syntax errors. If your pipe looks broken, that’s usually just the font — but to be safe, copy the solid | above.

The pipe on the backslash key, and the solid pipe compared with the broken bar

Quick reference

ItemValue
Windows / Mac*Shift + * (backslash key)
Windows Alt codeAlt + 124
Word007C then Alt + X
HTML| / | / |
UnicodeU+007C (VERTICAL LINE)

Type | on Windows

  • *Shift + * — the backslash key, above Enter on a US layout, or beside the left Shift (next to Z) on a UK layout.
  • Alt code: hold Alt, type 124 on the numeric keypad (Num Lock on), release.
  • Word: type 007C and press Alt + X; or use Character Map (search “vertical line”).

Type | on Mac

Press *Shift + * — the same as Windows on standard layouts. If you’ve enabled Unicode Hex Input, Option + 007C also works; otherwise the Character Viewer lists it under “vertical line” (searching “pipe” won’t find it).

The pipe in code and the command line

This is where the pipe earns its name:

  • Shell pipescommand1 | command2 sends the first program’s output into the second (ls | grep report). Chaining tools this way is a foundation of Unix-like systems.
  • OR operators — a double pipe || is logical OR (a || b is true if either side is), while a single | is bitwise OR. In shells, || also runs the second command only if the first fails.
  • Regex alternationcat|dog matches either word.
  • Markdown tables — pipes separate columns: | Name | Age |.
  • TypeScript union typesstring | number means “either type.”

The pipe in maths

  • Absolute value|x| is the size of x regardless of sign.
  • “Such that” — in set-builder notation, { x | x > 0 } reads “x such that x > 0.”
  • Norms — the double bar ‖x‖ (U+2016) denotes a vector’s length.
  • Divides — a related symbol, ∣ (U+2223), means “a divides b.”

Type | on Linux, ChromeOS & phone

  • Linux / ChromeOS: **Shift + **; or Ctrl + Shift + U, type 007c, Enter.
  • Phone: tap the 123 / symbols key — | is on the symbols page (sometimes the second one).

What the pipe symbol means

The vertical bar has many names — pipe, vertical line, bar, “or,” and (in logic) the Sheffer stroke. Its most famous role, “piping” one command’s output into another, comes from Unix pipes, introduced by Doug McIlroy in the 1970s, and the “pipe” name stuck for the character itself.

Troubleshooting

ProblemFix
My pipe has a gap (¦)Either it’s the broken bar (U+00A6) or a font drawing
Shell script throws a syntax errorYou may have a broken bar or a look-alike — retype with Shift + \ or paste the solid
Shift + \ types something elseWrong layout — check Settings (Windows) or System Settings (Mac).
No backslash key on my compact keyboardUse Alt + 124, or copy

Recap

  • Type it → Shift + \ (backslash key); Alt + 124 on Windows.
  • Solid | vs broken ¦ → use the solid pipe for code and shells.
  • Code → shell pipe, || logical / | bitwise OR, regex, Markdown. Maths → absolute value, “such that.”

Frequently asked questions

How do I type the pipe symbol (|)?

Press Shift + \ — the backslash key, which sits above Enter on a US keyboard and beside the left Shift on a UK one. On Windows you can also hold Alt and type 124 on the numeric keypad, or copy the pipe from this page.

What’s the difference between | and ¦?

The pipe | (U+007C) is a solid, unbroken vertical line — the character shells and code expect. The broken bar ¦ (U+00A6) has a small gap in the middle. Some older keyboards print ¦ on the key even though it types a solid |. For anything technical, use the solid pipe; a broken bar can cause syntax errors.

What is the pipe symbol used for?

On the command line, the pipe sends one program’s output into another (command1 | command2). In code it’s the OR operator — || for logical OR, | for bitwise OR — plus regex alternation and TypeScript union types. In Markdown it separates table columns, and in maths it marks absolute value and “such that.”

What’s the difference between | and ||?

A single pipe | is usually the bitwise OR operator, which combines numbers bit by bit. A double pipe || is the logical OR in languages like C, Java and JavaScript, so a || b is true if either side is true — and it short-circuits, skipping the right side when the left is already true.

Where is the pipe key on the keyboard?

The pipe shares the backslash key. On a US layout that key is above the Enter key; on a UK layout it’s next to the left Shift key. Either way, hold Shift and press it to get the pipe.

Why does my pipe look broken (¦)?

Either you’ve typed the broken bar character (U+00A6) instead of the pipe, or your font simply draws the pipe with a gap. Copy the solid pipe | from this page, or switch to a coding font that renders it as a continuous line.

Written by Igor R.. Tested on Windows 11, macOS and US, UK keyboard layouts. Symbol code points follow the Unicode Standard. Last updated July 2026.

Leave a Comment