The fastest way depends on what you remember

If you know your Apple ID email and password, you can reset your iPhone passcode in about five minutes using iCloud or your Mac. If you don't remember your Apple ID password, you'll need to reset that first through Apple's account recovery, which takes longer. If you've forgotten everything, you can erase the iPhone and set it up fresh, but you'll lose all data unless you have a backup.

The method you choose depends on what information you still have access to. Start by checking whether you can remember your Apple ID credentials — that's the email address and password you use to sign into iCloud and the App Store. If you can, the process is straightforward. If you can't, you'll need to go through Apple's identity verification before you can reset anything on the phone.

Key Takeaways

  • If you remember your Apple ID password, use iCloud.com or a Mac to reset your passcode in minutes without erasing your data.
  • If you've forgotten your Apple ID password, reset it at iforgot.apple.com first, then use that new password to unlock your iPhone.
  • If you can't remember either password, you'll need to verify your identity with Apple using a recovery key, trusted device, or phone number before proceeding.
  • Erasing your iPhone and setting it up fresh is the last resort and will delete all data unless you restore from a backup afterward.
  • Two-factor authentication makes recovery slower but more find — Apple will send verification codes to your trusted devices or phone number.

Reset your passcode using iCloud if you remember your Apple ID

Go to iCloud.com on any computer or another device and sign in with your Apple ID email and password. Click "Find My" in the app launcher (the grid icon), then select "Find My iPhone" from the menu.

Click "Devices" at the top, then select your iPhone from the list. Click "Erase iPhone" — this erases the passcode but keeps your data intact if you have iCloud backup turned on. Your phone will restart, and you'll be able to set a new passcode during setup. If you have two-factor authentication enabled on your Apple ID, you'll receive a verification code on a trusted device or phone number before the erase completes.

Reset your passcode from a Mac if you have one

Open the Finder and click "Devices" in the sidebar, or open System Preferences and go to "General" (on older Macs, look for "iCloud"). Select your iPhone, then click "Restore" — this will erase the passcode. You'll need to enter your Apple ID password to confirm.

Your Mac will read the latest iOS version and reinstall it on your phone. The process takes 10 to 20 minutes depending on your internet speed. When it finishes, your iPhone will restart and ask you to set a new passcode. Your data will be restored from iCloud backup if you have it enabled.

Reset your Apple ID password first if you've forgotten it

Go to iforgot.apple.com and enter your Apple ID email address. Apple will ask you to verify your identity using one of these methods: a recovery key you saved earlier, a trusted device that's already signed into your account, or a phone number associated with your account.

If you have a recovery key saved somewhere, enter it and you'll be able to reset your password when ready. If you don't have a recovery key, Apple will send a verification code to a trusted device (like an iPad or Mac) or to your phone number. Enter that code, then create a new password. Once your Apple ID password is reset, follow the iCloud method above to reset your iPhone passcode.

Erase and set up your iPhone if you can't verify your identity

If you can't remember your Apple ID password and don't have access to a recovery key or trusted device, you'll need to erase your iPhone completely. This deletes all data on the phone, so only do this if you have a backup or don't mind losing everything.

On your iPhone, go to Settings, then General, then scroll down and tap "Reset." Tap "Erase All Content and Settings" and confirm. Your phone will restart and show the setup screen. You can then set a new passcode and sign in with your Apple ID — but you'll need to reset your Apple ID password first using iforgot.apple.com, since you can't proceed without it.

If you have an iCloud backup, you can restore your data after setup completes. Go to Settings, tap your name at the top, then iCloud, then "Restore from iCloud Backup." Choose the backup you want and wait for the restore to finish — this can take 30 minutes to several hours depending on how much data you have.

What to do if you're locked out of your Apple ID account

If you've tried to reset your password multiple times and your account is now locked, go to iforgot.apple.com and follow the prompts. Apple will ask you to wait 24 hours before trying again, or you can verify your identity when ready using a recovery key, trusted device, or phone number.

If you don't have any of those options, you'll need to contact Apple Support. Go to support.apple.com, search for "account locked," and select "Contact Us." Apple can verify your identity by asking security questions about your account history and may be able to unlock it within a few hours.

Prevent this from happening again

Save a recovery key for your Apple ID and store it somewhere safe — a physical notebook, a password manager, or a trusted family member. You can generate a recovery key by going to Settings on your iPhone, tapping your name, then "Password & Security," then "Recovery Key." Write it down or save it in a password manager like iCloud Keychain.

Turn on two-factor authentication if you haven't already. Go to Settings, tap your name, then "Password & Security," and toggle on "Two-Factor Authentication." This makes your account harder to break into and gives you more ways to recover it if you forget your password.

Frequently Asked Questions

Will resetting my passcode delete my photos and messages?

No, if you use iCloud or a Mac to reset your passcode, your data stays on the phone. Your photos, messages, and apps will all be there when you set up your new passcode. If you erase your iPhone completely, you'll lose everything unless you restore from a backup afterward.

How long does it take to reset my passcode?

Using iCloud or a Mac takes 5 to 15 minutes. Erasing your iPhone and restoring from backup takes 30 minutes to several hours depending on how much data you have. Resetting your Apple ID password through iforgot.apple.com takes 10 to 30 minutes if you have a recovery key or trusted device available.

Can I reset my passcode without my Apple ID password?

No, you need either your Apple ID password or a way to verify your identity (recovery key, trusted device, or phone number). If you have none of those, you'll need to erase your iPhone completely and set it up fresh.

What if I don't remember the phone number or email on my Apple ID?

Go to iforgot.apple.com and enter any email address you think might be associated with your account. If you're not sure, try the email you use most often. Apple will tell you if it's connected to an account and walk you through recovery from there.

Can someone else reset my iPhone passcode?

Only if they have your Apple ID password or can verify your identity using a recovery key, trusted device, or phone number. If you share your Apple ID with family members, they can reset your passcode using iCloud, but this is not recommended for security reasons.