If you forgot the iPhone passcode, Apple does not provide a way to reveal or bypass that passcode. Regaining access generally requires resetting the iPhone, which erases the data currently stored on it unless that data is available in a backup or synced service.
- On a supported locked iPhone with an internet connection and Find My enabled, look for Forgot Passcode? on the iPhone Unavailable or Security Lockout screen.
- Follow the onscreen reset option and sign in with the Apple Account associated with the iPhone when requested.
- If the on-device option is unavailable, connect the iPhone to a Mac or Windows PC and place it in recovery mode.
- Use Finder on a Mac or Apple Devices on Windows to choose Restore.
- After the erase, set up the iPhone again and restore an available backup.
If you recently changed the passcode, some iOS versions offer a limited passcode-reset option using the previous passcode. Otherwise, do not trust software or websites claiming they can unlock an iPhone without erasing it or satisfying Activation Lock.