Skip to content

Recovering a saved Wi-Fi password

If you have forgotten the password key for a Wi-Fi network but happen to have a device in which the password has been saved, it would be helpful to know how to retrieved the saved password back from the device.

For obvious security reasons, this might not be possible in every situation, but below I'll outline some steps that can be taken and might be useful for particular situations, covering some different Operating Systems.

On Windows devices

Under Windows, this is easily done by using the netsh utility.

powershell
netsh wlan show profile

This would return the list of known saved wireless networks, displaying the SSID (the name of the network) for each of them.

Profiles on interface Wi-Fi:

Group policy profiles (read only)
---------------------------------
    <None>

User profiles
-------------
    All User Profile     : YOUR_WLAN_NAME
    All User Profile     : otherWlanName
    All User Profile     : wlanTestEssid

Confirm that the name of the network you'd like to get the information from is there and use it to obtain its details with the below command:

powershell
netsh wlan show profile YOUR_WLAN_NAME key=clear

The password for the wireless network corresponds to the field "Key Content" under "Security Settings". An example is shown below:

Profile YOUR_WLAN_NAME on interface Wi-Fi:
=======================================================================

Applied: All User Profile

Profile information
-------------------
    Version                : 1
    Type                   : Wireless LAN
    Name                   : YOUR_WLAN_NAME
    Control options        :
        Connection mode    : Connect manually
        Network broadcast  : Connect even if this network is not broadcasting
        AutoSwitch         : Do not switch to other networks
        MAC Randomization  : Disabled

Connectivity settings
---------------------
    Number of SSIDs        : 1
    SSID name              : "YOUR_WLAN_NAME"
    Network type           : Infrastructure
    Radio type             : [ Any Radio Type ]
    Vendor extension          : Not present

Security settings
-----------------
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Authentication         : WPA2-Personal
    Cipher                 : GCMP
    Security key           : Present
    Key Content            : MyVerySecretPAssword-1234

Cost settings
-------------
    Cost                   : Unrestricted
    Congested              : No
    Approaching Data Limit : No
    Over Data Limit        : No
    Roaming                : No
    Cost Source            : Default

On Linux devices

The method to check this might vary depending on what network configuration system is being used.

A common network subsystem in many modern distribution is "Network Manager", which stores the saved connections under the path /etc/NetworkManager/system-connections/.

sh
ls /etc/NetworkManager/system-connections/

There should be a file there for each saved connection, with extension .nmconnection. The format of the files is INI based.

By default, NetworkManager stores the passwords of the saved connections in plan text, although they should only be readable with root permissions.

You should be able to read the password for any particular file by checking the psk attribute within the [wifi-security] section. For example, the command below will show it for all saved connections.

sh
grep -r '^psk=' /etc/NetworkManager/system-connections/

On Android devices

Recent Android versions can share the credentials of a connected or saved Wi-Fi network from the Settings app:

  1. Open Settings and go to Network & internetInternet or Wi-Fi.
  2. Select the network, then tap Share or QR code.
  3. Authenticate with the device PIN, password, pattern, or biometrics when prompted.

The exact names and location of these options vary by manufacturer. Some devices display the password below the QR code. If yours only shows the code, scan it with another device or save a screenshot and open it with a QR reader. The QR payload contains the network name, security type, and password for ordinary personal Wi-Fi networks.

Google documents the QR-sharing procedure in its Android Wi-Fi help.

Older Android versions may not provide a built-in way to reveal saved credentials. On an unrooted device there is no general ADB command that can read them, because Wi-Fi configuration data is protected by the operating system. Rooted devices may access the underlying configuration, but its location and format depend on the Android version and manufacturer.

Personal page