How to Lock Your iPhone: Passcodes and Security Guide
In this article
To lock your iPhone immediately, press the side button (or the top button on older models) once. To ensure the device remains locked and secure from unauthorized access, you must set up a passcode, Face ID, or Touch ID in the settings menu. Locking your iPhone protects your personal data, prevents unauthorized app usage, and is a prerequisite for enabling features like Apple Pay and secure iCloud backups.
What You'll Need
- An unlocked iPhone with access to the home screen.
- Your Apple ID password (required if you are enabling certain security features or changing existing lock settings).
- A few minutes of time to configure your biometric data or choose a secure numeric code.
Step-by-Step
Depending on your goal, you may want to lock the screen instantly or set up a permanent security lock. Note that menu labels may differ slightly based on your iOS version, device model, or regional settings.
Method 1: Instant Screen Lock
- Locate the physical power button. On iPhone X and newer, this is the Side button on the right edge. On iPhone 8 and older, this is the Sleep/Wake button on the top or right side.
- Press the button once quickly. The screen will go black, and the device will enter a locked state.
- If you have a passcode enabled, the device is now secure. If you do not have a passcode, the device is merely "asleep" and can be opened by anyone.
Method 2: Setting Up a Passcode Lock
- Open the Settings app from your home screen.
- Scroll down and select Face ID & Passcode (or Touch ID & Passcode on models with a Home button).
- If you have previously set a passcode, you will be prompted to enter it now to access these settings. If not, tap Turn Passcode On.
- Choose your passcode type. You can select a six-digit numeric code, a four-digit numeric code, or a custom alphanumeric password by tapping Passcode Options.
- Enter your chosen code. You will be asked to enter it a second time to confirm it is correct.
- Once confirmed, your iPhone is now configured to lock whenever the screen is turned off.
Method 3: Configuring Auto-Lock
- Navigate to Settings.
- Select Display & Brightness.
- Tap on Auto-Lock.
- Choose a time interval (e.g., 30 Seconds, 2 Minutes, 5 Minutes). This determines how long the iPhone stays awake before it locks itself automatically.
- Select Never if you want the screen to stay on indefinitely, though this is not recommended for security or battery health.
Method 4: Enabling Biometric Locking (Face ID/Touch ID)
- Go to Settings > Face ID & Passcode (or Touch ID & Passcode).
- Tap Set Up Face ID or Add a Fingerprint.
- Follow the on-screen prompts. For Face ID, rotate your head in a circle as directed. For Touch ID, lift and rest your finger on the Home button multiple times.
- Once the scan is complete, ensure the toggle for iPhone Unlock is switched to the ON position.
Common Mistakes
One of the most frequent errors users make is choosing a passcode that is too simple. Using sequences like "000000" or "123456" makes the device vulnerable to "shoulder surfing," where someone watches you enter your code from a distance. Another common mistake is forgetting to set an Auto-Lock timer. If the timer is set to a long duration or "Never," the phone remains unlocked even after you set it down, leaving your messages and photos exposed to anyone nearby.
Users often confuse "locking the screen" with "securing the device." Pressing the side button locks the screen, but if no passcode is configured in the settings, the lock is purely cosmetic. Without a passcode, Face ID and Touch ID cannot be activated, as these biometrics act as a secondary layer of security to the primary numeric code.
Additionally, some users accidentally disable their lock screen security when trying to troubleshoot app crashes. It is important to remember that disabling your passcode also removes your credit cards from Apple Wallet for security reasons, meaning you will have to re-add them once you re-enable the lock.
Tips
For maximum security, use a custom alphanumeric passcode. While a six-digit code is standard, a password containing letters, numbers, and symbols is significantly harder to crack. You can set this up via Settings > Face ID & Passcode > Passcode Options > Custom Alphanumeric Code.
Utilize the "Attention Aware" feature if your iPhone supports Face ID. This prevents the screen from dimming or locking while you are actively looking at it, even if the Auto-Lock timer has expired. This is useful for reading long articles or following a recipe without having to constantly tap the screen to keep it awake.
If you frequently find yourself locking your phone in your pocket, check your case fit. Sometimes tight cases can put pressure on the side button, causing the phone to lock or unlock unexpectedly. Also, consider using a screen protector that is compatible with Touch ID to ensure your fingerprint is read accurately on the first attempt, reducing the number of times you have to manually enter your passcode.
Troubleshooting
If your iPhone will not lock when you press the side button, first check if your phone case is obstructing the button. Remove the case and try pressing the button again. If the button feels stuck or doesn't click, there may be physical debris or hardware damage that requires professional repair.
If the Auto-Lock feature is not working (the screen stays on regardless of the timer), check if you have any apps open that prevent sleep. Certain video streaming apps or navigation tools are designed to keep the screen active. Close all background apps by swiping up from the bottom of the screen and sliding the app windows away.
If Face ID or Touch ID fails to unlock the device, clean the sensor area. Use a dry, lint-free cloth to wipe the TrueDepth camera array at the top of the screen or the Home button. If the biometrics still fail, you will be prompted to enter your numeric passcode. If you have forgotten your passcode, you will need to reset the device using a computer or via iCloud. Warning: Resetting a forgotten passcode requires erasing all data on the iPhone. You can restore your data only if you have a recent backup in iCloud or on a Mac/PC.
Frequently Asked Questions
Can I lock a specific app instead of the whole phone?
iOS does not have a native "app lock" for every individual application. However, you can use Settings > Screen Time > App Limits to set a time limit on an app and protect that limit with a Screen Time passcode, effectively locking the app once the limit is reached.
What happens if I forget my iPhone lock screen passcode?
If you forget your passcode, you cannot recover it. You must put the iPhone into recovery mode and restore it using a computer. This process deletes all data on the device, which can then be recovered from a backup.
Does locking my iPhone stop notifications from appearing?
No, notifications will still appear on the lock screen by default. To change this, go to Settings > Notifications, select the specific app, and uncheck Lock Screen under the "Alerts" section.
Why does my phone ask for a passcode even though I have Face ID?
iOS requires a manual passcode entry periodically for security. This happens after a restart, if the device hasn't been unlocked for several hours, or if Face ID fails to recognize you multiple times.
Can I change the length of my passcode?
Yes. Go to Settings > Face ID & Passcode > Change Passcode. From there, you can select Passcode Options to switch between a 4-digit, 6-digit, or custom alphanumeric code.