Why the backslash moves

The physical keyboard and the selected input source can differ. That means the same key can produce another character when you switch language or keyboard layout.

Find the correct key on your Mac

Open System Settings → Keyboard → Text Input and use Keyboard Viewer. Hold Shift or Option if needed; the on-screen keyboard updates so you can see exactly where \ is on your active layout.

Backslash is not the same as slash

A backslash is \. A normal slash is /. They are different characters and can have different meanings in paths, code and command-line tools.

Copy a backslash

Need it once? Copy it here: \

Frequently asked questions

Why is the backslash in a different place on my Mac?

Keyboard layouts assign symbols differently. The active input source can also differ from the labels printed on your keys.

How can I be sure which shortcut works?

Use Keyboard Viewer. It shows the characters produced by your current input source instead of relying on a shortcut for another layout.

Is a backslash the same as a slash?

No. Backslash is \ and slash is /. They are separate characters.