|
| Vertical Bar
The vertical bar (|), also called the pipe, encloses absolute values in math, means “such that” in set notation, and pipes commands in a shell.
Also known as: vertical bar, pipe symbol, absolute value bars, vertical line.
Codes
| Symbol | | | |
| Unicode | U+007C | |
| HTML entity (named) | | | |
| HTML entity (decimal) | | | |
| HTML entity (hex) | | | |
| CSS | \007C | |
| LaTeX | \mid | |
| Windows Alt code | Alt + 124 |
How to type | (Vertical Bar)
WindowsShift + \
Press Shift and the backslash key (above Enter on a US keyboard).
Mac⇧ + \
Press Shift and the backslash key.
Microsoft WordShift + \
Press Shift + backslash.
Google DocsShift + \
Press Shift + backslash.
LaTeX\mid
Use |x| for absolute value. Prefer \mid for a relation (“divides”, or “given”), since it carries the correct spacing: P(A \mid B). \| gives the double bar ‖ used for norms.
Usage
- Absolute value: |x| is the distance of x from zero, so |−3| = 3.
- Set-builder notation: { x | x > 0 } reads “the set of x such that x is greater than 0”. In probability, P(A|B) is the probability of A given B.
- In a shell, | pipes one command's output into the next: ls | grep txt. In most programming languages, | is bitwise OR and || is logical OR.
- Which bar to use: | (U+007C) is the one on your keyboard. ¦ (U+00A6, broken bar) is a separate character that some old fonts and terminals used to render in its place — it is not interchangeable. ‖ (U+2016, double vertical line) is the norm bar, as in ‖v‖.