If you are connected to a Wi-Fi network but forgot the password, you might think you need to reset the router or download a third-party password recovery tool.

You don't.

Windows stores Wi-Fi passwords locally on your computer. With two simple commands in the Command Prompt, you can reveal the password for any network your PC has ever connected to—no extra software required.

Here is exactly how to do it in under 30 seconds.

Step 1: Open Command Prompt as Administrator

You must run the terminal as an administrator, or Windows will block the command.

  1. Press the Windows Key.
  2. Type cmd.
  3. Right-click on Command Prompt and select Run as administrator.
  4. Click Yes if a User Account Control prompt appears.

Step 2: See all saved Wi-Fi networks

Once the black terminal window is open, type this exact command and press Enter:

netsh wlan show profiles

You will see a list of every Wi-Fi network your computer has ever connected to under the "User Profiles" section. Find the name of the network you need the password for (for example, "Home_WiFi" or "Office_5G").

Step 3: Reveal the password

Now, type the following command, but replace YOUR_WIFI_NAME with the exact name of the network you found in Step 2.

netsh wlan show profile name="YOUR_WIFI_NAME" key=clear

For example, if your network is called "Home_WiFi", you would type:

netsh wlan show profile name="Home_WiFi" key=clear

Press Enter.

Step 4: Read the "Key Content"

A long list of network details will appear. Scroll down to the section called Security settings.

Look for the field labeled Key Content.

The text next to it is your Wi-Fi password.

Why this works

When you connect to a Wi-Fi network, Windows saves the SSID (the name) and the password (the key) to your local registry so it can automatically reconnect next time. This command simply asks Windows to read that saved data and display it on your screen.

It's completely safe, works entirely offline, and is built right into your operating system.

What if it says "Access is denied"?

If you see an error, it means you didn't open Command Prompt as an Administrator. Close the terminal, repeat Step 1, and make sure you approve the admin prompt.

Never use third-party "Wi-Fi hacker" apps from the internet—they are often malware. The built-in Windows command is the fastest and safest way to recover a saved password.