Wi-Fi Password Command: How to Find or Set It
In this article
- Background: How Wi-Fi Passwords Work
- On Windows: Viewing Saved Wi-Fi Passwords
- On macOS: Accessing Saved Network Passwords
- Changing the Wi-Fi Password via Router Admin
- Common Problems and Misconceptions
- Comparing Platform-Specific Methods
- Security Considerations and Best Practices
- Frequently Asked Questions
There is no single universal "Wi-Fi password command"—instead, the way you view or change a Wi-Fi password depends on your operating system (Windows, macOS, Android, iOS) and whether you're the network administrator or just a user trying to connect. You can retrieve saved passwords on devices you've previously connected, or change the password by logging into your router’s admin interface, but you cannot discover or reset a password you don’t have access to via legitimate means.
Background: How Wi-Fi Passwords Work
Wi-Fi passwords (more accurately called "pre-shared keys" or PSKs in personal networks) are used to authenticate devices before granting access to a wireless network. They do not travel across the airwaves in plaintext, nor are they stored in an easily accessible global database. Instead, they’re stored locally on each device that has connected to the network, and centrally on the router or access point. When you enter the correct password, your device and the router perform a cryptographic handshake (typically WPA2 or WPA3) to verify identity without revealing the password itself. This design prevents eavesdroppers from intercepting the password during normal connection, but it also means there’s no universal command line instruction that can pull a password from thin air.
On Windows: Viewing Saved Wi-Fi Passwords
On Windows, users can recover saved Wi-Fi passwords using Command Prompt or PowerShell—this is often what people mean by the "Wi-Fi password command." The process does not generate or crack passwords; it retrieves credentials already stored by Windows in its secure credential manager. Note that this only works for networks your device has previously connected to and saved.
- Open Command Prompt as Administrator (right-click Start > Command Prompt (Admin) or Windows Terminal (Admin)).
- Type
netsh wlan show profilesand press Enter. This lists all saved Wi-Fi profiles (network names) on the device. - To see the password for a specific network, run:
netsh wlan show profile name="NetworkName" key=clear(replace "NetworkName" with the exact SSID, including quotes if it has spaces). - Scroll down to the "Key Content" field under Security settings—that’s the password.
PowerShell offers a more modern alternative: Get-WifiProfile -Name "NetworkName" -AllUserProfile | Select-Object -ExpandProperty Security | Select-Object -ExpandProperty Key, but this requires the WlanApi module (not always present on older Windows versions). For most users, the netsh method is the most reliable and widely supported.
On macOS: Accessing Saved Network Passwords
macOS does not provide a direct Terminal command to show Wi-Fi passwords in plaintext for security reasons. Instead, it stores them in the Keychain. You must use the Keychain Access app:
- Open Finder > Applications > Utilities > Keychain Access.
- In the search bar, type the Wi-Fi network name (SSID).
- Double-click the matching entry (usually named after the SSID).
- Check "Show password"—you’ll be prompted for your macOS user account password (not the Wi-Fi password).
- Once authenticated, the Wi-Fi password appears.
While there are terminal commands that interact with the keychain (e.g., security find-generic-password -s "NetworkName" -w), they often fail without additional permissions and do not reliably return Wi-Fi PSKs. The GUI method is the officially supported approach.
Changing the Wi-Fi Password via Router Admin
To change the password for your home or office network, you must log into your router’s web-based administration panel. This is where the network’s security settings are configured. The steps vary by brand (e.g., TP-Link, Netgear, ASUS), but the general process is consistent:
- Connect to the Wi-Fi network (or use Ethernet for stability).
- Open a browser and go to the router’s IP address—common defaults include
192.168.1.1,192.168.0.1, or192.168.10.1. Check the router’s label or documentation if unsure. - Enter the admin username and password. If unchanged, defaults like "admin/admin" or "admin/password" may work, but many modern routers require the printed default login (often on a sticker).
- Navigate to Wireless > Wireless Security (or similar, e.g., "Wireless > Wireless Settings > Wireless Security" on some models).
- Locate "Pre-Shared Key," "Password," or "WPA/WPA2-Personal Passphrase" and enter your new password.
- Save or Apply changes. The router may reboot, and all devices will need to reconnect using the new password.
Important: The password must be at least 8 characters for WPA2 and ideally 12+ for WPA3, and should avoid dictionary words. Use a mix of uppercase, lowercase, numbers, and symbols for best security.
Common Problems and Misconceptions
Several issues and myths surround Wi-Fi password commands:
- "I can’t find the password in netsh}"—the most common reason is that the network profile isn’t saved on that device (e.g., you connected but didn’t select "Connect automatically"), or the SSID contains special characters. Try running
netsh wlan show interfacesto confirm which network you’re currently on. - "The password isn’t working after I changed it"—ensure all devices are manually reconnecting (not just waiting for auto-reconnect), and double-check for hidden characters when retyping the password. Case sensitivity and keyboard layout (e.g., US vs. international) can cause mismatches.
- "Is there a Windows command to reset the router password?"—no. Router admin credentials are independent of Wi-Fi passwords and require direct router access. Commands like
netshoripconfigonly interact with your local device’s network settings. - Myth: "Using 'netsh' exposes passwords to anyone"—running
netsh wlan show profile name=* key=clearonly works for the currently logged-in user with admin rights. The saved profiles are encrypted and tied to the user’s Windows credentials.
Comparing Platform-Specific Methods
Each major platform handles Wi-Fi password retrieval differently, reflecting their underlying security models:
- Windows: Command-line friendly, but requires admin privileges to view saved passwords. Best for IT admins managing multiple PCs.
- macOS: Relies on Keychain Access; no one-line terminal command works reliably for Wi-Fi PSKs. Designed to keep passwords isolated from casual terminal access.
- Android: No built-in command or setting to view saved Wi-Fi passwords. You must go to Settings > Network & Internet > Wi-Fi > Saved Networks, select a network, and tap "Share" (requires screen unlock and biometric/Face/Pattern verification). Rooting allows third-party apps to extract passwords, but this voids warranties and risks security.
- iOS/iPadOS: No native way to view passwords at all. Apple restricts access to keychain entries even for the device owner. If a device is already connected, you can share the Wi-Fi network to another Apple device via AirDrop, but you cannot extract the raw password.
Security Considerations and Best Practices
Using commands to view passwords is safe when done on trusted devices, but it carries risks if your system is compromised. Malware with admin privileges could potentially dump all saved Wi-Fi credentials. To stay secure:
- Only use these commands on devices you control and trust.
- Avoid changing your router’s default admin username/password unless necessary—but do change the Wi-Fi password if it’s weak or outdated.
- Use WPA3 if your router and devices support it; it’s more resistant to brute-force attacks than WPA2.
- Change your Wi-Fi password periodically (e.g., every 6–12 months) or after someone who had access leaves your household or workplace.
- Never share your Wi-Fi password with strangers or post it publicly—even on internal notes, as physical access to printed passwords can be exploited.
A related but important distinction: the router’s admin password and the Wi-Fi password are separate. If you forget the admin password, you can usually reset the router to factory defaults (holding the reset button for 10+ seconds), but this also erases your Wi-Fi settings and custom configurations. Always record both passwords in a secure password manager.
Frequently Asked Questions
Can I find my Wi-Fi password using Command Prompt if I’m not connected to that network?
Yes—if the network was previously saved (even if you’re currently connected to a different one), netsh wlan show profile name="SSID" key=clear will display its password. You don’t need to be actively connected.
Why does the password shown in netsh have extra characters or look wrong?
Typically, this happens if the SSID or password contains Unicode characters, or if the profile was created on a non-English keyboard layout. Try retyping the password on the device using the same keyboard layout used during the original setup.
Is there a universal command that works on all operating systems?
No. Each OS (and even versions within an OS) has different security policies and APIs. Linux commands (e.g., nmcli for NetworkManager) can retrieve Wi-Fi passwords, but they require the NetworkManager service and vary by distribution.
Can I recover a forgotten Wi-Fi password without admin rights on Windows?
Not via command line. However, if you’re logged into a Microsoft account, you may be able to sync Wi-Fi profiles across devices via Settings > Accounts > Sync your settings, though this is not guaranteed for all enterprise or locked-down environments.
What happens if I change the Wi-Fi password on the router—do connected devices automatically update?
No. All previously connected devices will lose connectivity and must be manually reconnected using the new password. Some routers offer a "reconnect all devices" option, but this still requires re-entering the password on each device or using a QR code (if supported).
Is there a way to see the Wi-Fi password on a printer or smart TV that saved it?
Almost never. Most IoT devices store credentials in proprietary, read-only firmware. You’d need to use the device’s setup process again or check its web interface (if available), but even then, passwords are rarely displayed. The only reliable method is to check the device that originally set up the network (e.g., your phone or PC).