Dark mode switch icon Light mode switch icon

Extract Saved WiFi Passwords from the macOS Keychain

1 min read
Old Post
This post is over two years old. Content may be out of date.

You can extract saved wifi passwords from the macOS Keychain using the security command:

security find-generic-password -ga "<SSID HERE>" | grep password:

Simply replace <SSID HERE> with the name of the WiFi network in question:

security find-generic-password -ga "Smith Home WiFi" | grep password:

You’ll be prompted for an administrator’s username and password, and then the WiFi network password will be revealed:

password: "ForgetM3N0t"

Gist on GitHub

Originally published on by Lucas Cantor