How to recover the forgotten Wi-Fi password on Windows, Mac, and Linux computers.
Imagine this scenario – your computer is connected to a Wi-Fi network but you do not remember the password that you previously used to connect to this particular WiFi network. Maybe you forgot the password over time, or perhaps the network administrator setup the Wi-Fi connection for you without providing the actual password to you.
Now, you need to connect a second device, such as your mobile phone, to the same Wi-Fi network, but you’re unsure how to retrieve the password.
Recover the Forgotten Wi-Fi Password
In this situation, you may either request the password from the Wi-Fi owner or, a simpler alternative, open the command prompt on your computer to retrieve the saved Wi-Fi password in one easy step. This technique works on both Mac and Windows computers.
Find the WiFi Password on Windows
Open the command prompt in administrator mode. Type cmd
in the Run box, right-click the command prompt icon and choose Run as Administrator). Now enter the following command and hit enter to see the WiFi password.
netsh wlan show profile name=labnol key=clear
Remember to replace labnol
with the name of your Wireless SSID (this is the name of the Wi-Fi network that you connect your computer to). The password will show up under the Security Setting section (see screenshot).
If you would only like to see the password and not the other information, use the findstr command:
netsh wlan show profile name=labnol key=clear | findstr Key
If you do not see the password, probably you’ve not opened the command prompt window as administrator
Show the WiFi Password on Mac OS
If you’re using a Mac and have previously connected to a Wi-Fi network but can’t remember the password, you can easily retrieve the password from Keychain. macOS uses Keychain to store various login credentials, including Wi-Fi network passwords.
Open Spotlight (Cmd+Space) and type terminal
to open the Terminal window on your Mac. Now type the following command and hit enter (replace labnol with your WiFi name).
security find-generic-password -wa labnol
You’ll be prompted to enter your admin username and password to access the OS Keychain and the Wi-FI network password would be displayed on the screen in plain text.
Reveal the WiFi Password on Linux
The process of retrieving the Wi-Fi password on Linux is similar to the method used on macOS. Open the Terminal window and type the following command to view the Wi-Fi password.
sudo cat /etc/NetworkManager/system-connections/labnol | grep psk=
Remember to substitute labnol with the wireless name (SSID) of your current Wi-Fi network. The value of the field psk
is your WiFi password.
If you don’t know the exact name of the Wi-Fi network, you can use the following command to list all the stored network configurations and their corresponding passwords:
sudo grep psk= /etc/NetworkManager/system-connections/*
Start WLAN AutoConfig (Wlansvc Service)
If you are using this technique to retrieve the WiFi password on a Windows computer but getting an error that says – “The Wireless AutoConfig Service (wlansvc) is not running” – here’s a simple fix:
Click the Windows Start button and type services.msc
in the Run box to access Windows Services. Here go to the WLAN Autoconfig service and make sure that the status is Running. Else right-click the WLAN AutoConfig service, select Properties and go to Dependencies. Check all the dependencies to make sure they are all running.