
How to Check Wifi Password Cmd? Reveal Saved Keys via Command Line
Introduction Forgetting a WiFi password is a common frustration. You may have connected your laptop to a network months ago, and now a new phone, tablet, or guest needs the same credentials. If the password is saved on your Windows computer, you do not have to
Introduction
Forgetting a WiFi password is a common frustration. You may have connected your laptop to a network months ago, and now a new phone, tablet, or guest needs the same credentials. If the password is saved on your Windows computer, you do not have to reset your router or guess combinations. You can retrieve it directly from the operating system using the command line. This guide explains how to check wifi password cmd tools and techniques, with a focus on Windows Command Prompt, plus alternatives for macOS and Linux.
Throughout this article, you will learn the exact netsh commands required to reveal saved wireless keys, the prerequisites for running them, and what to do if something goes wrong. We will also cover ethical considerations, because accessing network credentials should only be done on devices you own or manage with proper authorization.
If you have been searching for how to check wifi password cmd, you are in the right place. The steps below work on Windows 10, Windows 11, and earlier versions where the Command Prompt is available.
Table of Contents
- Introduction
- What Is the Command Prompt and Why Use It for WiFi Passwords?
- Prerequisites Before You Begin
- How to Check Wifi Password Cmd? The Netsh Method
- Step-by-Step: Reveal Saved WiFi Keys on Windows
- Alternative: Using PowerShell Instead of CMD
- Checking WiFi Passwords on macOS via Terminal
- Checking WiFi Passwords on Linux via Terminal
- Comparison Table: CMD, PowerShell, and Terminal Options
- Troubleshooting Common Issues
- Security Tips and Best Practices
- Frequently Asked Questions
- Conclusion
What Is the Command Prompt and Why Use It for WiFi Passwords?
The Command Prompt, often called cmd, is the command-line interpreter built into Windows. It allows users to execute system utilities by typing text commands rather than clicking through graphical menus. For network administration, one of the most useful built-in tools is netsh, short for network shell. Netsh can configure, display, and manage network settings, including wireless local area network (WLAN) profiles.
Every time your computer connects to a WiFi network and saves the credentials, Windows stores a profile for that network. The profile contains the SSID, security type, encryption method, and the pre-shared key. While the graphical interface hides the actual password for security reasons, the command line can reveal it if you have administrative privileges. This is why learning how to check wifi password cmd is valuable for recovering forgotten credentials on your own machine.
Using the command line is often faster than navigating through Control Panel or Settings, especially when you need to check multiple saved networks. It is also a reliable method when the graphical interface is not responding or when you are working in a minimal installation of Windows.
Prerequisites Before You Begin
Before attempting to reveal a saved WiFi password through the command line, make sure the following conditions are met:
- Administrator rights: You must open Command Prompt as an administrator. Standard user accounts cannot access stored security keys.
- Previously connected network: The computer must have connected to the WiFi network at least once and chosen to save the password. Networks you have never joined will not have a stored profile.
- Windows operating system: The netsh wlan commands described here are native to Windows. macOS and Linux require different tools, which are covered later in this guide.
- Physical access: You need direct access to the computer. Remote retrieval of WiFi passwords through cmd is not possible without prior remote administration setup.
- Authorization: Only retrieve passwords for networks you own or manage. Accessing credentials on a device you do not own may violate privacy laws and organizational policies.
If any of these prerequisites are missing, the commands will either fail or return no usable information. The next section explains the core netsh syntax used for password recovery.
How to Check Wifi Password Cmd? The Netsh Method
The primary Windows command for checking saved WiFi passwords is netsh wlan. This utility interacts with the WLAN AutoConfig service and can display every wireless profile stored on the system. To reveal a password, you generally follow a two-step process: first, list all saved profiles to identify the exact network name, and second, query that specific profile with the key=clear parameter.
The command to list all saved WiFi profiles is:
netsh wlan show profiles
This command returns a list of user profiles under the heading “Wireless Network Connections.” Each entry shows the name of a previously connected network. Once you identify the target SSID, use the following syntax to reveal its security details:
netsh wlan show profile name="NETWORK_NAME" key=clear
Replace NETWORK_NAME with the exact SSID, including capitalization and spaces. The output includes several sections, such as SSID, Authentication, Cipher, and Security settings. The most important field is under “Security settings,” labeled “Key Content.” That value is the saved WiFi password in plaintext.
Learning how to check wifi password cmd using netsh is straightforward, but accuracy matters. If the network name contains special characters or spaces, you must wrap it in double quotation marks, as shown above. Omitting the quotes or misspelling the SSID will cause the command to report that the profile cannot be found.
Step-by-Step: Reveal Saved WiFi Keys on Windows
This step-by-step guide shows how to check wifi password cmd on a Windows computer. Follow each step in order.
- Open Command Prompt as Administrator. Click the Start button, type
cmd, right-click on Command Prompt in the search results, and select Run as administrator. If a User Account Control prompt appears, click Yes. Elevated privileges are required because stored WiFi keys are protected system data. - Display all saved wireless profiles. Type the following command and press Enter:
netsh wlan show profiles
Review the output and locate the network name you want to check. It appears under “User profiles.” - Note the exact SSID. Copy or write down the network name exactly as it appears. WiFi names are case-sensitive, so
MyHomeWiFiandmyhomewifiare treated as different profiles. - Reveal the password for the target network. Type the following command, replacing
YOUR_SSIDwith the actual network name, and press Enter:
netsh wlan show profile name="YOUR_SSID" key=clear - Locate the Key Content field. Scroll through the output until you reach the “Security settings” section. Look for the line labeled Key Content. The text immediately following it is the WiFi password.
- Copy or record the password. You can highlight the password in the Command Prompt window, right-click to copy it, and paste it into a secure password manager or another device.
- Close Command Prompt when finished. Type
exitand press Enter, or simply click the close button. This prevents others from viewing your command history if you step away from the computer.
Example output might look like this:
SSID name: HomeNetwork
...
Security settings
Authentication : WPA2-Personal
Cipher : CCMP
Security key : Present
Key Content : ExamplePassword123
If the Key Content line is blank or missing, the network may use enterprise authentication, or the password may not be stored in a retrievable format on that particular machine.
Alternative: Using PowerShell Instead of CMD
PowerShell is the modern successor to Command Prompt on Windows. It can run traditional cmd commands, including netsh, but it also offers its own cmdlets for system administration. If you prefer PowerShell, you can open it as an administrator and run the same netsh commands shown earlier:
netsh wlan show profiles
netsh wlan show profile name="YOUR_SSID" key=clear
PowerShell does not have a single built-in cmdlet named Get-WiFiPassword that retrieves plaintext keys without additional modules or scripting. For most users, sticking with Command Prompt and netsh is the most direct approach. However, PowerShell is useful if you want to automate the process, export results to a file, or integrate password checks into a larger administrative script.
Checking WiFi Passwords on macOS via Terminal
macOS stores WiFi passwords in the system keychain rather than in netsh profiles. To retrieve a saved password using Terminal, you can use the security command-line utility. Open Terminal and run:
security find-generic-password -ga "YOUR_SSID"
Replace YOUR_SSID with the exact name of the WiFi network. macOS will prompt you for your administrator password or Touch ID to authorize access to the keychain. Once approved, the output will include a line labeled “password” followed by the actual WiFi key.
This method requires that the Mac has previously connected to the network and saved the password. It also requires administrative access to the user account. The command-line approach on macOS is slightly different from Windows, but the principle is the same: the operating system stores the credential, and authorized users can retrieve it through Terminal.
Checking WiFi Passwords on Linux via Terminal
Linux distributions store wireless credentials in different locations depending on the network manager in use. Systems running NetworkManager often save connection files in /etc/NetworkManager/system-connections/. With root privileges, you can inspect these files to find the pre-shared key.
A common approach is to list the available connection files:
sudo ls /etc/NetworkManager/system-connections/
Then view the contents of the file matching your network name:
sudo cat /etc/NetworkManager/system-connections/YOUR_SSID.nmconnection
Look for a line under the [wifi-security] section that reads psk= followed by the password. On distributions using wpa_supplicant directly, you may need to check /etc/wpa_supplicant/wpa_supplicant.conf instead. Because Linux configurations vary widely by distribution and desktop environment, there is no single universal command equivalent to Windows netsh, but root access to the system files generally reveals stored keys.
Comparison Table: CMD, PowerShell, and Terminal Options
The following table compares the primary command-line methods for checking saved WiFi passwords across operating systems.
| Method | Operating System | Example Command | Administrator Required | Reveals Plaintext Password | Difficulty |
|---|---|---|---|---|---|
| netsh via Command Prompt | Windows | netsh wlan show profile name="SSID" key=clear |
Yes | Yes | Easy |
| netsh via PowerShell | Windows | netsh wlan show profile name="SSID" key=clear |
Yes | Yes | Easy |
| security keychain query | macOS | security find-generic-password -ga "SSID" |
Yes | Yes | Moderate |
| NetworkManager config inspection | Linux | sudo cat /etc/NetworkManager/system-connections/SSID.nmconnection |
Yes | Yes | Moderate |
Troubleshooting Common Issues
Even when you follow the steps correctly, you may encounter errors or unexpected output. Below are the most common problems and how to resolve them.
“The wireless network profile cannot be found.” This usually means the SSID was typed incorrectly. WiFi names are case-sensitive, and extra spaces can cause a mismatch. Run netsh wlan show profiles again and copy the name exactly from the output.
Access denied or permission errors. Command Prompt must be launched as an administrator. Right-click the application and choose Run as administrator before entering any netsh commands.
Key Content is blank. Some networks, especially enterprise WPA2-Office networks, do not store a simple pre-shared key in the local profile. In those cases, authentication is handled by a RADIUS server or directory service, and there is no plaintext password to reveal on the client machine.
No profiles are listed. If the computer has never saved a WiFi network, or if all profiles were deleted, there will be nothing to retrieve. You must connect to the network and save the password first.
Command not recognized. The netsh wlan commands are specific to Windows. If you are on macOS or Linux, use the Terminal methods described earlier instead.
Security Tips and Best Practices
Retrieving saved WiFi passwords through the command line is a useful recovery tool, but it also highlights a security risk: anyone with administrative access to your computer can view your stored wireless keys. Keep the following best practices in mind.
- Only check passwords on devices you own or are authorized to manage.
- Do not share WiFi passwords over unencrypted email or chat.
- Use strong, unique passwords for each network, and consider a password manager to store them.
- Remove old or unused wireless profiles from your computer to reduce the number of stored credentials.
- Keep your operating system updated to protect against vulnerabilities that could expose saved keys.
- If you suspect a password has been compromised, change it on the router and reconnect your devices.
- Enable WPA3 encryption on your router if supported, as it offers stronger protection than WPA2.
Physical access to a computer often means access to its saved WiFi passwords. Lock your workstation when you step away, and require a password to log in after sleep or screensaver activation.
Frequently Asked Questions
Can I check WiFi password cmd on any computer?
You can use these commands on any Windows computer where you have administrator rights and where the network profile has been saved. You cannot retrieve passwords for networks the computer has never connected to.
Is it legal to reveal saved WiFi passwords?
It is legal when performed on your own devices or on devices you manage with explicit permission. Accessing stored credentials on someone else’s computer without authorization may violate privacy laws and computer fraud statutes.
Will this work for networks I have never connected to?
No. The computer must have previously joined the network and saved the profile. There is no command to retrieve the password of a network you have never accessed.
What if the Key Content field is blank?
A blank Key Content field usually indicates an enterprise network or a credential stored in a non-recoverable format. You may need to contact the network administrator for the password.
Can I see the password without admin rights?
No. Revealing stored WiFi keys requires elevated privileges because the data is protected by the operating system.
Does this work on Windows 11?
Yes. The netsh wlan commands work on Windows 11, Windows 10, and earlier supported versions of Windows.
Is there a way to check WiFi password on Android via cmd?
Android does not provide a built-in command-line interface for end users to retrieve WiFi passwords in plaintext. Rooted devices may store configuration files in system directories, but accessing them requires advanced technical knowledge and may void warranties or violate terms of service.
Can I export all saved WiFi passwords at once?
Windows does not provide a single netsh command to export every password in plaintext automatically. You must query each profile individually, or use a custom PowerShell script that iterates through the profile list and extracts the Key Content for each one.
Conclusion
You now have a complete understanding of how to check wifi password cmd using the Windows Command Prompt and netsh utility. The process involves opening an elevated Command Prompt, listing saved wireless profiles, and querying the specific network with the key=clear parameter to reveal the Key Content field.
We also explored alternatives for PowerShell, macOS Terminal, and Linux, along with a comparison table to help you choose the right method for your operating system. Troubleshooting tips cover common errors such as access denied messages, misspelled SSIDs, and blank password fields.
Remember that this knowledge comes with responsibility. Only retrieve WiFi passwords for networks you own or are authorized to manage, and follow security best practices to protect your own credentials. If you ever suspect a password has been exposed, change it promptly on your router and update your connected devices.
Whether you are recovering a forgotten home network password or helping a colleague reconnect to an office WiFi, the command line provides a fast and reliable way to access saved keys when you need them most.