If your Alt and Windows keys are swapped, the keyboard is almost always laid out for a Mac, or it is set to a Mac mode: Apple's Option key acts as Alt and Command acts as the Windows key, and they sit in the opposite order to a PC. Fix it by switching the keyboard to its Windows mode if it has one, or by swapping the two keys in software: PowerToys Keyboard Manager on Windows, or Modifier Keys in System Settings on a Mac.
The fixes below go from least to most invasive. Try the first one before installing anything.
Why the Alt and Windows keys end up swapped
Apple documents how an Apple keyboard maps onto Windows: the Command key (⌘) acts as the Windows logo key, and the left Option key (⌥) acts as the left Alt key. The mapping is correct, but the position is not. The bottom row of an Apple keyboard runs Control, Option, Command, space. A PC keyboard runs Ctrl, Windows, Alt, space. So the key right next to Ctrl is Alt on a Mac layout and Windows on a PC layout. If your muscle memory is a PC one, the keys feel swapped even though each key does what Apple intends.
The same thing happens when you plug a Mac-style external keyboard into a Windows PC, or when a keyboard that supports both systems is set to the wrong one. It is not a Windows bug, and nothing in Windows Settings caused it.
Fix 1: check for a Mac/Windows mode on the keyboard
Many multi-device and compact keyboards have a physical switch or a Fn key combination that changes between Mac and Windows layouts. When the mode changes, the keyboard swaps what the Alt and Windows keycaps send. The method differs by manufacturer, so look in the keyboard's manual or on the vendor's support page for "Windows mode", "Mac mode" or "OS switch". Keycaps are often printed with both labels (Alt and Option, Win and Cmd) for this reason.
If the keyboard has no such setting, go to the software fix.
Fix 2: swap the keys on Windows with PowerToys
PowerToys is Microsoft's free utility set, and its Keyboard Manager lets you remap keys. Install PowerToys, then:
- Open PowerToys Settings and select Keyboard Manager. Make sure it is enabled.
- Select Remap a key, then Add key remapping.
- In the Select column choose Alt. In the To send column choose Win.
- Add a second row: Select = Win, To send = Alt.
- Confirm with OK.
The mapping table looks like this:
| Select | To send |
|---|---|
| Alt | Win |
| Win | Alt |
Two rows are needed for a swap. Microsoft's own example does the same for the A and B keys: A to B, then B to A. If you add only one row, the other key becomes "orphaned", meaning nothing on the keyboard produces it any more, and Keyboard Manager shows a warning. Adding the second row clears the warning.
Per Microsoft's documentation, remapping takes effect immediately after you confirm, with no restart. You can also select the key by pressing it, instead of using the drop-down: choose Select, then press the physical key in the dialog that opens.
Limits to know about
- PowerToys must keep running in the background. If you close it, the keys revert.
- Keyboard Manager does not work on the sign-in screen or any password screen, including Run as administrator prompts.
- If a window runs elevated (as administrator) and PowerToys does not, the remap will not apply in that window. Run PowerToys as administrator to cover it.
- Microsoft lists Win+L and Ctrl+Alt+Del as reserved by Windows, so they cannot be remapped.
- Microsoft's known issues list says remapping Win, Ctrl, Alt or Shift may break gestures and some special keys.
- Microsoft also lists AltGr as a problem: AltGr behaves as left Ctrl plus right Alt, so remapping one of those keys can break it. If you type with AltGr, test it after remapping.
- Remaps apply to every keyboard attached. Microsoft says it knows of no API to tell which device a key press came from, so you cannot remap only the external keyboard on a laptop.
That last point matters if you use a laptop with its own PC layout and a Mac-style keyboard on the desk: swapping the keys fixes the external keyboard and breaks the built-in one. In that case, prefer Fix 1, or swap the keycaps if the keyboard allows it.
Fix 3: swap the keys on a Mac
If the keyboard is a Windows keyboard plugged into a Mac, macOS has its own setting for modifier keys. From Apple's instructions:
- Open the Apple menu, then System Settings.
- Select Keyboard in the sidebar, scrolling down if you do not see it.
- Select Keyboard Shortcuts, then Modifier Keys.
- For each modifier, open its pop-up menu and choose the action it should perform. Set the Option key to Command and the Command key to Option to swap them.
Restore Defaults in the same pane undoes the change. Apple's page does not describe how Windows keyboard keys map to Command and Option, so check which modifier each key currently triggers before you swap them. Press the key in an app that shows shortcuts in its menus, such as a Finder menu with a Command shortcut.
Fix 4: swap it back in Boot Camp or a Windows install on a Mac
On an older Intel Mac running Windows through Boot Camp, the built-in mapping above applies: Command is the Windows key and Option is Alt. The simplest fix there is the PowerToys method in Fix 2, since the Windows side sees an ordinary keyboard. Apple's article also notes that Apple keyboards have no Applications (menu) key, and that Right Alt (AltGr) is produced by pressing Option plus Control.
Check that the swap worked
Test with shortcuts that depend on each key:
- Windows key: press it alone. The Start menu should open.
- Alt: hold it and press Tab. The task switcher should appear.
If the Start menu opens when you press the key you now think of as Alt, the remap did not apply. Check that PowerToys is running, and that both rows exist in the remapping list. For a refresher on what each key combination does, see Hot Keys on Keyboard: Essential Windows and Mac Shortcuts.
If it still fails
If nothing changes after a remap, the first suspects are PowerToys not running, or the window you are testing running as administrator. Disable and re-enable Keyboard Manager in PowerToys Settings: Microsoft says other programs that hook the keyboard can interfere, and toggling it fixes that. If one specific game ignores the swap, that is expected: Microsoft notes that certain keyboard APIs do not work with Keyboard Manager and advises not using it for gaming.
If you want to undo everything, delete the two rows, or close PowerToys. The remap is not written into Windows itself, so closing the program is enough to restore the original behaviour.
Frequently asked questions
- Why are my Alt and Windows keys swapped?
- Most often the keyboard was made for a Mac. Apple's layout puts Option (which acts as Alt in Windows) to the left of Command (which acts as the Windows logo key), the reverse of the order on a PC keyboard. A keyboard with a Mac/Windows mode setting can also be set to the wrong mode.
- Does swapping the keys with PowerToys work in every program?
- No. Keyboard Manager does not work at the sign-in screen, and it does not affect windows running as administrator unless PowerToys itself runs as administrator. Microsoft also advises against using it while playing games, and says some keyboard APIs do not work with it.
- Can I remap the Windows key permanently without software?
- Not through a built-in Windows setting. Microsoft's PowerToys remaps keys while it runs in the background, and the mapping stops applying if PowerToys is closed. Some keyboards store a layout in their own firmware, which needs no software on the computer; check the keyboard's manual.
- Will Win+L still lock my PC after I remap the Windows key?
- Microsoft lists Win+L and Ctrl+Alt+Del as reserved by Windows, so they cannot be remapped. Remapping the Win key itself can still break some gestures and special keys, which is a documented known issue.