How to Set a PIN or Password to Lock Your Phone
A phone lock screen is your first line of defense if your phone is ever lost or stolen.
At a Glance
In this guide (6 steps):
- 1.Understand why a lock screen PIN matters
- 2.iPhone: open Settings → Face ID & Passcode → Turn Passcode On
- 3.Android: open Settings → Security → Screen lock → PIN
- 4.Set the phone to lock immediately when the screen turns off
- 5.Write your PIN down and store it somewhere safe
- 6.What to do if you are locked out
Understand why a lock screen PIN matters
~27sQuick Tip
Avoid common PINs like 123456, your birth year, or repeated digits like 111111. Choose a number that is meaningful to you but would not be obvious to anyone who knows you.
iPhone: open Settings → Face ID & Passcode → Turn Passcode On
~31sQuick Tip
After setting your passcode, set up Face ID for day-to-day convenience. Your face unlocks the phone instantly — the passcode is the backup for when Face ID does not work.
Android: open Settings → Security → Screen lock → PIN
~27sQuick Tip
After setting your PIN, go back to the Security settings and set up your fingerprint for faster day-to-day unlocking. The PIN remains as the secure backup.
Set the phone to lock immediately when the screen turns off
~19sWrite your PIN down and store it somewhere safe
~29sWarning
If you forget your PIN and enter it incorrectly too many times, your phone will eventually require a full reset that erases all your data. Store your PIN somewhere you can find it even without your phone.
What to do if you are locked out
~32sQuick Tip
Enabling iCloud Backup on iPhone (Settings → your name → iCloud → iCloud Backup) or Google One Backup on Android protects your data so that even a full reset does not mean losing everything.
You Did It!
You've finished reading: How to Set a PIN or Password to Lock Your Phone
How well did this guide stick with you?
Need more help? Book a TekSure tech
Setting a PIN or passcode on your phone is one of the most important steps you can take to protect your personal information. Your phone contains your email, your bank apps, your photos, your contacts, and in many cases, access to accounts where someone could spend your money or steal your identity. Without a lock screen, anyone who picks up your phone can access all of it.
This guide explains what your options are, how to set one up on both iPhone and Android, and what to do if you ever forget your PIN.
---
Why a phone PIN matters
When your phone has no lock screen PIN, anyone who finds or takes your phone can: - Open your banking app and transfer money - Read your emails and text messages - Access your Amazon, PayPal, or Venmo account and make purchases - See your photos and personal files - Change your passwords by receiving two-factor authentication codes - Impersonate you to your family members via messages
A PIN or passcode does not prevent this scenario entirely — but it creates a strong barrier. Modern iPhones and Android phones encrypt all their data using your passcode as part of the encryption key. That means even someone who knows what they are doing cannot easily access your files without the correct code.
The lock screen passcode also works alongside Face ID (iPhone) or fingerprint recognition (Android). You still get the convenience of unlocking quickly with your face or finger, but the PIN is the backup that protects you if those methods fail or someone tries to access your phone while you are asleep.
---
Understanding your options: PIN, passcode, or password?
When you set up a phone lock, you usually have several choices. Here is what each one means:
- **4-digit PIN:** A four-number code such as 1234 or 7291. Fast to type, but the weakest option. There are only 10,000 possible combinations, and a determined person could guess it by trying combinations.
- **6-digit PIN:** A six-number code such as 489201. Much stronger than a 4-digit PIN. There are one million possible combinations. This is a good balance between security and convenience for most people.
- **Alphanumeric password:** A password that mixes letters and numbers, similar to a computer password. The most secure option. Takes slightly longer to type on a phone keyboard but provides the best protection.
Which should you choose?
For most people, a 6-digit PIN is a strong and practical choice. Avoid common patterns like 123456, your birth year, or repeating digits like 111111.
---
How to set a passcode on iPhone
- 1Open the **Settings** app (the gray gear icon on your home screen).
- 2Scroll down and tap **Face ID & Passcode** (on iPhones with Face ID — these are iPhones from iPhone X onward, with no Home button). If you have an older iPhone with a Home button, the option is called **Touch ID & Passcode**.
- 3If prompted, enter your current passcode. If you have never set one, tap **Turn Passcode On**.
- 4Tap **Turn Passcode On**. You will be asked to enter a new passcode.
- 5By default, iPhone asks for a 6-digit passcode. Type a six-digit number and then type it again to confirm.
- 6**To choose a different type:** Before entering your code, tap **Passcode Options** at the bottom of the screen. You can choose:
- 7 - **4-Digit Numeric Code:** a four-number PIN
- 8 - **6-Digit Numeric Code:** the default six-number PIN
- 9 - **Custom Numeric Code:** any length you choose (for example, eight digits)
- 10 - **Custom Alphanumeric Code:** letters and numbers (functions like a traditional password)
- 11After confirming your new passcode, it is active right away. The next time you turn off the screen and turn it back on, you will be asked to enter the code.
Setting up Face ID alongside your passcode:
If your iPhone supports Face ID, you can set it up so that looking at your phone unlocks it — without typing your code every time. The passcode remains as the backup for when Face ID does not work (for example, when wearing a mask, or when someone else tries to unlock your phone). To set up Face ID: go to Settings → Face ID & Passcode → Set Up Face ID and follow the on-screen instructions.
---
How to set a PIN on Android
Android phone settings vary slightly depending on the brand (Samsung, Google Pixel, Motorola, etc.), but the general path is the same on all of them.
- 1Open the **Settings** app (usually a gear icon in your app drawer or Quick Settings).
- 2Scroll down and tap **Security** (on some phones it may be called **Security & Privacy**, **Biometrics and Security**, or **Lock screen and security**).
- 3Tap **Screen lock** (or **Lock screen type** on some Samsung phones).
- 4If your phone currently has no lock or a Swipe lock, you will see options to choose a new type:
- 5 - **PIN:** a number-only code (you choose how many digits — 4 is the minimum, 6 is recommended)
- 6 - **Password:** a mix of letters and numbers
- 7 - **Pattern:** draw a shape on a grid of dots (not recommended — others can see you draw it and guess it)
- 8Tap **PIN** and enter a six-digit number. Tap **Continue**, then enter it again to confirm. Tap **OK** or **Confirm**.
- 9Your phone will now lock with a PIN each time the screen turns off.
Setting up fingerprint unlock alongside your PIN:
Many Android phones have a fingerprint sensor built into the screen or on the back. After setting your PIN, go to Settings → Security → Fingerprint (or Biometrics) and follow the instructions to add your fingerprint. Once set up, you can unlock the phone with your finger — the PIN remains as the backup.
---
What to do if you forget your PIN
This is the most important thing to know before setting a PIN: **if you forget your PIN and cannot get in, you will eventually need to reset your phone**. After a certain number of wrong attempts, both iPhone and Android lock the phone for increasing time periods, and eventually require a full reset — which erases all your data.
This is by design: it is what protects your information if a thief tries to guess your code. But it means you need to remember your PIN.
How to avoid forgetting it:
- Write your PIN on paper and store it in a safe place — a locked drawer, a home safe, or with your important documents. Do not store it in your phone. - Choose a PIN that is meaningful to you but not obvious to others — not your birth year, not a family member's birth year, not your address. - Tell a trusted family member what your PIN is, or where you have written it down.
If you are locked out of your iPhone:
Connect your iPhone to a computer with iTunes (Windows) or Finder (Mac), put the iPhone in Recovery Mode, and restore it. This erases the phone, but if you have iCloud backup enabled, your data will be restored afterward. Apple's support page at support.apple.com has step-by-step instructions.
If you are locked out of your Android:
The process varies by phone brand. On most Android phones, after too many wrong PIN attempts, you will see an option to reset using your Google account. You can also use Google's Find My Device (android.com/find) to erase and reset your phone remotely.
---
Quick Tip:
After setting a PIN, go back to Settings and look for an option called "Require Passcode" or "Lock after" — set this to "Right away." This means your phone locks as soon as the screen turns off, giving you the strongest protection. Some phones default to waiting 30 seconds or more before requiring the code.
Rate this guide
How helpful was this guide?
Official Resources
Sources used to create and verify this guide. View all sources →
← Previous
How to Turn On the Flashlight on Your iPhone or Android Phone
Next →
How to Check Your Credit Score for Free (Without Hurting Your Credit)
Still stuck? Let a pro handle it.
A real person can walk you through this over the phone, anywhere in the US. If we can't fix it, you don't pay.
Learn more from official sources
Related Guides
How to Secure Your Home Wi-Fi Network
Simple steps to lock down your home router, keep strangers off your network, and protect every device in your house.
3 min read
Setting Up Two-Factor Authentication (2FA) on Any Account
Add a second layer of security to your most important accounts. This one change stops most account takeovers cold.
3 min read
Staying Safe on Social Media
How to protect your privacy on Facebook and Instagram, spot fake accounts, and avoid the most common social media traps.
3 min read