The @ key types < (or the other way round) on a Mac
Two keys swapped on an ISO Mac keyboard: the cause is almost always the keyboard type macOS detected.
The symptom
On a Mac with a French, Belgian, Swiss or Spanish keyboard, the key that should type At sign @ types <, and the < key types @. Every other key works normally.
The cause
European keyboards use the ISO format: they have one more key than US (ANSI) keyboards, next to the left Shift. If macOS thinks your keyboard is ANSI, it swaps that key with the one below Escape. This is common with external keyboards, especially non-Apple ones.
The fix
- Connect the affected keyboard, then open System Settings › Keyboard.
- Click Change Keyboard Type… (the button appears when an external keyboard is connected).
- Follow the assistant: press the keys it asks for, then choose ISO (European).
- Test again: the two keys should now be in the right place.
Still not working?
- Check the active input source in the menu bar: a US or “ABC” layout also moves the at sign. See My Mac types with the wrong keyboard layout.
- With a PC keyboard, see Where is the AltGr key on a Mac?.