Set a passcode on iPhone (2024)

For better security, set a passcode that needs to be entered to unlock iPhone when you turn it on or wake it. Setting a passcode also turns on data protection, which encrypts your iPhone data with 256-bit AES encryption. (Some apps may opt out of using data protection.)

Set or change the passcode

  1. Go to Settings Set a passcode on iPhone (1), then depending on your model, do one of the following:

    • On an iPhone with FaceID: Tap FaceID & Passcode.

    • On an iPhone with a Home button: Tap TouchID & Passcode.

  2. Tap Turn Passcode On or Change Passcode.

    To view options for creating a password, tap Passcode Options. The most secure options are Custom Alphanumeric Code and Custom Numeric Code.

After you set a passcode, on supported models you can use FaceID or TouchID to unlock iPhone (depending on your model). For additional security, however, you must always enter your passcode to unlock your iPhone under the following conditions:

  • You turn on or restart your iPhone.

  • You haven’t unlocked your iPhone for more than 48 hours.

  • You haven’t unlocked your iPhone with the passcode in the last 6.5 days, and you haven’t unlocked it with FaceID or TouchID in the last 4 hours.

  • Your iPhone receives a remote lock command.

  • There are five unsuccessful attempts to unlock your iPhone with FaceID or TouchID.

  • An attempt to use Emergency SOS is initiated (see Use Emergency SOS).

  • An attempt to view your Medical ID is initiated (see Set up and view your Medical ID).

Change when iPhone automatically locks

Go to Settings Set a passcode on iPhone (2)> Display&Brightness> Auto-Lock, then set a length of time.

Set a passcode on iPhone (3)

Note: If you keep your iPhone on the Home Screen and don’t take any action, your Auto-Lock time is reduced by half.

Erase data after 10 failed passcodes

Set iPhone to erase all information, media, and personal settings after 10 consecutive failed passcode attempts.

  1. Go to Settings Set a passcode on iPhone (4), then do one of the following:

    • On an iPhone with FaceID: Tap FaceID & Passcode.

    • On an iPhone with a Home button: Tap TouchID & Passcode.

  2. Scroll to the bottom and turn on Erase Data.

    Set a passcode on iPhone (5)

After all data is erased, you must restore your device from a backup. If you didn’t back up your iPhone, you need to set it up again as new.

Turn off the passcode

  1. Go to Settings Set a passcode on iPhone (6), then do one of the following:

    • On an iPhone with FaceID: Tap FaceID & Passcode.

    • On an iPhone with a Home button: Tap TouchID & Passcode.

  2. Tap Turn Passcode Off.

Reset the passcode

If you enter the wrong passcode six times in a row, you’ll be locked out of your device, and you’ll receive a message that says iPhone is disabled. If you can’t remember your passcode, you can erase your iPhone with a computer or with recovery mode, then set a new passcode. See the Apple Support article If you forgot the passcode on your iPhone, or your iPhone is disabled.

Note: If you made an iCloud or computer backup before you forgot your passcode, you can restore your data and settings from the backup.

Set a passcode on iPhone (2024)
Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 6387

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.