Food

What Is a Pipe Character? Meaning and Examples

By Hayride Live · Updated · 4 min read

When you see a command like cat log.txt | grep error, the vertical bar between the two commands is the pipe character. It is the straight vertical line |, also called the vertical bar, pipe, or bar, and it sits above the backslash key on a standard US keyboard. In plain terms, a pipe character is a single keyboard symbol used to separate, connect, or divide things in text, code, and data.

The Pipe Character Is the Vertical Bar Symbol

The pipe character is a single glyph: a thin vertical line, taller than a hyphen and narrower than a capital I in most fonts. Its Unicode code point is U+007C, and in ASCII it is decimal 124 or hexadecimal 7C. On a US keyboard you type it by holding Shift and pressing the backslash key, which sits just above the Enter key. On many UK and European layouts the pipe sits on a different key, often near the Z or the left Shift, so the exact location depends on the keyboard layout.

Do not confuse the pipe with similar-looking characters. A capital I, a lowercase l, and the numeral 1 can look close in some fonts, but the pipe is a distinct character with its own code. In monospaced fonts the pipe is usually drawn as a continuous vertical stroke, while in proportional fonts it may be shorter. If you need to check which character you have, paste it into a plain text editor and compare its width and shape against a known pipe.

What the Pipe Does in Commands and Code

In a command line, the pipe sends the output of one program into the input of another. The command ls | wc -l lists files and then counts the lines, so the pipe connects two separate tools into one chain. This is called piping, and it works in Unix-like shells, Windows PowerShell, and many other command environments. The pipe is also a logical OR operator in many programming languages: a || b means a or b, and a single pipe often means bitwise OR. In regular expressions a pipe means alternation, so cat|dog matches either word.

In data files, the pipe is a common field separator because it rarely appears inside ordinary text. A file with lines like Smith|Jane|42 is pipe-delimited, and spreadsheet and database import tools can split on that character. In markup and wikis, double pipes || often build table cells, and a single pipe can separate a link from its label. The exact meaning always comes from the context: shell, code, regex, or data format.

Pipe vs. Other Separators: When to Use Each

Use a pipe when commas, tabs, or spaces would collide with the content. A comma-separated file breaks if a field contains a comma, while a pipe-delimited file stays readable as long as the data itself has no pipe. Tabs are invisible and easy to lose when text is copied, whereas a pipe is visible and survives most copy-paste operations. For command chains, the pipe is the standard connector and has no practical substitute.

Do not use a pipe where a comma or semicolon is expected by a tool. Many CSV importers treat a pipe as ordinary text, not a delimiter, so check the import settings before uploading. In prose, avoid the pipe as a substitute for the word or; write it out. In filenames, the pipe is allowed on most systems but can cause trouble in shell commands because the shell reads it as an operator, so quote the filename or rename it.

Typing, Copying, and Checking a Pipe Character

To type a pipe on a US keyboard, press Shift and the backslash key. On a Mac with a US layout the same combination works. If your keyboard layout does not produce a pipe, use the operating system character viewer or copy the character from a plain text source. In HTML, write | or | to display a pipe without it being read as code. In many word processors, inserting the symbol from the symbol menu is faster than hunting for the key.

To check that a pipe is really a pipe, paste it into a monospaced editor and compare it with a capital I and a lowercase l. If the characters have different widths or shapes, you have the right symbol. If they look identical, switch to a font that distinguishes them, such as a code font. When a command fails with a message about an unexpected token, an invisible or lookalike character is a common cause, so retype the pipe rather than copying it from a formatted document.

Where the Pipe Shows Up in Everyday Writing

Recipes and menus sometimes use a pipe to separate alternatives, as in butter | margarine, meaning either works. Schedules and tables use it to divide columns in plain text, and some note-taking systems use it to separate a title from a tag. In chat and social posts, a single pipe can act as a visual divider between two short phrases. These uses are informal, but they follow the same idea: the pipe marks a boundary without adding a word.

Do not use a pipe in place of a slash when writing fractions or dates; the slash is the standard symbol there. Do not use a pipe in a sentence where a comma or a dash would read more naturally, because many readers will stumble on it. In formal writing, spell out the word or use a standard separator. The pipe is a tool for technical text, data, and code, and it works best when the reader already expects it.

Spotted a mistake? Tell us and we will correct it. How we write and check articles.