Tech & AI Journal November 27, 2026
Global Edition

How to Change iPhone Passcode: Known Code or Forgotten Code

• •
14 min read
How to Change iPhone Passcode: Known Code or Forgotten Code

How to Change iPhone Passcode?

To change your iPhone passcode, open Settings, tap Face ID & Passcode (or Touch ID & Passcode on an older model), enter your current passcode, tap Change Passcode, enter your current passcode again, then type your new passcode twice.

That route works only when you still know the current code. If you forgot your passcode, there is no way to recover the old code, so you have to erase the iPhone and set it up again, then restore your data from a backup if you have one. This guide covers both routes, so start with the one that matches your situation.

How Do I Change My iPhone Passcode When I Know the Current One?

Changing a passcode you still know takes less than a minute, and nothing on your iPhone is deleted in the process. Your photos, apps, messages, and settings all stay exactly where they are. You only need the current passcode and a new one you can remember.

  1. Open the Settings app on your iPhone.
  2. Scroll down and tap Face ID & Passcode. On an iPhone with a Home button, the same row is called Touch ID & Passcode.
  3. Enter your current passcode when the iPhone asks for it.
  4. Tap Change Passcode.
  5. Enter your current passcode again when asked.
  6. Type your new passcode. By default, the iPhone asks for a six-digit code.
  7. Type the new passcode a second time to confirm it.

That is the whole process. The change takes effect right away, and the new code is the one you will type the next time your iPhone asks for a passcode. For a second walkthrough of the same Settings route, How-To Geek’s guide to changing the passcode on your iPhone covers each step with screenshots. If you use Face ID or Touch ID, you will still type the passcode sometimes, because Apple requires it after you turn the iPhone on or restart it, after you have not unlocked the iPhone for more than 48 hours, and after five unsuccessful attempts to unlock it with Face ID or Touch ID.

What Passcode Options Can I Choose on iPhone?

When the new-passcode screen appears, look for Passcode Options just above the keypad. Tapping it shows four choices, and the one you pick decides how long and how complex your code can be.

Passcode option What it is Who it suits
6-Digit Numeric Code Six numbers, the default on iPhone Most people, because it balances security with quick typing
4-Digit Numeric Code Four numbers, shorter and quicker to type People who want the fastest unlock and accept a weaker code
Custom Numeric Code A number-only code of any length you choose People who want a longer code without letters
Custom Alphanumeric Code Letters and numbers mixed together People who want the strongest passcode option

Apple itself says the most secure options are Custom Alphanumeric Code and Custom Numeric Code, so if you want the strongest lock your iPhone offers, pick one of those two. A longer code is harder for someone to guess or watch over your shoulder, and it is also harder for you to forget, so choose a length you can type reliably.

What If I Just Changed My Passcode and Forgot the New One?

If you changed your passcode recently and the new one has already slipped your mind, you may not need to erase anything. On iOS 17 and later, a passcode you just replaced keeps working for 72 hours as a safety net, so your old code can still get you back in and let you set another new one.

  1. Enter wrong passcodes on the lock screen until the iPhone Unavailable screen appears.
  2. Tap Forgot Passcode? near the bottom of the screen.
  3. Tap Enter Previous Passcode.
  4. Type your old passcode, then follow the onscreen prompts to set a new one.

This safety net only lasts 72 hours from the moment you changed the passcode. After that window closes, the old code stops working, and erasing the iPhone becomes the only way back in. If you remember the new code at any point during those 72 hours, use it to unlock the phone normally and change the passcode again from Settings while you still can.

How Do I Change My iPhone Passcode If I Forgot It Completely?

There is no way to recover a forgotten iPhone passcode. Apple says so plainly in its own support guide: if you cannot remember your passcode, you can erase your iPhone with a computer or with recovery mode, then set a new passcode. No Apple support agent, no setting, and no official tool can reveal the code you forgot, because the passcode is part of the encryption that protects the data on your phone.

Erasing the iPhone removes all the information and settings currently stored on it. That is the price of the security that keeps a stranger out of a lost or stolen phone. What you can get back afterwards depends entirely on whether you had a backup or had your data synced to iCloud before you forgot the code, which is why the backup section below matters so much.

You have three official ways to erase a locked iPhone, and the right one depends on what you have at hand:

  • On the lock screen itself, if the iPhone Unavailable screen shows Forgot Passcode? or Erase iPhone, tap it and follow the prompts. This needs an internet connection and your Apple Account sign-in.
  • With a computer, by putting the iPhone into recovery mode and restoring it with Finder on a Mac or the Apple Devices app on a Windows PC.
  • Remotely with Find My, by erasing the iPhone from iCloud if Find My was turned on and the phone is online.

Do not pay for third-party unlocking tools or services that promise to recover a forgotten passcode without erasing the phone. Apple’s recovery process is the safe route, and tools that claim to bypass it can install malware, steal your data, or leave the phone permanently unusable. If a service asks for payment before it even sees your phone, walk away.

One more thing to know before you erase anything: after the erase, the iPhone will still ask for the Apple Account password that was signed in on it before you can set it up again. This is Activation Lock, and it stays on even after a full erase, so make sure you know that password. If you forgot that password too, reset it at iforgot.apple.com before you start.

How Do I Erase a Locked iPhone With a Computer?

Recovery mode is the route to use when the lock screen does not offer a Forgot Passcode? button, or when you have a computer nearby. The computer erases the iPhone and installs a fresh copy of iOS, after which you can set it up again and choose a new passcode.

  1. Connect your iPhone to your Mac or Windows PC with a cable.
  2. Turn off the iPhone.
  3. Put the iPhone into recovery mode using the button combination for your model, while connecting it to the computer.
  4. On a Mac with macOS Catalina or later, open Finder, select your iPhone, and choose Restore. On a Windows PC, open the Apple Devices app and choose Restore.
  5. Wait while the computer downloads the software and erases the iPhone, then follow the setup screens and restore from a backup if you have one.

Recovery mode does not reveal or recover your old passcode. It only lets you erase the phone so you can start again, which is exactly why Apple designed it that way. The button combination for recovery mode is different for different iPhone models, so check the steps for your exact model on Apple’s support site before you start, and keep the phone connected to the computer until the restore finishes.

How Do I Erase a Locked iPhone With Find My?

If Find My was turned on before the phone was locked, you can erase the iPhone from anywhere, without touching it and without a computer. The phone has to be online for the erase command to reach it, so this route works best when the iPhone still has a Wi-Fi or mobile connection.

  1. Go to iCloud.com/find in a browser and sign in with the same Apple Account that is on the locked iPhone, or open the Find My app on another Apple device signed in to the same account.
  2. Select the locked iPhone from your list of devices.
  3. Choose Erase This Device and confirm the erase.
  4. Once the erase finishes, set the iPhone up again as new or restore it from a backup, and create a new passcode during setup.

Remote erase only works when Find My is switched on, which is why it is worth leaving on. If you ever need to switch it off for a repair or a sale, our guide on how to turn off Find My on iPhone walks through the steps. Just remember that turning it off also removes this remote-erase safety net, so switch it back on as soon as you can.

After the remote erase, Activation Lock still applies, so setup will ask for the Apple Account password that was on the phone. That is normal, and it is what stops a thief from erasing a stolen iPhone and using it as their own. If the phone is offline when you send the erase command, the command waits and runs as soon as the phone connects again.

What Happens to My Data After I Erase My iPhone?

Erased data is gone from the phone itself, but it is not always gone for good. Apple says that if you made an iCloud or computer backup before you forgot your passcode, you can restore your data and settings from that backup. Photos, contacts, and other information that was already synced to iCloud also come back when you sign in again during setup.

What you cannot get back is anything that lived only on the phone and was never backed up or synced. That includes photos that were never copied to iCloud, messages that were never backed up, and app data that was never synced. This is the real cost of a forgotten passcode, and it is why a backup matters more than any passcode trick.

The lesson is simple: back up your iPhone while you still can get into it. Our guide on how to back up an iPhone covers the steps for iCloud and computer backups. A backup takes a few minutes to set up, and it is the difference between losing a passcode and losing everything. If you want the full erase-and-start-again process explained on its own, our guide on how to factory reset an iPhone covers it step by step.

Why Can’t I Change My Passcode on My iPhone?

Sometimes the Change Passcode option does not behave the way you expect. The most common causes are security features doing their job, not a fault with your phone.

Stolen Device Protection can add a delay. On iOS 17.3 and later, changing the passcode while you are away from a familiar location, such as home or work, requires Face ID or Touch ID, then a one-hour security delay, and then authentication again before the change goes through. This is deliberate, because it stops a thief who has your phone and your passcode from locking you out of your own Apple Account. If you are at home and the delay still appears, wait it out and try again in a familiar place.

Wrong guesses can also lock you out. Each incorrect passcode attempt adds a longer wait before you can try again, and if you turned on Erase Data in the Face ID & Passcode settings, the iPhone erases all information, media, and personal settings after 10 consecutive failed passcode attempts. That setting is off by default, but if you switched it on, be careful with guesses, because the tenth wrong attempt wipes the phone.

How Do I Choose a Passcode That Is Hard to Guess?

A good passcode is one you can remember and nobody else can guess. Avoid codes tied to you, such as your birth year, your house number, or a sequence anyone could spot, like four digits in a row. These are the first codes a thief tries, because they are the codes most people pick.

Do not reuse a passcode you already use somewhere else, such as your bank card PIN or another phone. If one code leaks, every place that shares it becomes vulnerable. Pick something unique to this iPhone, practise it a few times after you set it, and store it somewhere safe away from the phone, such as a password manager or a written note kept at home, so a forgotten code never turns into an erased phone.

Frequently Asked Questions About Changing an iPhone Passcode

Can I change my iPhone passcode without knowing the old one?

No, you cannot change an iPhone passcode without the old one, except within 72 hours of changing it, when the previous passcode still works on iOS 17 and later. After that window closes, the only official route is to erase the iPhone and set it up again with a new passcode.

Will changing my passcode delete anything on my iPhone?

No, changing a passcode you still know deletes nothing. Your photos, apps, messages, and settings stay exactly as they are, and only the code itself changes. Data is only lost if you forget the passcode and have to erase the iPhone to get back in.

Does changing my iPhone passcode change my Apple Account password?

No, the iPhone passcode and the Apple Account password are two different credentials. The passcode unlocks your iPhone, while the Apple Account password signs you in to iCloud, the App Store, and Find My. Changing one does not change the other.

How many times can I enter the wrong passcode?

Your iPhone allows a few wrong attempts, then adds a longer wait before each new try, and the waits keep growing with every failed attempt. If you turned on Erase Data in the Face ID and Passcode settings, the iPhone erases itself after 10 consecutive failed passcode attempts, so stop guessing and use the recovery steps instead.

Can Apple reset a forgotten iPhone passcode for me?

No, Apple cannot reset or recover a forgotten iPhone passcode for you. The passcode protects the encryption on your iPhone, so the only official fix is to erase the iPhone with recovery mode, the lock screen, or Find My, then set it up again and restore from a backup if you have one.