How To Type a Vertical Line | Every Shortcut That Works

The vertical bar symbol is usually typed with Shift plus the backslash key, though the exact shortcut changes by keyboard and device.

The vertical line, also called the vertical bar or pipe symbol, looks simple: |. Yet it trips people up all the time. The mark may share a key with the backslash, hide behind a different keyboard layout, or need a character viewer when the keyboard in front of you doesn’t match the one on screen.

If you’re trying to type it for coding, spreadsheets, command lines, or plain text, the fix is usually small. You just need the right shortcut for your setup. Once you know where the symbol lives on your keyboard, the problem tends to disappear for good.

What The Vertical Line Is And Why People Miss It

The vertical line is the straight symbol used in programming, search commands, markup, and plain text. Many people call it a pipe. On most English keyboards, it shares a key with the backslash. That pairing is the whole reason it gets missed. You might be looking for a stand-alone key when there isn’t one.

The trouble gets worse when:

  • your laptop keyboard is compact
  • your physical keyboard doesn’t match the selected layout
  • you’re on a Mac or Chromebook and expect Windows behavior
  • the symbol sits near Enter on one keyboard but near Shift on another

Once you know that the symbol is layout-dependent, the hunt gets easier. You stop asking, “Where did it go?” and start checking the right place.

How To Type a Vertical Line On Windows, Mac, And Chromebook

On a standard US keyboard, the usual move is Shift + \. That key often sits above Enter or near the backspace area, based on the board you’re using. If you have a full-size Windows keyboard with a numeric keypad, an Alt code can also work in some apps.

Windows

Start with the normal key combo: Shift + \. If that fails, look at your keyboard language. A UK, European, or custom layout can move the symbol. On some boards, the pipe has its own key. On others, it shares a key near the left Shift or Enter area.

If you’re working in Microsoft Word or another app that accepts character codes, Microsoft notes that some symbols can be inserted with a numeric code or with Unicode in Word. Their page on ASCII or Unicode character codes in Word is handy when the printed key isn’t helping.

Windows Tips That Solve Most Problems

  • Turn on Num Lock before trying a numeric keypad code.
  • Check whether your app accepts Alt codes at all.
  • Match the selected keyboard language to the keyboard in front of you.
  • Try the on-screen keyboard if you can’t spot the symbol physically.

Mac

On many Mac keyboards using a US layout, the vertical line is also typed with Shift + \. If that doesn’t work, the chosen input source is the first thing to check. Mac keyboards switch behavior the moment the input source changes, so one layout can place the symbol in a spot that feels odd on another.

Apple also gives you a fallback: the character viewer. If you can’t find the mark on the keyboard, open the character panel and insert it from there. Apple shows that path in its page on special characters on Mac.

Mac Habits That Save Time

  • Check Input Source in keyboard settings when symbols don’t match the printed keys.
  • Use the character viewer when you’re on an unfamiliar layout.
  • Test the symbol in TextEdit first if a single app behaves oddly.

Chromebook

Chromebooks can type the symbol with the same Shift + \ move on many English layouts. Trouble starts when the input method changes or when you use an international keyboard. Google’s page on keyboard language and special characters explains how input methods affect what appears when you press a key.

If the pipe won’t appear, switch back to the expected input method, then test the key beside Enter or the key near left Shift. On some Chromebook layouts, that’s where the symbol lands.

Device Or Setup Most Common Way To Type It What To Check If It Fails
Windows, US keyboard Shift + \ Keyboard layout, app behavior, on-screen keyboard
Windows with numeric keypad Shift + \ or app-specific code entry Num Lock, numeric keypad, app accepts codes
Mac, US layout Shift + \ Input source, app-specific behavior
Mac with alternate layout Layout-dependent Character viewer, input source menu
Chromebook, US layout Shift + \ Input method, physical key position
UK keyboard Often near left Shift or Enter Selected language matches printed board
External keyboard on laptop Depends on keyboard layout, not laptop brand OS input language and keyboard map
Remote desktop or virtual machine Depends on host and guest layout Layout on both systems, app remapping

Where The Key Usually Sits On Different Keyboards

If you’re staring at the keys and still can’t find it, this part clears up the layout puzzle. The vertical line often appears in one of two places:

  • on the same key as backslash, near Enter
  • on a dedicated key near left Shift on some non-US layouts

That’s why advice from one person may fail on your machine. They may be right for their keyboard and wrong for yours. The physical board and the active software layout need to match.

Why Laptop Keyboards Cause More Confusion

Compact keyboards squeeze symbols into tighter spaces. Some manufacturers shrink labels. Some boards place a long Enter key over the area where the backslash-and-pipe key sits on another layout. That makes the symbol feel hidden when it’s only moved.

If you use an external keyboard with a laptop, trust the keyboard’s printed layout first, then make the system match it. That one step fixes a lot of “wrong symbol” headaches.

Typing A Vertical Bar In Word, Google Docs, Excel, And Code Editors

The symbol itself doesn’t change across apps, but the fallback does. In plain text editors and code editors, the standard keyboard combo is the best route. In Word, code-based entry can help when the key mapping is broken. In browser-based apps, the selected system layout has more sway than the app itself.

Word And Office Apps

If the key combo fails in Word, try the keyboard layout first. After that, use Word’s character insertion options. That’s where Microsoft’s code-entry page can save time. It’s less about memorizing a code and more about knowing there’s another door when the main one sticks.

Google Docs And Browser Apps

In Docs, Gmail, or Sheets, the browser usually follows the system keyboard layout. If the wrong symbol appears, the browser isn’t usually the root of the mess. The input method or OS layout is. Fix that, reload the page, and test the key again.

Code Editors And Terminals

In coding, the pipe symbol shows up in shell commands, logical operations, pattern matching, and markup. If you type it often, it’s worth learning the physical key by touch. Copy and paste works in a pinch, but it slows you down and turns a one-key action into a chore.

Problem Likely Cause Best Fix
Nothing appears Wrong key or inactive field Click in a text field and try Shift + \ again
Backslash appears instead of pipe Shift not held or sticky key issue Press and hold Shift, then tap the key once
Wrong symbol appears Keyboard layout mismatch Switch input language to the matching layout
Alt code fails No numeric keypad or app ignores code Use the regular key combo or character panel
Works in one app, not another App-specific handling Test in plain text, then use the app’s insert-symbol tool

What To Do When No Shortcut Seems To Work

If every shortcut fails, don’t keep mashing keys. Run through a short check instead:

  1. Open a plain text box, like Notepad or TextEdit.
  2. Try Shift + \.
  3. Check the active keyboard language or input source.
  4. Compare the printed keyboard to the selected layout.
  5. Use the character viewer or symbol insertion tool if needed.

That order matters. It separates keyboard trouble from app trouble. If the symbol appears in a plain text app but not in one site or program, the keyboard is fine. The app is the one acting up.

A Good Fallback When You Need The Symbol Right Now

If you’re in the middle of work and need one vertical line this second, copy this: |

Then fix the layout after the urgent task is done. That keeps you moving without turning a small snag into a long detour.

Best Way To Remember It

Think of the vertical line as the backslash key’s shifted partner. On many keyboards, they live together. If you remember that pair, you’ll find the symbol faster the next time you need it.

For most people, the lasting answer is short:

  • US keyboard: Shift + \
  • Other layouts: check the key near Enter or left Shift
  • Mac or Chromebook mismatch: check input source first

Once that clicks, typing the pipe symbol stops feeling hidden and starts feeling ordinary.

References & Sources