WPA PSK calculator

Turn a Wi-Fi network name (SSID) and passphrase into the 256-bit WPA/WPA2 pre-shared key (PBKDF2-HMAC-SHA1, 4096 rounds), ready for wpa_supplicant.

loading WPA PSK calculator
About this tool

What is a WPA pre-shared key?

When you join a home or office Wi-Fi network protected by WPA or WPA2 Personal, you type a passphrase. The router and your device do not use that text directly. Both turn it into a 256-bit key called the pre-shared key (PSK), and the PSK is what protects the connection. The recipe comes from the IEEE 802.11i standard: PBKDF2 with HMAC-SHA1, using the network name (SSID) as the salt, 4096 rounds, and 32 bytes of output. That gives 64 hexadecimal digits.

Why would you want to see it? Mostly for configuration. On Linux, wpa_supplicant lets you write the 64-digit key in wpa_supplicant.conf instead of the passphrase, so the clear text is not stored in the file. Embedded systems, routers with custom firmware, test benches and some network tools also ask for the raw PSK. It is also a good way to learn how WPA works, or to check that two devices that "should" agree really derive the same key.

This page computes it in your browser. Type the SSID and the passphrase and you get the PSK, plus a snippet for wpa_supplicant.conf. Nothing is sent anywhere. The result is checked against the test vectors of the standard.

Two details matter. First, the SSID is part of the calculation: the same passphrase on two networks with different names gives two different keys, which is why precomputed tables are built for popular SSIDs. Second, the PSK is as sensitive as the password: anyone who has it can join the network. Treat it the same way. WPA3 uses a different handshake (SAE) and does not use this key, so the calculator applies to WPA and WPA2 only.

How to calculate the PSK

  1. Type the network name in Network name (SSID):. It can have 1 to 32 bytes, and it is case sensitive. The page opens with the standard example loaded (SSID IEEE, passphrase password).
  2. Type the passphrase in Passphrase (8 to 63 characters):. Use only printable ASCII: letters, digits and the usual symbols.
  3. Read the PSK, 64 hexadecimal digits: in the Pre-shared key result and copy it.
  4. Copy the block under For wpa_supplicant.conf: into the network={...} entry of your configuration.
  5. If you leave a field empty, the page says "Fill in the SSID and the passphrase." and shows no key.

Examples

The example of the standard

With the SSID IEEE and the passphrase password, the PSK is:

f42c6fc52df0ebef9ebb4b90b38a5f902e83fe1b135a70e23aed762e9710a12e

This is the first test vector of annex H.4 of IEEE 802.11i.

A second vector

With the SSID ThisIsASSID and the passphrase ThisIsAPassword:

0dc0d6eb90555ed6419756b9a15ec3e3209b63df707dd508d14581f8982721af

The longest case

With a passphrase of 32 letters a and an SSID of 32 letters Z:

becb93866bb8c3832cb777c2f559807c8c59afcb6eae734885001300a981cc62

This is the third vector of the standard. It shows that the longest SSID (32 bytes) works.

The key in a configuration file

In wpa_supplicant.conf the passphrase appears in quotes and the raw key does not:

network={
    ssid="IEEE"
    psk=f42c6fc52df0ebef9ebb4b90b38a5f902e83fe1b135a70e23aed762e9710a12e
}

Common mistakes

  • "The passphrase has {length} characters; WPA needs 8 to 63." The passphrase is too short or too long. Count the characters, and check for a missing or extra one.
  • "Character {position} of the passphrase is not printable ASCII. WPA passphrases use only letters, digits and symbols of the basic ASCII table." An accented letter, an emoji or a hidden control character is in the text. Replace it, and remember that the router needs the same text.
  • "The SSID takes {length} bytes; it must have 1 to 32 (accented letters use 2 or more)." The name is empty or too long. An SSID is counted in bytes, so a name with accents or emoji is longer than it looks.
  • A key that does not work on the router. Check the case of the SSID and of the passphrase, and trailing spaces. Some routers hide a name or use a different SSID per band.
  • Passing the 64 digits as the passphrase. A raw PSK goes without quotes in wpa_supplicant; with quotes it is read as a passphrase.
  • Expecting it to work on WPA3. WPA3-Personal uses SAE. A WPA2/WPA3 mixed network still accepts the PSK for the WPA2 side.

Frequently asked questions

Is it safe to type my Wi-Fi password here?

The page runs in your browser and sends nothing. Still, a Wi-Fi password is a secret, so do it on a device you trust and close the tab afterwards. You can also use the example from the standard to see how it works first.

Can the PSK be turned back into the passphrase?

Not directly. PBKDF2 is a one-way function. But the 4096 rounds are few by today's standards, so a weak passphrase can be found by guessing. Use a long random one: you can build one with the Diceware generator and rate it with the password strength analyser.

Why does the SSID change the key?

The SSID is the salt of the derivation. This makes the same passphrase give a different key on each network, and it stops one table of keys from working everywhere.

How do I share the network with a phone?

The key is for configuration files. To let people join by scanning, make a QR code with the Wi-Fi QR code generator.

The same calculation in code

Python

import hashlib

psk = hashlib.pbkdf2_hmac("sha1", b"password", b"IEEE", 4096, 32).hex()
print(psk)  # f42c6fc5...a12e

Bash

# prints the network block with the psk
wpa_passphrase IEEE password

JavaScript

import { pbkdf2Sync } from 'node:crypto';

const psk = pbkdf2Sync('password', 'IEEE', 4096, 32, 'sha1').toString('hex');
Report a problem