Forgot your home or office Wi-Fi password, but your MacBook or iMac Already connected to the network? The situation is familiar to many: the router has been configured for a long time, the password sticker has worn off, and guests or a new device need to connect. Luckily, in macOS There are several ways to extract a saved password, from standard tools to hidden commands in Terminal.
In this article we will look at 5 working methods, including the visual interface, console commands, and third-party utilities. All instructions are relevant for the latest versions of macOS (Ventura, Sonoma, Monterey) and tested on models MacBook Pro/Air (M1/M2/Intel), iMac And Mac miniIf you use older versions of macOS (before Catalina), some steps may differ - we will warn you about this separately.
Before you begin, make sure your Mac is already connected to the target Wi-Fi network. If the connection is lost, none of these methods will work—the system simply has nowhere to retrieve the data. Also remember: password extraction is only possible for networks you've previously connected to on this device.
1. Standard method: via Keychain Access
The most reliable and universal method is to use the built-in utility "Bunch of keys" (Keychain Access). It stores all saved passwords, including Wi-Fi network data. These instructions are suitable for all versions of macOS, starting with OS X Lion.
To find your password:
- Open
Spotlight(clickCommand + Space) and enterBunch of keys, then select the application. - In the left menu, select
System(orLocal elements, if you use iCloud Keychain). - In the search bar, enter the name of your Wi-Fi network (SSID name).
- Double-click on the found entry and check the box.
Show password. - Enter your account password macOS (the one you use to log in).
After this, a field with the Wi-Fi password will appear. You can copy it or write it down.
Make sure your Mac is connected to the correct Wi-Fi network|
Verify that you have administrator rights on this Mac|
Remember your macOS account password (you will need it)|
If you use iCloud Keychain, your data can be synced across other devices.
-->
⚠️ Attention: If you are not an administrator on this Mac, the system will not display the password - you will need to enter the credentials of an account with privileges. sudo. Also some corporate networks (with certificates 802.1X) may not display the password in the keychain.
2. Quick way: via System Preferences (macOS Ventura and later)
In the latest versions of macOS (Ventura 13.0+ And Sonoma 14.0+) Apple has added a simplified way to view the password directly in the network settings. This method only works for active connection and does not show passwords for previously saved networks.
Instructions:
- Open
System Preferences(gear icon in the Dock or viaSpotlight). - Go to the section
Net→ selectWi-Fiin the left menu. - Click on the button
Additionally…in the lower right corner. - In the window that opens, select the tab
Wi-Fi. - Find your network in the list
Well-known networksand click on it. - Check the box
Show passwordand enter your macOS account password.
This method is convenient because it doesn't require searching through your keychain, but it's only suitable for the current connection. If you need the password for a network you've connected to before, use the method with "With a bunch of keys"**.
3. Advanced Method: Terminal Command
If you prefer to work through the console or standard methods do not work, you can extract the password using TerminalThis method is universal and works on all versions of macOS, including older ones.
Open Terminal (through Spotlight or folder Utilities) and run the command:
security find-generic-password -wa "YOUR_NETWORK_NAME"
Replace YOUR NETWORK NAME on real SSID (Wi-Fi name). For example, if the network is called MyHomeWiFi, the command will be:
security find-generic-password -wa "MyHomeWiFi"
After entering the password, the system will ask for your macOS account password. Enter it, and the following line will appear in the terminal: password: "your_password".
4. Alternative method: viewing the configuration file
In macOS, Wi-Fi network data is stored in system configuration files. These can be read via Terminal, but this method requires caution - incorrect actions can disrupt the network.
Instructions:
- Open
Terminal. - Run the command to view the list of saved networks:
defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences | grep "SSIDString" - Find the name of your network in the output (for example,
SSIDString = "MyHomeWiFi"). - Run the command to extract the password (replace
MyHomeWiFito your SSID):security find-generic-password -D "AirPort network password" -a "MyHomeWiFi" -g
This method is less convenient than the previous ones, but can be useful if standard methods do not work (for example, due to a damaged keychain).
⚠️ Attention: Modifying or deleting files in /Library/Preferences/SystemConfiguration/ This may cause network problems. Do not edit them manually without a backup!
5. Third-party utilities: WiFi Password Revealer and similar
If you need to extract passwords regularly or standard methods haven't worked, you can use third-party programs. They automate the process and often offer additional features (such as exporting a list of networks).
Popular utilities:
- 🔓 WiFi Password Revealer — a free app that displays all saved Wi-Fi passwords. Download from Mac App Store.
- 📡 Keychain Access Explorer — an advanced keychain viewer with a user-friendly interface.
- 🔍 Secrets — a paid utility for managing all passwords in macOS, including Wi-Fi.
Example of working with WiFi Password Revealer:
- Download and install the program from App Store.
- Launch the utility and enter your macOS account password.
- Find the required network in the list and copy the password.
The advantage of third-party utilities is that they often reveal passwords even for networks that aren't listed in the standard keychain (for example, after migrating data from another Mac).
What should I do if the utility doesn't show the password?
If a third-party program does not display the password, check:
1. Access rights: run the utility as administrator.
2. iCloud Keychain settings: If sync is enabled, data can be stored in the cloud.
3. Antivirus or firewall: They may block access to system files.
Comparison of methods: which one to choose?
Each of the described methods has its pros and cons. In the table below, we compare them based on key parameters:
| Method | Complexity | Admin rights required | Works for older networks | Compatible with macOS Monterey and later |
|---|---|---|---|---|
| Bunch of keys | ⭐ | Yes | Yes | Yes |
| System Preferences | ⭐ | Yes | No (current network only) | Yes |
Terminal (command security) |
⭐⭐ | Yes | Yes | Yes |
| Configuration file | ⭐⭐⭐ | Yes | Yes | Yes |
| Third-party utilities | ⭐ | Sometimes | Yes | Yes |
For most users, the optimal solution would be "Bunch of keys" or System Preferences (if you only need the current network). Method with Terminal Useful for advanced users or if standard methods don't work.
Common problems and their solutions
Sometimes users encounter difficulties when trying to retrieve a password. Let's look at typical situations and how to resolve them:
- 🔄 Password not showing in Keychain:
Make sure you're searching for the correct network name (SSID is case-sensitive!). If the network is corporate (with a certificate), the password may not be saved. Try the method with
Terminal. - 🔒 The system asks for an administrator password, but you don't know it:
Without administrator rights, it is impossible to retrieve the password. If this is your Mac, restore access via
Recovery mode(pressCommand + Rwhen loading). - 📡 The network is listed, but the password is empty:
The network may have been configured without a password (open) or is using WPSTry connecting again—sometimes macOS doesn't save the password the first time you connect.
- 🍎 This method does not work on macOS Catalina and later:
In older versions (before Mojave) The Keychain interface is different. Use
Terminalor update the system.
⚠️ Attention: On some corporate or public networks (hotels, airports), passwords may be encrypted with certificates or generated dynamically. In this case, it's impossible to extract them using standard methods—contact your network administrator.
FAQ: Answers to frequently asked questions
Is it possible to find out the password for the Wi-Fi that another Mac connected to?
Yes, but only if syncing is enabled on that Mac. iCloud KeychainIn this case, your passwords will be available on all your Apple devices. To check:
- Open
System Preferences→Apple ID→iCloud. - Make sure the item is enabled
iCloud Keychain. - Passwords sync automatically, but it may take some time.
Will it be visible that I looked at the Wi-Fi password?
No, you can view your password using standard macOS tools ("Bunch of keys" or System Preferences) leaves no traces in logging systems. However, if you are using a corporate Mac with MDM (device management), the administrator can monitor access to system utilities.
Is it possible to find out the Wi-Fi password on an iPhone if a Mac is connected to the same network?
Yes, if you have sync enabled. iCloud KeychainOn iPhone:
- Open
Settings→Wi-Fi. - Click on the ⓘ icon next to the network name.
- Click
Passwordand pass authentication (Face ID/Touch ID/password).
If syncing is disabled, the passcode on your iPhone will not be accessible.
What to do if none of the methods worked?
If standard methods don't help, try:
- Reconnect to the network (sometimes macOS saves the password only after reconnecting).
- Use Windows or Linux- the device that connected to this network (there are also ways to extract the password there).
- Reset your router settings (click the button)
Resetfor 10 seconds) and configure it again.
Is it possible to find out the password for my neighbors' Wi-Fi?
No, it is not possible legally. macOS only stores passwords for networks that you You Connected previously. Extracting passwords from other people's networks requires hacking, which is illegal (Article 272 of the Russian Criminal Code - "Unauthorized access to computer information").
If you need access to someone else's network, ask the router owner for the password.