Can You Show WiFi Password in CMD? Here's How
In this article
No, you cannot directly type a command to display your current Wi-Fi password in CMD, but you can retrieve saved Wi-Fi network passwords using built-in Windows commands that query the system's stored network profiles.
Background
Windows stores Wi-Fi network credentials—essentially the passwords—for networks you’ve connected to in the past. These are saved as encrypted profiles within the Windows Network and Sharing Center, managed by the WlanCfg service. While the GUI doesn’t show the password after initial setup, the underlying system retains it in a retrievable format. This feature exists for convenience: if you reset your router or reinstall Windows, you can reconnect to known networks without re-entering passwords. However, this convenience also means the password data is accessible via command-line tools, making it a common troubleshooting step for users who’ve forgotten their network credentials.
How It Works
Windows uses the netsh utility—a command-line scripting tool for network configuration—to manage wireless profiles. When you connect to a Wi-Fi network, Windows saves the SSID (network name), authentication method, and encryption key as a profile. The netsh wlan show profile command lists all saved profiles. Adding the key=clear parameter tells Windows to decrypt and display the security key in plain text, if the user has administrative privileges. This is not a backdoor or exploit; it’s a legitimate administrative function built into Windows since Vista.
How to Retrieve Wi-Fi Passwords in CMD
To view a saved Wi-Fi password, follow these steps:
- Open Command Prompt as Administrator. Right-click the Start button and select Command Prompt (Admin) or Windows Terminal (Admin).
- Type:
netsh wlan show profileand press Enter. This lists all saved wireless networks. - Identify the network name (SSID) you want the password for.
- Type:
netsh wlan show profile name="YourNetworkName" key=clear, replacing YourNetworkName with the exact name from step 2. - Scroll down to the Security Settings section. Look for Key Content—this is your Wi-Fi password.
Example: If your network is named HomeWiFi_5G, the command would be: netsh wlan show profile name="HomeWiFi_5G" key=clear.
Common Problems
Users often encounter issues when trying to retrieve passwords this way. Here are the most frequent problems and fixes:
- Access Denied: You’re not running CMD as Administrator. Right-click and select Run as administrator.
- Profile not found: The network name was typed incorrectly. Use the full list from
netsh wlan show profileand copy-paste the exact name, including spaces and capitalization. - No Key Content shown: The network is not saved on this device, or you’re on a work/school network with group policy restrictions that prevent password retrieval.
- Password appears as asterisks: You forgot the
key=clearparameter. Without it, Windows only shows the profile, not the password.
Security and Safety
Retrieving Wi-Fi passwords via CMD is safe as long as you're on a device you own and trust. The command does not install software, modify settings, or connect to external servers. However, it reveals sensitive data: anyone with physical or remote administrative access to your PC can extract your Wi-Fi password. This is why administrative accounts should be protected with strong passwords and limited to trusted users. Avoid running this command on public or shared computers. Also, be cautious of malware disguised as password-recovery tools—many third-party utilities claiming to show Wi-Fi passwords are malicious. Stick to Microsoft’s built-in tools.
Comparisons
Windows isn’t the only OS with this capability. macOS lets users find saved passwords via Keychain Access, and Linux systems store Wi-Fi credentials in /etc/NetworkManager/system-connections/ as plain-text files (with permissions). However, Windows’ netsh method is unique in its simplicity and directness. Third-party tools like WirelessKeyView or NirSoft utilities exist, but they’re unnecessary. They offer no advantages over the native command and may bundle adware or spyware. The Windows command-line approach is faster, free, and doesn’t require downloading anything. For most users, the built-in method is the most reliable and secure option.
Alternatives
If you can’t access CMD or prefer a GUI method:
- Windows Settings: Go to Network & Internet > Wi-Fi > Manage known networks, select your network, click Properties, then Show characters under Password.
- Router Admin Page: Log into your router (usually via 192.168.1.1 or 192.168.0.1), navigate to wireless settings, and view the password there. This only works if you haven’t changed it from the default or if you remember the router login.
- Connected Device: On a smartphone or tablet already connected to the network, check the Wi-Fi settings—some devices allow you to share the password via QR code or display it in advanced settings.
None of these alternatives are as universally accessible as CMD on Windows machines, but they’re useful if you’re using another OS or lack admin rights.
Frequently Asked Questions
Can I see the Wi-Fi password on another computer using CMD?
No, you can only retrieve passwords saved on the specific device you’re using. Each computer stores its own network profiles. If you need the password for a network on a different machine, you must run the command on that machine or check the router settings.
Why does the password show as asterisks when I don’t use key=clear?
The key=clear parameter is required to decrypt and display the password. Without it, Windows only displays metadata like authentication type and encryption method for security reasons. This prevents accidental exposure of credentials during routine profile viewing.
Can I retrieve a password for a network I’ve never connected to?
No. Windows only stores credentials for networks your device has successfully connected to in the past. You cannot retrieve passwords for networks you’ve only seen in scan results or heard about from others.
Does this work on Windows 10 and 11?
Yes. The netsh wlan show profile command works identically on Windows 7, 8, 10, and 11. The interface may differ slightly, but the underlying system and command syntax remain unchanged.
What if I get an error saying "The service has not been started"?
This usually means the Wireless LAN service is disabled. Press Win+R, type services.msc, find WLAN AutoConfig, right-click it, select Properties, set Startup type to Automatic, then click Start.
Can I use this to hack someone else’s Wi-Fi?
No. This method only retrieves passwords saved on your own device. It cannot decrypt networks you haven’t connected to, nor can it bypass encryption or crack passwords. Attempting to use it on someone else’s device without permission is illegal and violates computer misuse laws.