How to Generate QR Codes for Saved Wi-Fi Passwords on iPhone
In this article
You can generate a QR code for a saved Wi-Fi password on iPhone without jailbreaking or third-party apps by using the built-in Shortcuts app and a simple shortcut that reads the network’s password from your keychain and converts it into a QR code. This lets guests join your network by scanning the code instead of typing the password. You’ll need iOS 12 or later (Shortcuts is preinstalled on iOS 13 and later), the name of the Wi-Fi network, and permission to share that password. The steps below use the Shortcuts app and the built-in “Get Wi-Fi Password” action, which is available on iOS 16 and later; on earlier versions you can still create a QR code manually if you know the password.
What You’ll Need
- An iPhone running iOS 16 or later (for the automatic password retrieval action).
- The Shortcuts app (preinstalled; if missing, download it free from the App Store).
- The name of the Wi-Fi network you want to share (exact spelling and capitalization).
- The Wi-Fi password, in case you need to enter it manually.
- Optional: a QR code scanner app on the guest’s phone (the built-in Camera app works on iOS 11 and later).
Step-by-Step
- Open the Shortcuts app. Tap the Shortcuts icon on your Home Screen or find it in the App Library. If you deleted it, reinstall it from the App Store.
- Create a new shortcut. Tap the “+” button in the top-right corner (or “Create Shortcut” on older versions) to start a blank shortcut.
- Add the “Get Wi-Fi Password” action. Tap “Add Action,” then search for “Get Wi-Fi Password.” Select the action that appears under “Scripting” or “Network.” This action retrieves the password for a saved network from your keychain. Note: menu labels and action names can differ slightly by iOS version.
- Configure the action. Tap the “Network” field in the action and type the exact name of your Wi-Fi network. If you’re not sure, go to Settings > Wi-Fi and note the name next to the checkmark.
- Add a “Text” action. Tap “Add Action” again, search for “Text,” and add it. In the text field, type the standard Wi-Fi QR code format:
WIFI:T:WPA;S:YourNetworkName;P:YourPassword;;— replace “YourNetworkName” and “YourPassword” with your actual details. Do not add spaces. For open networks, useT:nopassand omit the password. - Insert the retrieved password (optional but recommended). Instead of typing the password manually, you can use the “Get Wi-Fi Password” action’s output as a variable. Tap inside the Text action, tap “Insert Variable,” and choose the “Wi-Fi Password” from the previous action. This ensures the correct password is used even if you change it later.
- Add a “Generate QR Code” action. Tap “Add Action,” search for “Generate QR Code,” and add it. The action will automatically use the text from the previous step as input. If it doesn’t, tap the “Text” field in the action and select the Text action’s output.
- Add a “Quick Look” action. Tap “Add Action,” search for “Quick Look,” and add it. This lets you preview the QR code before sharing. Connect the QR code output to Quick Look if needed.
- Name and save the shortcut. Tap the shortcut’s name at the top (likely “New Shortcut”) and rename it something like “Wi-Fi QR.” Tap “Done.”
- Run the shortcut. Tap the shortcut to run it. The first time, iOS may ask for permission to access your Wi-Fi password; tap “Allow.” A QR code will appear in a Quick Look preview.
- Share or save the QR code. In the Quick Look preview, tap the share icon (square with an arrow) to save the image to Photos, AirDrop it, or print it. Guests can scan it with their Camera app to join the network.
Common Mistakes
- Typing the network name incorrectly. The “Get Wi-Fi Password” action requires the exact SSID, including capitalization and spaces. Check Settings > Wi-Fi for the precise name.
- Using the wrong security type. Most home networks use WPA/WPA2, which is represented by
T:WPAin the QR code string. If your network uses WEP (rare), useT:WEP. For open networks, useT:nopassand omit the password. - Forgetting the double semicolon at the end. The QR code string must end with two semicolons (
;;). Missing one will make the code invalid. - Including extra spaces. Spaces in the network name or password are fine, but do not add spaces around the semicolons or after the colon.
- Not granting permission. If you deny the shortcut access to your Wi-Fi password, the action will fail.
- Assuming the QR code works on all devices. Older Android phones may need a dedicated QR scanner app, and some may not support the Wi-Fi QR format natively.
Tips
- Test the QR code with your own phone before sharing it with guests. Use the Camera app to scan it and confirm it connects.
- If you frequently share your Wi-Fi, add the shortcut to your Home Screen for quick access: in the Shortcuts app, tap the shortcut’s ellipsis (…) and choose “Add to Home Screen.”
- For networks with hidden SSIDs, the QR code format includes
H:true;after the password:WIFI:T:WPA;S:NetworkName;P:Password;H:true;;. - You can also create a QR code manually using a free online generator, but be cautious about entering your Wi-Fi password on third-party sites. The Shortcuts method keeps everything on your device.
- If you change your Wi-Fi password later, re-run the shortcut to generate a new QR code; the old one will no longer work.
Troubleshooting
If the shortcut doesn’t work as expected, try these steps in order:
- Check iOS version. The “Get Wi-Fi Password” action requires iOS 16 or later. On older versions, you must type the password manually into the Text action.
- Verify the network name. Ensure the SSID in the action matches exactly. You can copy it from Settings > Wi-Fi.
- Re-grant permissions. If not, toggle it on.
- Restart your iPhone. A simple restart can resolve temporary glitches with Shortcuts or keychain access.
- Recreate the shortcut. Delete the problematic shortcut and build it again from scratch, following the steps carefully.
- Test with a different network. If it works with another network, the issue may be with the original network’s password or security type.
- Update iOS. Go to Settings > General > Software Update and install any available update. Apple occasionally fixes Shortcuts bugs in updates.
If the QR code scans but doesn’t connect, double-check the password and security type in the string. For WPA3 networks, use T:WPA as well; most devices treat WPA3 as WPA for QR purposes. If problems persist, consider using a third-party QR generator that supports Wi-Fi codes, but only from a reputable developer.
Frequently Asked Questions
Can I generate a QR code for a Wi-Fi password without the Shortcuts app?
Yes, you can use a free online QR code generator that supports Wi-Fi networks, but you’ll need to type the password manually. Be cautious about entering sensitive information on third-party sites. The Shortcuts method is safer because it stays on your device.
Does this work on iPad?
Yes, the Shortcuts app and the “Get Wi-Fi Password” action are available on iPadOS 16 and later. The steps are the same.
Why does the “Get Wi-Fi Password” action show an error?
Common causes include an incorrect network name, missing permissions, or an iOS version older than 16. Ensure the SSID is exact and that you’ve allowed access when prompted.
Can I share the QR code with someone on Android?
Yes, most Android phones can scan Wi-Fi QR codes using the built-in Camera app or Google Lens. However, very old Android versions may not support it natively.
Is it safe to share a QR code of my Wi-Fi password?
Anyone with the QR code can join your network, so only share it with trusted people. Avoid posting it publicly. If you need to revoke access, change your Wi-Fi password and generate a new QR code.
What if my network uses a hidden SSID?
Add H:true; to the QR code string after the password, like this: WIFI:T:WPA;S:NetworkName;P:Password;H:true;;. This tells the device the network is hidden.