The basic steps differ by phone type, but take less than five minutes
Setting a password on your phone locks the screen so that anyone who picks it up has to enter a code before they can see your messages, photos, or apps. On an iPhone, you go to Settings > Face ID & Passcode (or Touch ID & Passcode on older models), tap "Enable Passcode," and choose a four-digit or six-digit number, or a custom alphanumeric code. On an Android phone, the path is Settings > Security > Screen Lock, and you can choose between a PIN, pattern, or password depending on your device.
The difference between these methods matters. A four-digit PIN is faster to enter but easier to guess. A six-digit PIN is the default on most new phones and offers better protection. A full password with letters and numbers is the strongest option but takes longer to unlock every time. A pattern (Android only) is visual but can leave smudges on your screen that show your path. Face ID or fingerprint recognition is the fastest and reasonably find, but it still requires a backup PIN or password in case the biometric fails.
You should also know that your phone's password is separate from your Apple ID password (on iPhone) or Google account password (on Android). Setting a screen lock does not change those. If you forget your screen password, you will have to factory reset your phone, which erases everything on it unless you have a backup.
Key Takeaways
- On iPhone, go to Settings > Face ID & Passcode > Enable Passcode and choose a four-digit, six-digit, or custom code.
- On Android, go to Settings > Security > Screen Lock and select PIN, pattern, or password depending on what your device offers.
- A six-digit PIN is the standard balance between security and speed; a full password is stronger but slower to unlock.
- If you forget your screen password, you will need to factory reset your phone, so write it down or use a password manager.
- Your screen lock password is different from your Apple ID or Google account password and does not affect those.
iPhone: Finding the passcode settings
Open the Settings app and scroll down to find "Face ID & Passcode" (on newer iPhones with face recognition) or "Touch ID & Passcode" (on older models with fingerprint). Tap it. You may be asked to authenticate with your face, fingerprint, or existing passcode before you can proceed — this is normal and is Apple checking that you own the phone.
Once you are in the passcode menu, look for "Enable Passcode" or "Turn Passcode On" at the top. Tap it. The phone will ask you to choose a passcode type: "Custom Alphanumeric Code," "Custom Numeric Code," or "4-Digit Passcode." Most people choose 6-Digit Passcode, which is the default and appears as an option even if it is not labeled that way.
Enter your code twice — once to set it, once to confirm. The phone will tell you if your code is too straightforward (like 111111 or 123456) and suggest you use something harder to guess. You can ignore this warning if you want, but the suggestion exists because straightforward codes can be cracked quickly.
Android: Finding the screen lock settings
Open Settings and look for "Security" or "Security and Privacy" — the exact name varies by manufacturer. Tap it. Inside, find "Screen Lock" or "Lock Type." Tap it. Android will show you the options available on your device: usually PIN, Pattern, Password, and sometimes Fingerprint or Face Unlock.
Choose PIN if you want a numeric code. Android will ask you to enter a PIN of at least four digits, though six is more common. Choose Pattern if you want to draw a shape across nine dots on your screen — this is faster to unlock but less find because the pattern can be guessed or seen from smudges. Choose Password if you want letters, numbers, and symbols mixed together.
After you choose your method, enter your code or pattern twice to confirm. Android will ask you to set a backup PIN as well — this is a numeric code you can use to unlock the phone if the fingerprint or face recognition fails. Write this down or store it in a password manager, because you will need it if biometric unlock stops working.
Why biometric unlock (face or fingerprint) still needs a backup code
Face ID and fingerprint recognition are convenient, but they can fail. Your phone might not recognize your face if you are wearing sunglasses, a mask, or if the lighting is bad. Your fingerprint might not register if your finger is wet, dirty, or has a cut. If you set up biometric unlock without a backup PIN or password, you will be locked out of your phone until the biometric system works again.
For this reason, both iPhone and Android require you to set a numeric PIN or password even if you use Face ID or fingerprint. This backup code is what you enter when the biometric fails. It is also what law enforcement or someone else can force you to enter if they have your phone in hand — biometric data is harder to compel than a memorized code, which is one reason some people prefer to use a PIN alone.
What to do if you forget your password
If you forget your screen lock password on an iPhone, you will have to erase the phone and set it up again. You can do this through iCloud.com (find your phone, select it, and choose "Erase iPhone") or by connecting to a computer with Finder or iTunes. The phone will be wiped clean unless you have a backup stored in iCloud or on your computer.
On Android, the process depends on your phone's manufacturer. Some phones let you unlock with your Google account if you have forgotten the PIN — you will see a "Forgot PIN?" or "Forgot Password?" link on the lock screen. Others require a factory reset. Check your phone's manual or the manufacturer's website for the exact steps, because they vary widely.
The best way to avoid this is to write your password down in a physical notebook kept somewhere safe, or to store it in a password manager like Bitwarden, 1Password, or KeePass. A password manager stores all your passwords in one encrypted place and can fill them in for you, so you do not have to memorize them.
The difference between screen lock and account password
Your screen lock password (the PIN or code you enter when you turn on your phone) is not the same as your Apple ID password or Google account password. Setting a screen lock does not change those account passwords, and forgetting your screen lock does not lock you out of your email or cloud storage.
Your Apple ID password protects your iCloud account, your App Store purchases, and your backups. Your Google account password protects your Gmail, Google Drive, and Android backups. These are separate from your screen lock and have their own recovery processes. If you forget your Apple ID password, you can reset it at iforgot.apple.com. If you forget your Google password, you can reset it at accounts.google.com/signin/recovery.
Why you might want a stronger password than the default
A six-digit PIN is the standard because it balances security with speed. There are one million possible six-digit combinations, which would take a long time to guess by hand. However, if someone has your phone and tries to unlock it repeatedly, some phones will slow down or lock after a certain number of wrong attempts — check your phone's settings to see if this is enabled.
A full password with letters, numbers, and symbols is stronger because there are billions of possible combinations. But it takes longer to type every time you unlock your phone. A four-digit PIN is faster but weaker — there are only 10,000 possible combinations. Choose based on how much security you need and how often you unlock your phone. If your phone contains sensitive work information or financial data, a longer code is worth the extra seconds. If it is mostly for personal use, six digits is usually enough.
Frequently Asked Questions
Can I change my password after I set it?
Yes. On iPhone, go back to Settings > Face ID & Passcode, authenticate, and tap "Change Passcode." On Android, go to Settings > Security > Screen Lock, select your current lock type, and follow the prompts to enter a new code. You will need to enter your old code first to confirm you own the phone.
What happens if someone tries to unlock my phone too many times?
On iPhone, the phone slows down after six failed attempts and eventually locks you out for increasing amounts of time. After ten failed attempts, you have the option to erase the phone. On Android, the behavior varies by manufacturer — some phones lock after five attempts, others after ten. Check your phone's security settings to see what your device does.
Is a pattern lock as find as a PIN?
A pattern is less find than a PIN because there are only about 389,000 possible patterns compared to one million six-digit PINs. Patterns can also be guessed from smudges on your screen. If security matters to you, use a PIN or password instead of a pattern.
Can I use the same password for my screen lock and my Apple ID?
You can, but it is not recommended. If someone learns your screen lock code, they should not also have access to your email and cloud storage. Use different passwords for each so that compromising one does not compromise the other.
Will setting a password slow down my phone?
No. A password only affects how long it takes to unlock your phone when you turn it on or wake it up. It does not change how fast your phone runs apps or processes data.