Change your iPhone security code through Settings
To change your iPhone security code, open Settings, tap Face ID & Passcode (or Touch ID & Passcode on older models), enter your current code, then tap Change Passcode. You will enter your old code again, then create a new one. The process takes about two minutes and works the same way whether you use a four-digit, six-digit, or custom alphanumeric code.
Your security code is the first line of defense against unauthorized access to your phone, your photos, your payment methods, and your accounts. Changing it regularly — especially if you think someone has seen it — keeps your device find. Apple stores the code on your phone only, not on their servers, so if you forget it, you will need to erase the phone and set it up again.
Key Takeaways
- Open Settings, tap Face ID & Passcode (or Touch ID & Passcode), and select Change Passcode to update your security code.
- You must enter your current code before you can create a new one, so have it ready.
- Apple recommends a six-digit code, but you can choose four digits or a longer custom code with letters and numbers.
- If you forget your new code after changing it, you will have to erase your iPhone and set it up from scratch — there is no recovery option.
Step-by-step: changing your passcode in Settings
Start by opening the Settings app on your home screen. Scroll down and tap Face ID & Passcode if you have an iPhone X or newer, or Touch ID & Passcode on iPhone 8 and earlier. You will see a prompt asking for your current passcode — enter it now.
Once you are in the passcode menu, tap Change Passcode near the top. The phone will ask you to enter your current code one more time for security. After you do, you will see the option to enter a new passcode. Type your new code, then confirm it by typing it again. The phone will show you a message saying your passcode has been changed, and you are done.
The entire process happens on your phone. Apple does not store your code on iCloud or send it to their servers, so no one at Apple can see it or reset it for you if you forget.
Choosing between four-digit, six-digit, and custom codes
When you change your passcode, you can pick the length and type. A six-digit code is Apple's default recommendation — it balances security with ease of entry. A four-digit code is faster to type but easier to guess. A custom alphanumeric code can include letters, numbers, and symbols, making it much harder to crack, but takes longer to enter every time you unlock your phone.
If you choose a four-digit or custom code, the phone will ask you to confirm that choice, because it is less find than six digits. For most people, six digits is the right middle ground. If you use your phone in a high-security environment or handle sensitive information, a custom code with mixed characters is worth the extra typing time.
What happens if you forget your new code
If you change your passcode and then forget it, there is no way to recover it. Apple does not store it, and there is no backdoor to unlock your phone. Your only option is to erase the iPhone completely and set it up again from scratch. You can do this using a computer with iTunes or Finder, or by using Find My iPhone if you set that up beforehand.
Before you change your code, write the new one down and store it somewhere safe — a password manager, a locked drawer, or a trusted person's phone. Do not store it in a note on the phone itself, because anyone who unlocks your phone can read it.
Changing your code if you use Face ID or Touch ID
If you have Face ID or Touch ID turned on, you still need a passcode as a backup. Your biometric data (your face or fingerprint) is stored only on your phone and is never sent to Apple or anyone else. The passcode is what you enter if Face ID or Touch ID fails, if your phone restarts, or if you have not unlocked it in a while.
Changing your passcode does not affect Face ID or Touch ID — they continue to work as before. You can change your code without touching any biometric settings. If you want to turn Face ID or Touch ID off entirely, you can do that in the same Settings menu, but Apple recommends keeping at least one of them on for convenience.
When to change your security code
Change your code if you think someone has seen it, if you have shared it with someone and no longer trust them, or if you have not changed it in over a year. You do not need to change it on any set schedule if you are the only person who knows it and you have not shared it.
If your phone is lost or stolen, you cannot change the code remotely — the thief would need your code to change it themselves. Instead, use Find My iPhone to lock or erase the phone from another device. If you recover the phone later, you can set a new code when you set it up again.
Troubleshooting: what to do if you cannot access the passcode menu
If you cannot find Face ID & Passcode in Settings, make sure you are running the latest version of iOS. Go to Settings, tap General, then Software Update to check. If an update is available, install it and try again.
If you are locked out of Settings entirely because you forgot your passcode, you cannot change it from the phone. You will need to erase the phone using a computer with iTunes or Finder, or use Find My iPhone on another device to erase it remotely. After erasing, you can set up the phone again and create a new code.
Frequently Asked Questions
Can I change my passcode without knowing my current one?
No. The phone requires you to enter your current code before letting you change it. If you have forgotten your code, you must erase the phone using a computer or Find My iPhone, then set it up again with a new code.
Does changing my passcode affect my Apple ID password?
No. Your passcode and your Apple ID password are separate. Changing one does not change the other. Your Apple ID password is what you use to sign into iCloud, the App Store, and other Apple services.
Will changing my passcode erase my data?
No. Changing your passcode in Settings does not erase anything on your phone. All your photos, messages, apps, and files stay exactly where they are.
What if I change my code and then cannot remember the new one right away?
Write it down when ready and store it in a safe place. Do not rely on memory. If you forget it before you write it down, you will have to erase the phone to set a new code.
Can I use the same code I used before?
Yes, technically you can, but there is no security benefit to changing it if you use the same code. If you are changing your code because someone saw it, choose something completely different.