
How to Find Out Wifi Password on Laptop? Via Terminal
Introduction Few things are more frustrating than sitting down with your laptop, ready to connect a new phone, tablet, or guest device, only to realize you have no idea what the WiFi password is. If you have ever searched for How to Find Out Wifi Password on L
Introduction
Few things are more frustrating than sitting down with your laptop, ready to connect a new phone, tablet, or guest device, only to realize you have no idea what the WiFi password is. If you have ever searched for How to Find Out Wifi Password on Laptop?, you are not alone. Most modern laptops remember every wireless network they have joined, storing the credentials securely in the operating system. The challenge is knowing where to look and how to reveal that information without installing risky third-party software.
This guide walks you through the process of finding a saved WiFi password using only the terminal or command-line tools already built into your laptop. Whether you are using Windows, macOS, or Linux, the steps are straightforward once you know which commands to run. We will cover how to list saved networks, how to reveal the password for a specific network, and what to do if something goes wrong.
Before diving into the commands, it is important to set expectations. These methods retrieve passwords for networks your laptop has already connected to in the past. They cannot be used to crack passwords for networks you have never accessed, nor should they be used to access networks that do not belong to you. With that in mind, let us begin by looking at common situations where retrieving a saved WiFi password makes sense.
- Introduction
- Why You Might Need Your WiFi Password
- Before You Start: Important Privacy and Security Notes
- How to Find Out Wifi Password on Laptop? Via Terminal (Windows)
- Windows Command Prompt Method
- Windows PowerShell Method
- How to Find Out Wifi Password on Laptop? Via Terminal (macOS)
- macOS Terminal: security find-generic-password
- How to Find Out Wifi Password on Laptop? Via Terminal (Linux)
- Linux: NetworkManager and nmcli
- Linux: Reading wpa_supplicant Configuration
- Comparison Table: Windows vs macOS vs Linux
- Step-by-Step: Finding WiFi Password on Windows Laptop
- Step-by-Step: Finding WiFi Password on macOS Laptop
- Step-by-Step: Finding WiFi Password on Linux Laptop
- Troubleshooting Common Issues
- Tips and Best Practices
- Frequently Asked Questions
- Conclusion
Why You Might Need Your WiFi Password
There are many legitimate reasons to look up a wireless password on your laptop. You might be setting up a new smart TV or gaming console and need to enter the same credentials. You could be helping a friend or family member connect to your home network. Perhaps you reset your router and lost the sticker with the default password, but your laptop still remembers the custom password you set months ago. In office environments, IT administrators sometimes need to document network credentials for new employee onboarding.
Whatever the reason, using your laptop’s terminal is often faster and safer than digging through router settings or calling your internet service provider. Because the password is already stored locally, you are simply viewing information your device already trusts. This makes the terminal method one of the most convenient ways to answer the question: How to Find Out Wifi Password on Laptop?
Before You Start: Important Privacy and Security Notes
Retrieving saved WiFi passwords is a powerful capability, and it comes with responsibilities. First, you should only attempt this on networks you own or have explicit permission to manage. Attempting to view passwords for networks you do not own may violate privacy laws and your organization’s acceptable use policy.
Second, most of the commands below require administrator or root privileges. This is by design: operating systems protect wireless credentials so that standard users or malicious scripts cannot easily harvest them. Be prepared to enter your laptop’s administrator password when prompted.
Third, never share retrieved passwords over unencrypted channels such as plain text email or public chat. If you need to send the password to someone, use a secure messaging app or share it in person. Finally, treat this guide as a reference for recovering your own credentials, not as a tool for unauthorized network access.
How to Find Out Wifi Password on Laptop? Via Terminal (Windows)
Windows makes it relatively simple to retrieve saved WiFi passwords using built-in command-line tools. The primary utility is called netsh, short for network shell. It can display all wireless profiles stored on your laptop and reveal the security key for any one of them. You can use either the classic Command Prompt or the modern PowerShell terminal, depending on your preference.
The general workflow on Windows is the same regardless of which terminal you choose. First, you list all saved WiFi profiles to find the exact name of the network you want. Second, you query that specific profile with a flag that tells Windows to show the password in plain text. The password appears under a field labeled “Key Content.”
Windows Command Prompt Method
The Command Prompt is available on every version of Windows and is often the fastest way to get started. Follow these steps to find out WiFi password on laptop using CMD.
- Press the
Windowskey on your keyboard, typecmd, right-click on Command Prompt, and choose Run as administrator. Without administrator rights, the password will not be revealed. - In the terminal window, type the following command and press
Enter:
netsh wlan show profiles
- Look through the list for the network name, also called the SSID, that you want to investigate. Note the exact spelling, including capitalization and spaces.
- Type the following command, replacing
YOUR-NETWORK-NAMEwith the actual SSID, then pressEnter:
netsh wlan show name="YOUR-NETWORK-NAME" key=clear
- Scroll down in the output until you see the Security settings section. Look for the line that says Key Content. The text immediately after it is your WiFi password.
If the network uses no security or if Windows does not have the password stored, the Key Content field may appear blank. In that case, there is no saved password to retrieve.
Windows PowerShell Method
PowerShell offers a more modern terminal experience and can accomplish the same result. Some users prefer it because it integrates better with scripting and automation. To retrieve a WiFi password in PowerShell:
- Press
Windows+Xand select Windows PowerShell (Admin) or Terminal (Admin) from the menu. - Run the same
netshcommands shown above. PowerShell fully supportsnetsh, so the syntax does not change. - List profiles with
netsh wlan show profiles, then reveal the password withnetsh wlan show name="YOUR-NETWORK-NAME" key=clear.
PowerShell users can also parse the output programmatically, but for a one-time lookup, the standard netsh approach is the simplest and most reliable method.
How to Find Out Wifi Password on Laptop? Via Terminal (macOS)
macOS stores WiFi passwords in the system keychain, a secure database that manages passwords, certificates, and encryption keys. The Terminal application gives you direct access to the keychain through a command called security. This method works on MacBook Air, MacBook Pro, iMac, Mac mini, and Mac Studio.
Unlike Windows, where you run a single networking command, macOS requires you to query the keychain for a specific AirPort network item. You will also need to authenticate using your Mac user password or Touch ID, because macOS protects keychain items strictly.
macOS Terminal: security find-generic-password
The security command-line tool can search the keychain for generic password items associated with WiFi networks. Here is how to use it.
- Open Terminal. You can find it in
Applications > Utilitiesor by pressingCommand+Spaceand typingTerminal. - Type the following command, replacing
YOUR-NETWORK-NAMEwith the exact name of your WiFi network, then pressReturn:
security find-generic-password -ga "YOUR-NETWORK-NAME"
- macOS will display a dialog asking for permission to access the keychain. Enter your Mac user password or use Touch ID to approve.
- After authentication, the Terminal prints information about the keychain item. Look for a line that begins with
password:. The text following it is your WiFi password.
If you receive an error stating that the item could not be found, double-check the network name. macOS keychain entries are case-sensitive, so MyHomeWiFi and myhomewifi are treated as different entries.
How to Find Out Wifi Password on Laptop? Via Terminal (Linux)
Linux offers several ways to retrieve saved WiFi passwords, depending on your distribution and network manager. Most modern desktop distributions, such as Ubuntu, Fedora, Debian, and Mint, use NetworkManager to handle wireless connections. NetworkManager stores connection files in a system directory, and these files often contain the pre-shared key in plain text or in an obfuscated form that can be decoded with root access.
Because Linux distributions vary, you may need to try more than one method. The two most common approaches are using the nmcli command-line client and reading NetworkManager configuration files directly.
Linux: NetworkManager and nmcli
nmcli is the official command-line tool for NetworkManager. It can list saved connections and show their properties, including the WiFi security key.
- Open a terminal window. On most distributions, you can press
Ctrl+Alt+T. - List all saved connections to identify the exact name of your wireless network:
nmcli connection show
- Look for the connection name that matches your WiFi SSID. It may not match exactly if you renamed the connection, so choose the entry with the correct
802-11-wirelesstype. - Run the following command to reveal the password, replacing
CONNECTION-NAMEwith the name from the previous step:
sudo nmcli -s -g 802-11-wireless-security.psk connection show "CONNECTION-NAME"
- Enter your user password when prompted for
sudo. The terminal will output the pre-shared key, which is your WiFi password.
The -s flag tells nmcli to display secrets, and -g asks for machine-readable output. Together, they print only the password without extra formatting.
Linux: Reading wpa_supplicant Configuration
On some Linux systems, especially those not using NetworkManager, wireless credentials are stored in wpa_supplicant configuration files. These files are usually located in /etc/NetworkManager/system-connections/ or /etc/wpa_supplicant/.
To find the password this way:
- Open a terminal with root privileges.
- List the files in the system-connections directory:
ls /etc/NetworkManager/system-connections/
- Open the file that corresponds to your network. The filename may match the SSID or use a UUID:
sudo cat /etc/NetworkManager/system-connections/your-network-name.nmconnection
- Look for a section labeled
[wifi-security]and a line that sayspsk=. The value after the equals sign is your WiFi password.
If you do not see a psk= line, the password may be stored in an encrypted format that requires additional tools to decode. In that case, the nmcli method is usually more reliable.
Comparison Table: Windows vs macOS vs Linux
The table below summarizes the key differences between the three operating systems when you are trying to find out WiFi password on laptop using terminal commands.
| Operating System | Primary Terminal Tool | Admin or Root Required? | Where Password Appears | Difficulty Level |
|---|---|---|---|---|
| Windows | Command Prompt or PowerShell (netsh) |
Yes, administrator | Under “Key Content” | Easy |
| macOS | Terminal (security) |
Yes, user password or Touch ID | After password: in keychain output |
Easy |
| Linux | Terminal (nmcli or config files) |
Yes, root or sudo |
After psk= or in nmcli output |
Moderate |
Step-by-Step: Finding WiFi Password on Windows Laptop
If you want a complete, start-to-finish walkthrough for Windows, follow these detailed instructions. This method works on Windows 10 and Windows 11.
- Open an elevated terminal. Click the Start button, type
cmd, right-click Command Prompt, and select Run as administrator. A User Account Control prompt may appear; click Yes. - List saved wireless profiles. Type
netsh wlan show profilesand pressEnter. Review the list under User profiles. - Identify your network. Find the exact SSID name. Write it down or copy it carefully.
- Reveal the password. Type
netsh wlan show name="YOUR-SSID" key=clear, replacingYOUR-SSIDwith the network name, and pressEnter. - Locate Key Content. Scroll to the Security settings section. The line labeled Key Content displays the password in plain text.
- Record or use the password. Copy it carefully if you need to enter it on another device. Close the terminal when finished.
If you are using PowerShell instead of Command Prompt, the steps are identical. PowerShell accepts netsh commands without modification.
Step-by-Step: Finding WiFi Password on macOS Laptop
Mac users can retrieve WiFi passwords through Terminal using the keychain. Here is the full procedure.
- Launch Terminal. Open Spotlight with
Command+Space, typeTerminal, and pressReturn. - Run the keychain query. Type
security find-generic-password -ga "YOUR-SSID", replacingYOUR-SSIDwith your network name, and pressReturn. - Authenticate. A system dialog will appear asking for permission to access the keychain item. Enter your Mac login password or use Touch ID.
- Read the output. Once approved, Terminal prints details about the keychain entry. Find the line starting with
password:. The characters after it are your WiFi password. - Close Terminal. When you are done, quit Terminal to keep your session secure.
If you manage many networks and do not remember the exact SSID, you can list keychain items related to AirPort by searching your keychain, though the direct security command is faster when you already know the network name.
Step-by-Step: Finding WiFi Password on Linux Laptop
Linux users typically rely on NetworkManager. Here is a detailed walkthrough using nmcli.
- Open a terminal. Use your desktop’s application menu or the keyboard shortcut
Ctrl+Alt+T. - Show saved connections. Type
nmcli connection showand pressEnter. Locate the connection that corresponds to your WiFi network. - Request the security key. Type
sudo nmcli -s -g 802-11-wireless-security.psk connection show "CONNECTION-NAME", replacingCONNECTION-NAMEwith the exact connection name, and pressEnter. - Enter your password. Provide your user account password for
sudo. The terminal will print the WiFi pre-shared key. - Use the password. Copy the output and use it to connect other devices.
If nmcli does not return a password, try inspecting the configuration file directly in /etc/NetworkManager/system-connections/ as described earlier. Some distributions store the key in a different format, so consulting your distribution’s documentation may help.
Troubleshooting Common Issues
Even with the right commands, you may run into obstacles. Here are common problems and how to fix them.
Network Not Found in Saved Profiles
If the network does not appear when you list saved profiles, your laptop has never connected to it, or the profile was deleted. You cannot retrieve a password that was never saved. In this case, you will need to obtain the password from the router administrator or reset the router to its default credentials.
Access Denied or Administrator Required
Windows will not show the Key Content unless Command Prompt is elevated. macOS will not reveal keychain items without authentication. Linux requires sudo or root access. Always run the terminal with the appropriate privileges.
Password Field Is Blank
Some open networks do not use a password, so the field is naturally empty. On rare occasions, a profile may be corrupted. Try forgetting the network and reconnecting to save a fresh password.
Special Characters in SSID
If your WiFi name contains quotation marks, spaces, or special symbols, wrap the SSID in quotes in your command. On macOS and Linux, escaping special characters may also be necessary.
Command Not Found
On minimal Linux installations, nmcli may not be installed. Install the NetworkManager command-line package for your distribution, or use the configuration file method instead.
Tips and Best Practices
Retrieving a WiFi password is simple, but doing it responsibly protects your network and your devices.
- Only recover passwords for networks you own. Do not use these methods on networks you are not authorized to access.
- Use administrator privileges carefully. Elevated terminals can make system-wide changes. Close them when you are finished.
- Write down the password securely. If you frequently forget your WiFi password, store it in a reputable password manager rather than on a sticky note near your router.
- Change default router passwords. If you recovered a default password from a router sticker, consider logging into the router and changing it to something stronger.
- Keep your operating system updated. Security patches protect the keychain and credential storage where your WiFi passwords live.
- Do not share passwords over insecure channels. Avoid sending WiFi credentials in plain text emails or public forums.
Frequently Asked Questions
Can I find the WiFi password for networks I have never connected to?
No. These methods only reveal passwords for networks your laptop has previously joined and saved. You cannot use them to discover passwords for unfamiliar networks.
Is it legal to retrieve saved WiFi passwords?
It is legal to recover passwords for networks you own or manage. Retrieving passwords for networks you do not own may violate privacy laws and terms of service.
Do I need third-party software?
No. Windows, macOS, and Linux all include built-in terminal tools that can retrieve saved WiFi passwords. Third-party tools are unnecessary and may introduce security risks.
Will this work on a work or school laptop?
It may not. Organization-managed laptops often restrict administrator access, block netsh or security commands, or delete WiFi profiles after you log out. Check your organization’s policy before proceeding.
What if I forgot my laptop administrator password?
You will not be able to run the elevated commands required to reveal WiFi passwords. You would need to recover or reset your administrator account first.
Can I see the password in plain text on macOS?
Yes, after authenticating with your user password or Touch ID, the Terminal output includes the password in plain text.
Why is the Key Content blank on Windows?
This usually happens for open networks with no password, or if the wireless profile is corrupted. It can also happen if you do not run Command Prompt as administrator.
Conclusion
Forgetting your WiFi password does not have to mean resetting your router or calling your internet provider. If your laptop has connected to the network before, the password is already stored on your device. By using built-in terminal tools such as netsh on Windows, security on macOS, and nmcli on Linux, you can quickly find out WiFi password on laptop without installing additional software.
Remember to use these methods responsibly. Only retrieve credentials for networks you own or manage, always authenticate with administrator privileges when required, and keep your recovered passwords secure. With the steps outlined in this guide, you should now be able to recover saved WiFi passwords on any major laptop operating system whenever you need them.