Maybe you just got a new iPhone and want a simple number lock, or you’d like to switch your six-digit code back to four digits. Either way, the “number lock” on an iPhone is its passcode, and you can set it up or change it in a few taps.
Quick answer: Go to Settings > Face ID & Passcode (or Touch ID & Passcode on iPhones with a Home button). Tap Turn Passcode On, or Change Passcode if you already have one. Enter a six-digit number, or tap Passcode Options to pick a four-digit code, a longer number-only code or a code that mixes letters and numbers.

iPhone passcode types
| Option | What it is | Possible combinations |
|---|---|---|
| 4-Digit Numeric Code | Four numbers, the shortest option | 10,000 |
| 6-Digit Numeric Code | Six numbers, the default | 1,000,000 |
| Custom Numeric Code | A numeric passcode of a custom length | More with every extra digit |
| Custom Alphanumeric Code | Letters, numbers and symbols | Strength depends on length and how hard it is to guess |
A six-digit code is a good balance of convenience and security for most people. A longer, unpredictable custom code is stronger still, and Face ID or Touch ID means you won’t need to type it often.
How to set up a number lock on iPhone
- Open Settings.
- Tap Face ID & Passcode or Touch ID & Passcode.
- Tap Turn Passcode On.
- Enter a six-digit passcode, or tap Passcode Options first to choose a different type.
- Enter the passcode again to confirm it.
Once a passcode is set, you’ll also be able to use Face ID or Touch ID, Apple Pay and other features that need a passcode.
How to change your iPhone passcode (or switch to 4 digits)
- Open Settings and tap Face ID & Passcode or Touch ID & Passcode.
- Enter your current passcode.
- Tap Change Passcode and enter your current passcode again.
- Before typing a new code, tap Passcode Options and pick 4-Digit Numeric Code, Custom Numeric Code or Custom Alphanumeric Code. To keep six digits, skip this step.
- Enter your new passcode, then enter it again to confirm.
If Stolen Device Protection is turned on, changing the passcode may require a security delay when you’re away from familiar locations such as home or work, or everywhere if you chose the Always setting.
Forgot your new passcode right after changing it?
On iOS 17 and later, you can use your previous passcode to reset a new one within 72 hours of changing it, as long as you haven’t expired the previous passcode. After five wrong attempts, tap Forgot Passcode? on the iPhone Unavailable screen, choose Enter Previous Passcode and follow the prompts to set a new one. Your iPhone needs a cellular or Wi-Fi connection for this option to appear, and Apple’s support article lists any other requirements, such as being signed in to your Apple Account. You can turn this off early in Face ID & Passcode with Expire Previous Passcode Now.
If you’ve forgotten your current passcode and can’t use the previous-passcode option, you’ll need to erase and set up the iPhone again. Without a backup, you may lose your data.
Other passcode settings worth knowing
- Auto-Lock: In Settings > Display & Brightness > Auto-Lock, choose how long your iPhone waits before locking automatically when you’re not using it.
- Erase Data: In Face ID & Passcode, you can choose to erase the iPhone after 10 failed passcode attempts. Only use this if you keep regular backups.
- Allow Access When Locked: Choose which features, such as Control Center or replies to messages, work from the Lock Screen.
- Lock individual apps: On iOS 18 and later, touch and hold a supported app’s icon and choose Require Face ID (or Touch ID or Passcode) to lock that app.
Tips for choosing a good passcode
- Avoid easy codes such as 1234, 0000, 123456 or your birth year.
- Don’t reuse your banking PIN.
- If someone may have seen you type your code, change it.
- Use a longer custom code if your iPhone holds sensitive information.
Setting up a new phone? Our first things to do on a new iPhone checklist covers the other important settings.
Frequently asked questions
How do I put a number lock on my iPhone?
Go to Settings > Face ID & Passcode (or Touch ID & Passcode), tap Turn Passcode On and enter a six-digit code, or choose another type under Passcode Options.
Can I change my iPhone passcode to 4 digits?
Yes. Tap Change Passcode, then Passcode Options before entering the new code, and choose 4-Digit Numeric Code.
Why can’t I change my iPhone passcode right now?
If Stolen Device Protection is on, you may need to wait for a security delay when you’re away from familiar locations, or anywhere if it’s set to Always. Your device may also be managed by an employer or school that sets passcode rules.
Can I turn off the passcode on my iPhone?
Yes, with Turn Passcode Off in Face ID & Passcode, but it isn’t recommended. Without a passcode, anyone can open your iPhone, and Face ID, Touch ID and Apple Pay stop working.
Is a 4-digit passcode safe?
It’s much weaker than six digits, with 10,000 possible combinations instead of a million. For better security, use at least six unpredictable digits or a longer custom passcode.
How we researched this guide
We based this guide on Apple’s support article Use a passcode with your iPhone, iPad, or iPod touch and the iPhone User Guide, read on November 26, 2026. Menu names can vary slightly between iOS versions. We did not perform hands-on device testing for this guide.

Louis Mugan writes how-to and troubleshooting guides for EasyTechLife, covering Android phones, iPhones, laptops, Chromebooks, headphones and everyday software.
He aims to base each guide on official manufacturer documentation and support pages, and to link the sources so readers can check the steps for themselves. Questions or corrections? Use the contact page.


