How to type Vertical Bar
| is Shift + \ on a US keyboard and Shift on the extra key left of Z on a UK one. Press Shift + \ on a UK keyboard and you get ~ instead, which is the whole of why the key looks wrong: nothing is broken and the layout is simply the other one. Alt + 124 on the numeric keypad produces it on any Windows layout, which is the way in when the keyboard in front of you has no key for it, and | writes it in HTML. Its codepoint is U+007C.
Vertical Line
- Copy it
- Unicode
- U+007C
- Windows
- Alt + 124
| Where | Shortcut | How |
|---|---|---|
| Windows | Alt + 124 | Hold Alt and type the number on the numeric keypad. |
| HTML | | | Paste this into HTML source. |
| Unicode | U+007C | VERTICAL LINE |
Symbols related to Vertical Bar
The Unicode code chart points from | to ¦, and Unicode's confusables table, the one registrars use against spoofed domains, lists Ⅰ as close enough to be mistaken for it, and the rest are filed under line and stroke in CLDR, the keyword list Unicode publishes alongside the names.
Other symbols
| lives in the Basic Latin block (U+0000-U+007F), the original ASCII set: the letters, digits and punctuation printed on a US keyboard. Within Unicode it is classified as Sm, a mathematical symbol. Software may lay it out with the spacing an operator expects.
How to type | in Microsoft Word
In Microsoft Word, type 007c and press Alt + X. Word reads the four characters before the cursor as a hex codepoint and replaces them, and pressing Alt + X again turns | back into 007c, which is the quickest way to check what a character really is.
What Vertical Bar is used for
In mathematical notation | is a fence: it encloses or separates rather than acting on anything, and stretches to the height of what it sits beside. That is the classification unicode-math gives it, and it is what decides how the symbol is set: $\vert$ in LaTeX, in maths mode rather than in a sentence.
Unicode publishes a second list of names for | in CLDR, the keywords its own search data offers rather than the formal name, and they are vertical line, pike, pipe and sheffer. Those words are what somebody looking for this character is liable to type when Vertical Bar is not the name they know it by, and the search on the symbol lists matches them as well as the Unicode name.
What | gets confused with
Unicode's own confusables table, the one used to catch lookalike domain names, groups | with 1 (U+0031, Digit One), I (U+0049, Latin Capital Letter I), l (U+006C, Latin Small Letter L), Ι (U+0399, Greek Capital Letter Iota) and Ⅰ (U+2160, Roman Numeral One). They are separate characters that render close enough to be mistaken for one another, so a search or a string comparison will separate them where your eye will not. If Vertical Bar is not matching where you expect it to, one of these is the usual reason.
What Unicode says about Vertical Bar
The standard recognises | under another name as well: vertical bar, pipe. That is a formal alias, not a nickname, which is why it turns up in other people's documentation for the same codepoint.
Unicode annotates | directly. Against U+007C the code chart carries the note “Used in pairs to indicate absolute value”. It adds: also used as an unpaired separator or as a fence. That is the standard saying what the character is for, rather than an inference from its name.
The code chart points from | to Broken Bar, latin letter dental click (U+01C0), hebrew punctuation paseq (U+05C0), devanagari danda (U+0964), combining long vertical line overlay (U+20D2) and divides (U+2223). These are the characters the standard thinks you might have meant instead, which makes them the ones worth checking when Vertical Bar looks nearly right but not quite.
How Vertical Bar behaves in software
| takes one column in a terminal. It carries no direction of its own, so in a line that mixes English with Arabic or Hebrew it takes the direction of the text around it rather than forcing one.
What people ask about Vertical Bar
How to insert pipe symbol in word?
In Word, type 007c and press Alt+X, which converts the codepoint you just typed into |. Insert › Symbol › More Symbols finds it by its Unicode name, VERTICAL LINE. Google Docs has no Alt+X, so use Alt + 124 there, or Insert › Special characters and search the same name.
Every way to write Vertical Bar
| Form | Value |
|---|---|
| Codepoint | U+007C |
| Decimal | 124 |
| UTF-8 bytes | 7C |
| UTF-16 bytes | 00 7C |
| HTML entity | | |
| HTML numeric | | or | |
| CSS | \007C |
| JavaScript | \u007C |
| Python | \u007C |
| URL-encoded | %7C |
| LaTeX, in maths mode | $\vert$ |
| SVG | 007C.svg · (SIL Open Font License) |
If | needs escaping
| is one byte in ASCII, in UTF-8 and in every code page in common use, so it never arrives corrupted. Its problem is the opposite one: it means something to the software reading it. In HTML it can be written |, in a URL it is %7C, and inside a CSV field, a shell command or a regular expression it has to be quoted or escaped rather than typed plainly. That is also why | is the character people substitute when the one they wanted will not type.