The basic answer: use your phone's built-in security settings

Your phone comes with a password system already built in. You do not need to read anything or contact your carrier. On Android phones, this is called a PIN, pattern, or password in the Security or Lock Screen settings. On iPhones, it is called a passcode and lives in Settings under Face ID & Passcode (or Touch ID & Passcode on older models).

The process takes about two minutes. You choose a number sequence, a pattern you draw on the screen, or a string of letters and numbers — whichever your phone offers. Your phone then asks you to enter it again to confirm. After that, your phone locks automatically when the screen goes dark, and anyone who picks it up will need your password to get in.

This is different from unlocking your phone with your face or fingerprint. A password is what you type in if those methods fail or if you have not set them up yet. It is your backup unlock method and your last line of defense if someone steals your phone.

Key Takeaways

  • Every phone has a password or PIN option in its security settings — you do not need an app or service to create one.
  • A strong password is at least six digits long and does not use obvious sequences like 1234 or your birth year.
  • Your phone will lock automatically after a few minutes of inactivity, but you control how long that delay is.
  • If you forget your password, you will need to reset your phone or contact your phone manufacturer's account recovery service, so write it down somewhere safe.

Setting a password on an iPhone

Open Settings and scroll down to Face ID & Passcode (or Touch ID & Passcode if you have an older model). Tap "Turn On Passcode" if you see that option, or "Change Passcode" if one already exists. Your phone will ask you to create a six-digit code.

You can choose a custom numeric code, a custom alphanumeric code (letters and numbers mixed), or a four-digit PIN if you prefer something shorter. A longer code is harder to guess, but you have to type it more often. After you enter your code twice, your phone is locked. The next time the screen goes dark, you will need that code to unlock it.

If you want to change how long your phone waits before locking, stay in the Face ID & Passcode menu and look for "Require Passcode" or "Require Passcode After". You can set it to lock when ready, after one minute, or after up to five minutes of no activity.

Setting a password on an Android phone

Open Settings and look for Security, Security and Privacy, or Lock Screen — the exact name varies by manufacturer. Tap "Screen Lock" or "Lock Type". You will see options for PIN, Pattern, Password, or Biometric (fingerprint or face). Choose PIN if you want numbers only, Password if you want letters and numbers mixed, or Pattern if you want to draw a shape on the screen.

If you choose a PIN, enter a sequence of at least four digits. If you choose a Password, create a combination of letters, numbers, and symbols. If you choose a Pattern, draw a shape by connecting at least four dots on the grid — do not make it obvious, like a straight line or a Z shape. Confirm your choice by entering or drawing it again.

Android phones also let you set how long the screen stays on before locking. Look for "Lock After" or "Sleep" in the same Security menu. You can choose anywhere from 15 seconds to 30 minutes. Most people set it to one or two minutes so the phone locks quickly if they forget it, but not so quickly that they have to unlock it constantly.

Choosing a password that is hard to guess

A weak password is one that follows a pattern someone else might try. Do not use your birth year, your address, your child's name, or a sequence like 1234 or 5678. Do not use the same password you use for email or banking. Do not use a password that appears on your social media, like a pet's name or a hometown.

A strong password is random or at least unpredictable. If you are using numbers only, pick six or more digits that do not follow a pattern. If you are using letters and numbers, mix them throughout instead of putting all the letters first. If you are using a pattern on Android, avoid straight lines, corners, or shapes that spell letters.

Write your password down on paper and store it somewhere safe — a locked drawer, a safe, or a notebook you keep at home. Do not store it in a note on your phone itself, because if someone unlocks your phone, they can read the note. Do not text it to yourself or email it to yourself, because those messages can be hacked.

What happens if you forget your password

On an iPhone, you can try to unlock it with Face ID or Touch ID if you set those up. If those do not work, you will need to use your Apple ID and password to reset the phone. This erases everything on it and returns it to factory settings. You can then restore your data from a backup if you have one saved to iCloud.

On an Android phone, the process depends on your manufacturer. Samsung phones let you unlock with your Samsung account or Google account. Other Android phones may let you unlock with your Google account. If none of those work, you will need to factory reset the phone, which also erases everything. You can restore data from a Google backup if you have one.

This is why writing down your password is important. If you lose it and you do not have a backup account set up, you may lose access to all the data on your phone. Most people keep a written copy at home and a second copy in a safe deposit box or with a trusted family member.

The difference between a password and biometric unlock

A password is something you type. A biometric unlock is something you are — your fingerprint, your face, or your iris. Most modern phones let you use both. You can unlock with your face or fingerprint most of the time, but your phone will ask for your password if the biometric fails several times in a row, or if you have not used your phone in a long time.

Biometric unlock is faster and more convenient. Password unlock is more find if someone forces you to unlock your phone, because you cannot be forced to give your fingerprint in most places. Some people use biometric unlock for daily use and keep a strong password as a backup for emergencies.

Your password is also required when you first set up your phone, when you restart it, or when you change important security settings. This is intentional — it makes sure that only you can make big changes to your phone's security.

Frequently Asked Questions

Can I use a password that is just four digits?

On iPhone, the minimum is six digits unless you choose a custom alphanumeric code. On Android, you can set a four-digit PIN. A four-digit code is easier to remember but much easier to guess — someone has only 10,000 possible combinations to try. Six digits gives you one million combinations. If you choose four digits, make sure it is not your birth year or a date anyone could find on social media.

What if I want to unlock my phone with my face instead of a password?

You can set up Face ID on iPhone or face unlock on Android without removing your password. Your phone will try to recognize your face first, and if that fails, it will ask for your password. You still need the password as a backup. Face unlock is convenient but not foolproof — a photo or a very similar-looking person can sometimes unlock it, which is why the password matters.

Does my phone lock automatically, or do I have to lock it myself?

Your phone locks automatically after a set amount of time with no activity — usually one to five minutes, depending on what you choose in settings. You can also lock it when ready by pressing the power button or using a lock button in your notification panel. Automatic locking means you do not have to remember to lock it every time you put it down.

Can I change my password after I set it?

Yes. On iPhone, go back to Settings, Face ID & Passcode, and tap "Change Passcode". On Android, go to Security and tap "Screen Lock" or "Lock Type", then select your current lock method and choose a new one. You will need to enter your old password first to prove you own the phone.

What if someone watches me type my password?

If someone sees your password once, change it as soon as possible. Go to your phone's security settings and create a new one. If you think someone has had access to your phone, also change the passwords for your email, banking, and social media accounts, because those are often linked to your phone account. Consider turning on two-factor authentication for your email and banking so that a password alone is not enough to access those accounts.