
How Can I Find Wifi Password on Computer? Command Line Tips
Introduction If you have ever connected to a wireless network and forgotten the password later, you are not alone. Many people search online asking, “How Can I Find Wifi Password on Computer?” especially when they need to share the connection with a new device
Introduction
If you have ever connected to a wireless network and forgotten the password later, you are not alone. Many people search online asking, “How Can I Find Wifi Password on Computer?” especially when they need to share the connection with a new device, set up a smart TV, or troubleshoot a network issue. The good news is that your computer usually remembers every Wi-Fi network you have ever joined, and you can retrieve those saved passwords using simple command line tools.
This guide walks you through proven methods for Windows, macOS, and Linux. You will learn exact commands, what each output means, and how to avoid common mistakes. Whether you are a beginner who has never opened a terminal or an experienced user looking for a quick reference, this article has you covered.
Table of Contents
- Introduction
- What You Need Before You Start
- How Can I Find Wifi Password on Computer? Windows Command Line
- Using netsh wlan show profile
- Step-by-Step Windows Instructions
- Finding Wi-Fi Password on macOS via Terminal
- Finding Wi-Fi Password on Linux via Terminal
- Comparison of Methods Across Operating Systems
- Alternative GUI Methods
- Troubleshooting Common Issues
- Security and Privacy Best Practices
- Tips for Managing Saved Wi-Fi Networks
- Frequently Asked Questions
- Conclusion
What You Need Before You Start
Before running any command, make sure you meet a few basic requirements. First, you need administrative or appropriate user privileges on the computer. On Windows, you may need to run Command Prompt as an administrator to see password details. On macOS and Linux, you may be prompted for your user password when accessing the keychain or system files.
Second, the Wi-Fi network must have been saved on that specific computer at least once. If you never connected to the network from this machine, no password will be stored locally. Third, keep in mind that retrieving passwords should only be done on networks you own or have permission to access. Unauthorized access to networks is illegal in many jurisdictions.
Finally, have a pen and paper or a secure password manager ready so you can record the password safely once you find it.
How Can I Find Wifi Password on Computer? Windows Command Line
Windows stores Wi-Fi profiles and their credentials in a way that the built-in netsh utility can read. This is the most reliable command line approach on Windows 10 and Windows 11. You do not need to install any third-party software.
Using netsh wlan show profile
The netsh command interacts with network settings. The subcommand wlan show profiles lists every saved wireless network on your computer. Adding the key=clear parameter reveals the password in plain text in the Key Content field.
Here is the basic command to list all saved networks:
netsh wlan show profiles
And here is the command to reveal the password for a specific network, replacing NetworkName with the actual SSID:
netsh wlan show profile name="NetworkName" key=clear
Look for the line labeled Key Content. The value next to it is your Wi-Fi password. If you see Security key : Present but no Key Content, you likely did not run Command Prompt as an administrator.
Step-by-Step Windows Instructions
- Click the Start button and type
cmd. - Right-click on Command Prompt and choose Run as administrator.
- Confirm the User Account Control prompt.
- Type
netsh wlan show profilesand press Enter. - Note the name of the network whose password you want.
- Type
netsh wlan show profile name="YourNetworkName" key=clearand press Enter. - Scroll to find
Key Contentunder the Security settings section. - Copy the password and store it securely.
If you want to see passwords for every saved network at once, you can use a short batch loop, but for most users checking one network at a time is safer and clearer.
Finding Wi-Fi Password on macOS via Terminal
On macOS, Wi-Fi passwords are stored in the Keychain. The security command line tool can retrieve them. This method works on modern macOS versions including macOS Sonoma and later, although exact output wording may vary slightly.
First, list known networks or recall the SSID. Then run:
security find-generic-password -wa "NetworkName"
Replace NetworkName with the exact Wi-Fi network name. You will be prompted to enter your macOS user password. After authentication, the Wi-Fi password prints to the terminal. If the network name contains spaces, keep the quotes around it.
If you are unsure of the exact SSID, you can list saved Wi-Fi networks using:
networksetup -listpreferredwirelessnetworks en0
Note that the interface name may be en0 or en1 depending on your Mac. You can check interfaces with networksetup -listallhardwareports.
Another approach is to open Keychain Access from Applications, search for the network name, and check the Show password box after authenticating. While not strictly command line, it is a useful fallback.
Finding Wi-Fi Password on Linux via Terminal
Linux distributions store Wi-Fi credentials in different locations depending on the network manager. The most common is NetworkManager, which saves connection profiles under /etc/NetworkManager/system-connections/.
To view saved connections, run:
nmcli connection show
To reveal the password for a specific connection, use:
nmcli connection show "NetworkName" | grep -i password
Alternatively, you can read the profile file directly. Files in the system-connections directory often contain a line like psk=yourpassword under the [wifi-security] section. You will need sudo privileges:
sudo cat /etc/NetworkManager/system-connections/NetworkName.nmconnection
On older systems using Wicd, passwords may be stored in /etc/wicd/wireless-settings.conf. On systems using wpa_supplicant directly, check /etc/wpa_supplicant/wpa_supplicant.conf for psk entries.
Always handle these files carefully, as they contain sensitive credentials in plain text.
Comparison of Methods Across Operating Systems
| Operating System | Primary Tool | Needs Admin Rights | Ease of Use | Output Location |
|---|---|---|---|---|
| Windows | netsh wlan show profile | Yes, for key=clear | Easy | Key Content field |
| macOS | security find-generic-password | User password prompt | Moderate | Terminal output |
| Linux (NetworkManager) | nmcli connection show | Often sudo | Moderate | 802-11-wireless-security.psk |
| Linux (wpa_supplicant) | cat wpa_supplicant.conf | Yes | Advanced | psk= line |
This table summarizes the main approaches. Windows is generally the most beginner-friendly because netsh is built in and well documented. macOS requires Keychain authentication, which adds a security layer. Linux offers flexibility but varies by distribution and network manager.
Alternative GUI Methods
Although this article focuses on command line tips, graphical methods are worth mentioning for completeness. On Windows, you can go to Settings, then Network and Internet, then Wi-Fi, then Manage known networks, select a network, and view properties to see the password, though this sometimes requires admin rights. On macOS, Keychain Access provides a friendly interface. On Linux desktops like GNOME, the Wi-Fi settings panel can reveal passwords after authentication.
GUI methods are helpful when you prefer clicking over typing, but command line methods are faster for power users and can be scripted for automation.
Troubleshooting Common Issues
Sometimes the password does not appear. Here are common causes and fixes:
- Command Prompt not elevated: On Windows, rerun as administrator.
- Wrong network name: SSIDs are case-sensitive in some contexts. Copy the exact name from the profiles list.
- Network never saved: If you connected via WPS or a guest portal, no password may be stored.
- Keychain locked: On macOS, unlock the login keychain first.
- Permission denied: On Linux, use sudo and verify your user is in the sudoers group.
- Hidden characters: Some passwords contain spaces. Keep quotes intact when running commands.
If all else fails, resetting the router or checking the label on the device may be necessary, but only for networks you own.
Security and Privacy Best Practices
Retrieving a Wi-Fi password is powerful, so handle it responsibly. Never share passwords over unencrypted channels. Use a password manager to store credentials. Avoid running commands on public or shared computers where your terminal history might be visible. On shared machines, clear terminal history after use:
history -c
On Windows, you can clear command history by closing the session or using PowerShell history clearing commands. Also, remember that anyone with admin access to your computer can retrieve saved passwords, so lock your device when away.
Consider rotating your Wi-Fi password periodically, especially if you have shared it with guests. Use WPA3 where supported, and disable WPS if your router allows it, since WPS can be a security weakness.
Tips for Managing Saved Wi-Fi Networks
Here are practical tips to keep your wireless credentials organized:
- Regularly review saved networks and remove ones you no longer use. On Windows:
netsh wlan delete profile name="OldNetwork". - Use descriptive SSIDs at home so you can identify them easily.
- Keep a secure backup of your router admin credentials separately from Wi-Fi passwords.
- When traveling, avoid auto-connecting to open networks.
- Use a guest network for visitors to protect your main password.
Managing profiles also improves connection speed and reduces conflicts when multiple networks are saved.
Frequently Asked Questions
Can I find the Wi-Fi password without admin rights?
On Windows, you generally need administrator privileges to view the key in clear text. On macOS, you need to authenticate with your user password. On Linux, sudo is usually required to read system connection files. Without these rights, the password field is hidden for security.
Is it legal to retrieve a Wi-Fi password from my computer?
Yes, if you own the computer and the network. Retrieving passwords from devices you do not own or networks you are not authorized to use may violate laws and policies. Always ensure you have permission.
What if the password shown is wrong?
Sometimes the profile stores an outdated password after a router change. In that case, forget the network and reconnect with the new password. On Windows, use netsh wlan delete profile name="NetworkName" then reconnect.
Does this work on Windows 11?
Yes. The netsh wlan show profile ... key=clear command works on Windows 11 just as it does on Windows 10. Just run Command Prompt as administrator.
Can I automate this across many computers?
Yes, but do so carefully and only in managed environments. Scripts can query profiles, but storing or transmitting passwords should follow your organization’s security policy and comply with regulations.
Why do some networks show no password?
Open networks have no password. Enterprise networks using 802.1X may store credentials differently, often in certificates or user accounts rather than a simple pre-shared key.
Conclusion
Now you know the answer to “How Can I Find Wifi Password on Computer?” using command line tools across Windows, macOS, and Linux. The netsh command on Windows, the security tool on macOS, and nmcli or direct file reads on Linux give you direct access to saved credentials when you have proper permissions. Always use these techniques responsibly, protect your passwords with a manager, and keep your system secure. With these command line tips in your toolkit, you will never be locked out of your own Wi-Fi network again.