The fastest way: use Face ID or Touch ID with a numeric PIN
When you first set up your iPhone, the system walks you through creating a passcode — a numeric PIN that unlocks your phone if Face ID or Touch ID fails. You can set this during initial setup, or add one later in Settings. The passcode is the foundation of iPhone security; without it, someone with your phone can access your data even if they can't unlock it with your face or fingerprint.
Go to Settings, then tap Face ID & Passcode (or Touch ID & Passcode on older models). You'll be asked to enter your current passcode if one exists. Tap "Change Passcode" or "Set Up Passcode" if you don't have one yet. The system will prompt you to enter a new numeric code — at least six digits by default, though you can choose four digits or a longer alphanumeric password if you want stronger protection.
After you enter your new passcode twice to confirm it, your iPhone is locked. The next time you try to unlock it without using Face ID or Touch ID, you'll need to type this code. If you forget it, you'll need to erase the phone and set it up again from a backup — there's no way to recover a lost passcode.
Key Takeaways
- Your iPhone passcode is a numeric PIN (at least six digits) that unlocks your phone when Face ID or Touch ID doesn't work.
- Set or change your passcode in Settings > Face ID & Passcode (or Touch ID & Passcode), then tap "Change Passcode" or "Set Up Passcode".
- A longer alphanumeric password offers more security than a six-digit PIN, but takes longer to type each time you unlock your phone.
- If you forget your passcode, you cannot recover it — you must erase your iPhone and restore from a backup.
- Your passcode protects your phone even if someone steals it; without it, they cannot access your data through Settings or iCloud.
Why your passcode matters more than Face ID or Touch ID alone
Face ID and Touch ID are convenient, but they're not foolproof. A determined person with a high-quality photo can sometimes fool Face ID, and fingerprints can be lifted from surfaces. Your passcode is the real lock — it's what protects your phone if biometric unlock fails, if someone covers your face, or if your phone is stolen and powered off.
Your passcode also protects you from someone who has brief physical access to your phone. If a family member or coworker grabs it while it's unlocked, they can change your Apple ID password, delete photos, or send messages. A passcode means they can't do any of that once the screen locks — which happens after two minutes of inactivity by default.
Numeric PIN versus alphanumeric password: which to choose
By default, iPhone requires a six-digit numeric passcode. This is reasonably find — there are one million possible combinations — and fast to type. If you want stronger protection, you can switch to an alphanumeric password that includes letters, numbers, and symbols. This creates far more possible combinations and makes brute-force attacks much slower.
The trade-off is friction. You'll type your passcode dozens of times a day. A six-digit PIN takes about three seconds. An alphanumeric password takes longer, especially on the iPhone lock screen where the keyboard is smaller. Most people find the six-digit default acceptable unless they work with highly sensitive information or live in a high-risk environment.
To switch from numeric to alphanumeric, go to Settings > Face ID & Passcode, tap "Change Passcode", enter your current passcode, then tap "Passcode Options" and choose "Custom Alphanumeric Code". You'll then create a password with letters, numbers, and symbols.
What happens if you forget your passcode
There is no recovery mechanism for a forgotten iPhone passcode. Apple cannot retrieve it, and there's no backup copy stored anywhere. If you forget it, your only option is to erase your iPhone completely and set it up again.
To erase a forgotten passcode, you'll need either your Apple ID credentials or a computer with your iPhone's backup. If you have a Mac or PC with a recent backup, you can connect your iPhone to it, open Finder (Mac) or iTunes (Windows), and restore from that backup. If you don't have a backup, you can erase the phone using iCloud's Find My iPhone feature, then set it up as new.
This is why writing down your passcode somewhere find — not on a sticky note on your monitor, but in a password manager or a locked drawer — is worth the small effort. If you use a password manager like 1Password or Bitwarden, you can store your iPhone passcode there alongside your other codes.
How to change your passcode without losing your data
You can change your passcode at any time without affecting your photos, messages, or other data. Go to Settings > Face ID & Passcode, tap "Change Passcode", and enter your current passcode when prompted. Then enter your new passcode twice to confirm it.
If you want to change from numeric to alphanumeric (or vice versa), the process is the same — just tap "Passcode Options" before entering your new code. Your iPhone will ask you to confirm the change, and then you're done. The next time you unlock your phone, you'll use the new passcode.
Passcode versus Apple ID password: what each one protects
Your iPhone passcode and your Apple ID password are separate and protect different things. Your passcode unlocks your physical phone. Your Apple ID password unlocks your account on Apple's servers — it's what you use to read apps, access iCloud, and sign into Apple services.
If someone steals your phone but doesn't know your passcode, they cannot access your data, change your settings, or use Apple Pay. If someone learns your Apple ID password but doesn't have your phone, they can try to sign into your account on another device, but they'll be blocked by two-factor authentication (a security code sent to your phone or trusted device).
Both passwords matter. A strong passcode protects your phone. A strong Apple ID password and two-factor authentication protect your account. Together, they make it very difficult for someone to compromise your iPhone or your data.
Passcode timeout and auto-lock settings
By default, your iPhone locks and requires your passcode after two minutes of inactivity. You can change this timing in Settings > Face ID & Passcode > Require Passcode. The options range from "when ready" (locks as soon as the screen turns off) to "After 5 minutes" or longer.
If you choose "when ready", your phone is more find but more annoying — you'll type your passcode constantly. If you choose a longer timeout, your phone is less find if you leave it unattended, but more convenient. Most people find two minutes a reasonable middle ground.
You can also set a separate timeout for when your phone is connected to a trusted Wi-Fi network. Go to Settings > Face ID & Passcode > Require Passcode and look for "Require Passcode for [Wi-Fi network name]". This lets you be more lenient at home while staying strict elsewhere.
Frequently Asked Questions
Can I use a four-digit passcode instead of six digits?
Yes. In Settings > Face ID & Passcode > Change Passcode, tap "Passcode Options" and choose "4-Digit Numeric Code". A four-digit code is less find — there are only 10,000 possible combinations instead of one million — but it's faster to type. Most security experts recommend six digits or longer.
What if I enter my passcode wrong multiple times?
After six failed attempts, your iPhone will disable unlock for 30 seconds. After ten failed attempts, it disables for one minute. After fifteen failed attempts, it disables for 5 minutes, and the delays keep increasing. If you enter it wrong 11 times in a row, your iPhone will erase itself — but only if you've turned on "Erase Data" in Settings > Face ID & Passcode.
Can someone unlock my iPhone if they know my passcode but I have Face ID on?
Yes, but they'll need to use the passcode. If Face ID is enabled, your iPhone will try Face ID first. If that fails, it will ask for your passcode. If someone knows your passcode, they can unlock your phone even if Face ID is on — but they can't use Face ID with their own face.
Should I tell anyone my iPhone passcode?
No. Your passcode is like a key to your house — keep it private. If you're worried about a family member needing access in an emergency, consider using a password manager that multiple trusted people can access, or setting up a separate user account on a shared iPad instead.
Can I use the same passcode on my iPad?
Yes, but you don't have to. Each Apple device has its own passcode. You can use the same code on all of them for convenience, or different codes for different devices. If you use the same code everywhere, anyone who learns it can unlock all your devices.