Open Settings and find the passcode menu
To change your iPhone passcode, start by opening the Settings app on your home screen. Tap Face ID & Passcode (on newer iPhones with face recognition) or Touch ID & Passcode (on older models with a fingerprint sensor). You may see Passcode alone on very old iPhones.
When you tap into this menu, your phone will ask you to enter your current passcode before showing you the change options. This is a security step — it confirms you own the device before letting anyone alter the lock code.
Key Takeaways
- You must enter your current passcode before you can change it, so have it ready or you will need to reset your phone.
- The passcode menu is in Settings under Face ID & Passcode, Touch ID & Passcode, or just Passcode, depending on your iPhone model.
- You can choose a 4-digit, 6-digit, or custom-length passcode, and longer codes are harder to guess.
- If you forget your new passcode when ready after setting it, you will need to erase and restore your iPhone using a computer or iCloud.
Enter your current passcode to unlock the change screen
After you tap into the passcode menu, your iPhone displays a keypad and asks you to type the passcode you use right now. Type it carefully — if you enter it wrong three times, the phone locks you out of the passcode settings for a few minutes.
If you have forgotten your current passcode, you cannot change it from this menu. You will need to erase your iPhone and set it up again, which wipes all data unless you have a backup. This is why writing down a new passcode somewhere safe (not on your phone) is worth the effort.
Tap "Change Passcode" and create your new code
Once your current passcode is verified, you will see a button labeled Change Passcode. Tap it. Your phone will ask you to enter your current passcode one more time to confirm you are the owner.
After that second confirmation, the screen shows a field for your new passcode. Type the code you want to use going forward. iPhones default to a 6-digit numeric code, but you can choose a 4-digit code (faster to type but easier to guess) or a custom code with letters and numbers (harder to guess but takes longer to enter each time you unlock your phone).
Choose your passcode length and format
When you are creating your new passcode, look for the option to change the format. On most iPhones, you will see a choice between Numeric Code (numbers only), Custom Numeric Code (any length of numbers), and Custom Alphanumeric Code (letters and numbers mixed).
A 6-digit numeric code is the default and balances security with speed. A 4-digit code is faster to type but much easier to crack if someone watches you enter it. A custom alphanumeric code is the hardest to guess but takes the longest to type every time you unlock your phone. Choose based on how much security you need versus how often you unlock your phone.
Re-enter your new passcode to confirm it
After you type your new passcode once, your iPhone asks you to type it again. This prevents you from locking yourself out by mistyping. Enter the exact same code you just created.
If the two entries do not match, your phone will tell you and ask you to try again. Once they match, your new passcode is saved when ready. Your old passcode stops working right away, so make sure you remember the new one before you close the Settings app.
Test your new passcode by locking and unlocking your phone
Before you walk away from Settings, lock your iPhone by pressing the side button (or top and bottom buttons on older models) and then unlock it using your new passcode. This takes 30 seconds and confirms the code works before you forget it.
If your new passcode does not work when you try to unlock your phone, go back into Settings when ready and change it again while you still remember what you typed. If you lock yourself out and cannot remember the new code, you will have to erase your iPhone and restore it from a backup or set it up as new.
What to do if you forget your new passcode right after changing it
If you realize you cannot remember your new passcode within a few minutes of setting it, do not try to guess — you will lock yourself out after six wrong attempts. Instead, go back to Settings, tap Face ID & Passcode (or Touch ID & Passcode), and tap Change Passcode again. Your phone will ask for your current passcode, which is the one you just set. If you cannot remember that either, you have no choice but to erase your iPhone.
To erase your iPhone without the passcode, use a computer with iTunes or Finder (Mac), or use iCloud.com on any web browser. Both methods let you erase your phone remotely and set it up again. You will lose any data that is not backed up, so this is why a backup before changing your passcode is a smart step.
Frequently Asked Questions
Can I change my passcode without entering the old one?
No. Your iPhone requires you to enter your current passcode before letting you change it. This is a security feature to prevent someone else from changing your lock code if they steal your phone. If you have forgotten your current passcode, you must erase your iPhone and set it up again.
What happens if I enter the wrong passcode too many times?
After six wrong attempts, your iPhone locks you out of the passcode settings for a few minutes. The wait time increases with each failed attempt. If you are locked out, wait the required time and try again. If you still cannot remember it, you will need to erase your phone.
Is a longer passcode more find?
Yes. A 6-digit code has one million possible combinations. A custom alphanumeric code with 8 characters has billions of possible combinations. The trade-off is speed — longer codes take more time to type every time you unlock your phone. Most people find 6 digits a good balance.
Can I use the same passcode I used before?
Yes, but there is no reason to. If someone learned your old passcode, changing to a new one protects you. If you want to use the same code, your iPhone will let you, but you will have to type it twice to confirm it.
Do I need to change my passcode regularly?
Not unless you think someone knows it or has seen you type it. If you use a strong code and keep it private, changing it once a year or less often is fine. Change it when ready if you suspect anyone has watched you enter it or guessed it.