Skip to main content
    Tech & Gadgets

    How Do I Type the Backslash Symbol on Any Keyboard?

    Mark Debson

    Mark Debson

    Author

    How Do I Type the Backslash Symbol on Any Keyboard?Save

    Quick Answer

    On a US keyboard, the backslash sits directly above the Enter key, just under Backspace. Press it on its own to type \, or hold Shift to get the pipe character.

    On a UK or ISO keyboard, the backslash moves to the small key between the left Shift and the letter Z. If your keyboard has no backslash key at all, hold Alt and type 92 on the numeric keypad.

    Backslash versus forward slash

    The two slashes are not interchangeable. The forward slash (/) leans to the right and is used in web URLs, dates, and division. The backslash (\) leans to the left and is used in Windows file paths, escape sequences in code, and regex syntax.

    Confusing them is the single most common cause of broken Windows file paths and broken regex patterns, so it is worth getting the visual difference into muscle memory.

    The fast reference table

    • US ANSI keyboard: the dedicated key above Enter
    • UK ISO keyboard: the small key between left Shift and Z
    • German QWERTZ: AltGr + ß (the sharp s key)
    • French AZERTY: AltGr + 8 or AltGr + ù depending on model
    • Spanish: AltGr + the key with º at the top left
    • Mac US: the dedicated key above Return
    • Mac UK: Option + Shift + 7 or Option + the section key
    • Windows Alt code: Alt + 92 on the numeric keypad
    • Linux or Chromebook: Ctrl + Shift + U, type 005c, press Enter

    Finding the backslash on a US keyboard

    The US ANSI layout puts the backslash on a dedicated key. It is the tall thin key directly above the wide horizontal Enter key, and right under the Backspace key. Press it once for \, or hold Shift for the pipe character (|).

    On compact 60 percent and 65 percent mechanical keyboards, manufacturers sometimes shrink this key or move it to a layered position. Check your layout map if the press does nothing.

    Finding the backslash on a UK and European keyboard

    UK and Irish keyboards use the ISO layout, which has a different Enter key shape. The Enter key is tall and L shaped, which steals the space that the US backslash normally occupies. The backslash moves to a small key between the left Shift key and the letter Z.

    German QWERTZ

    Hold AltGr (the right side Alt) and press the ß key. The combination produces a backslash on every standard German Windows and Linux install.

    French AZERTY

    The exact combo depends on whether you use the older AZERTY layout or the newer French standard (NF Z71-300). On older boards, AltGr + 8 works. On newer ones, AltGr + the ù key produces the slash.

    Spanish and Latin American

    Press AltGr + the key with the masculine ordinal sign (º) at the top left of the alphabet block.

    The backslash on a Mac

    Apple keeps the backslash above the Return key on US Macs, exactly where US Windows users expect to find it. On UK and Irish Macs, the key is reassigned to the section sign (§), and the backslash moves into the Option layer.

    • US Mac: press the key above Return.
    • UK Mac: press Option + Shift + 7, or Option + the section key in the top left.

    When the key does not exist

    Compact keyboards, tenkeyless mechanical boards, and travel laptops sometimes drop the backslash entirely. Three workarounds cover every case.

    Windows Alt code

    • Make sure Num Lock is on.
    • Hold the left Alt key.
    • Type 92 on the numeric keypad.
    • Release Alt.

    Universal Unicode entry on Linux and Chromebook

    Press Ctrl + Shift + U, type 005c, then press Enter or Spacebar.

    Mac Character Viewer

    Press Control + Command + Spacebar, search for "reverse solidus" (the official Unicode name for the backslash), then double click to insert.

    Backslashes in code and command lines

    The backslash is the escape character in most programming languages, which means you often need to type two in a row to represent a single backslash. \\ in a JavaScript or Python string becomes a single \ when printed.

    In Windows PowerShell and Command Prompt, backslashes separate folders. C:\Users\Alice is a valid path. On macOS and Linux, the same path uses forward slashes (/Users/Alice).

    Regex engines treat the backslash as the start of a special sequence. \d matches a digit, \s matches whitespace, and \\ matches a literal backslash.

    Troubleshooting

    Shift plus my backslash key gives a hash instead of a pipe

    Your Windows layout is set to UK while your keycaps are US, or vice versa. Press Windows + Spacebar to cycle layouts until the Shift result matches your physical key.

    My backslash inserts a Yen sign on a Japanese laptop

    Japanese keyboards display the Yen mark (¥) on the same Unicode point as the backslash. Most apps still treat it as a backslash internally. If a file path actually breaks, copy paste a real backslash from another document.

    FAQs

    What is the official Unicode name for the backslash?

    Reverse solidus, code point U+005C. The forward slash is officially called solidus.

    Why do Windows paths use backslashes?

    MS DOS originally used the forward slash for command line switches (like dir /w), so when the file system needed a separator, Microsoft picked the backslash to avoid clashes. Decades later, the choice is still baked into every Windows API.

    The takeaway

    The backslash hides in a different spot on every regional layout, but once you know where it lives on your daily keyboard the typing is muscle memory. Save the table above for the rare times you sit down at someone else's machine.

    My typing & keyboard picks

    Tap any card to check today's price.

    Mark Debson

    Written by

    Mark Debson

    I'm Mark Debson, the writer behind dmbio. I spend my days digging into the science behind everyday products, brands and habits, then translating what I find into clear answers you can read in about five minutes.

    Drafted with AI assistance, fully reviewed and edited before publishing. See our editorial & AI policy.

    Related reads