Forgot Your iPhone Passcode? Here’s What to Do
“I forgot my passcode and now I can’t get into my iPhone. What do I do?” It’s one of the most common questions we get. Here’s how to get back in, starting with the option that doesn’t erase anything.
The short version
- Just changed your passcode? For 72 hours you can still unlock with your old passcode and set a new one. Nothing is erased.
- Otherwise, the iPhone must be erased. Apple doesn’t offer any way to recover a forgotten passcode without erasing the phone. You can then restore your data from an iCloud or computer backup.
- You’ll need your Apple Account password (formerly Apple ID) to reset the iPhone and to set it up again afterward.
Before you start
Keep trying the passcodes you might have used. There’s no other way to get in without erasing the iPhone. After too many wrong attempts, your iPhone shows an iPhone Unavailable or Security Lockout screen with a timer. On older versions of iOS, the screen said iPhone is disabled.
If you do need to erase it, your photos, messages, and other data can come back only if you have a backup. Many people have iCloud Backup turned on without realizing it, so check after you reset.
Option 1: Use your old passcode (if you changed it in the last 72 hours)
This works on iOS 17 and later.
- Enter a wrong passcode until the iPhone Unavailable screen appears.
- Tap Forgot Passcode? at the bottom of the screen.
- Tap Enter Previous Passcode, type your old passcode, and follow the steps to set a new one.
Option 2: Reset the iPhone from the lock screen (no computer needed)
This works on iOS 15.2 and later. Your iPhone must be connected to Wi-Fi or cellular, and you need your Apple Account password.
- Enter a wrong passcode until the iPhone Unavailable or Security Lockout screen appears.
- Tap Forgot Passcode? (on iOS 15.2–16, tap Erase iPhone).
- Tap Start iPhone Reset to confirm.
- Enter your Apple Account password to sign out of your account on the device. If you use an eSIM, choose whether to keep it or delete it.
- The iPhone erases itself and restarts. Follow the on-screen steps to set it up, restore from a backup, and choose a new passcode.
Option 3: Restore the iPhone with a computer (recovery mode)
Use this if you don’t see the reset option, your iPhone isn’t connected to the internet, or you’re on an older version of iOS. You’ll need a Mac or Windows PC, a charging cable, and up to an hour.
- Get the software ready. On a Mac with macOS Catalina or later, you’ll use the Finder. On an older Mac, use iTunes. On a Windows PC, install the Apple Devices app from the Microsoft Store. On older Windows versions, use iTunes.
- Turn off the iPhone and make sure it isn’t plugged into the computer.
- iPhone with Face ID (no Home button): press and hold the side button and either volume button until the power-off slider appears, then drag it.
- iPhone with a Home button: press and hold the side button (or the top button on older models) until the power-off slider appears, then drag it.
- Hold the correct button and, while still holding it, plug the iPhone into the computer:
- iPhone 8 and later (including iPhone SE 2nd and 3rd generation): the side button
- iPhone 7 and 7 Plus: the volume down button
- iPhone 6s and earlier, and iPhone SE (1st generation): the Home button
- Keep holding until the recovery mode screen appears on the iPhone, showing a computer and a cable. If you see the passcode screen instead, turn the iPhone off and try again.
- On the computer, find your iPhone in the Finder sidebar, the Apple Devices app, or iTunes. When asked, choose Restore (not Update).
- Wait for the computer to download the software and restore the iPhone. If the download takes more than 15 minutes, the iPhone may leave recovery mode. Let the download finish, then repeat steps 2–5.
- When it’s done, unplug the iPhone and set it up. Restore your data from a backup, and sign in with your Apple Account.
For the full official instructions, see Apple’s guides to resetting a forgotten passcode without a computer and using a computer to reset your iPhone.
How to avoid this next time
- Use your passcode now and then. Face ID and Touch ID make it easy to forget, and your iPhone will still ask for the passcode after a restart or a few days without using it.
- Write it down somewhere safe, or store it in a password manager.
- Turn on iCloud Backup in Settings › [your name] › iCloud › iCloud Backup, so a reset never costs you your photos and messages.
- Know your Apple Account password. You’ll need it to reset and set up your iPhone again.
If you’re new to the iPhone, a beginner guide such as the iPhone Manual for Beginners walks through passcodes, Face ID, and backups step by step.
Frequently asked questions
Can I unlock my iPhone without losing data if I forgot the passcode?
Only if you changed your passcode within the last 72 hours and are on iOS 17 or later, in which case you can use your old passcode. Otherwise, you have to erase the iPhone and restore your data from a backup.
What does “iPhone Unavailable” mean?
It means the wrong passcode was entered too many times. Wait for the timer and try again. If you’ve forgotten the passcode, use the Forgot Passcode? option to reset the iPhone.
Can an Apple Store unlock my iPhone?
Apple can’t unlock a phone without erasing it. An Apple Store or authorized service provider can help you erase and restore it, and you’ll need proof of purchase if you don’t know the Apple Account password.
Do I still need iTunes to reset my iPhone?
Not on current computers. Macs running macOS Catalina or later use the Finder, and Windows PCs use the Apple Devices app. iTunes is needed only on older computers.