|
Vertical bar
PrintableASCII 124 | Hex 0x7C | U+007C
Vertical bar (ASCII 124) serves as the pipe operator in Unix shells, sending the output of one command as input to the next (ls | grep txt). This pipe mechanism, introduced in Unix Version 3 (1973) by Ken Thompson following Douglas McIlroy's suggestion, became one of Unix's most influential design features. In C and most derived languages, || is the logical OR operator and | is bitwise OR. In regular expressions, | separates alternatives (cat|dog matches either word).
ASCII Code
Decimal
124
Hexadecimal
0x7C
Octal
174
Binary
0111 1100
URL Escape
%7C
Unicode
Code Point
U+007C
Escape
\u007c
UTF-8 Hex
0x7C
UTF-8 Binary
01111100
UTF-16
0x007C
UTF-32
0x0000007C
HTML Entities
Numeric
|
Hex
|
Named
|
How to Type
Windows Alt CodeAlt + 124
HTML Entity
|
Unicode InputU+007C
Source Code Representations
C / Java
"\u007C"CSS
\007CJavaScript
"\u007C"Perl
\x{007C}Python 2
u"\u007C"Python 3
\u007CRuby
\u{007C}Frequently Asked Questions
What is ASCII code 124?
ASCII code 124 represents the Vertical bar character. In hexadecimal it is 0x7C, in binary 0111 1100, and in octal 174. It is a printable character that appears as "|" in text.
How do I type ASCII 124 on a keyboard?
On Windows, hold Alt and type 124 on the numeric keypad. On Mac, you can use the Character Viewer (Edit > Emoji & Symbols). In HTML, use the entity | or |.