Forgot your Android unlock code: what happens to your data
You recently changed the code, or the phone sat in a drawer for months and the pattern no longer comes back to you. After too many attempts the phone locks. Before doing anything it's important to know what can really be done, because many solutions found online are useless or dangerous.

First of all: try calmly
- Try the variants of the PINs and patterns you used, carefully: after several errors the phone imposes longer and longer waits.
- If you used fingerprint or face, remember that after a restart Android still asks for the code.
- On some phones, after several errors, a “Forgot password” option appears: follow the procedure the phone offers.
Remote unlock
On some Samsung phones, if the remote unlock option had been enabled in the manufacturer's location service in the past, the phone can be unlocked from a computer with the Samsung account. If it wasn't enabled before, it can't be enabled now.
If there's no other way
Without the code, the only route provided is a factory reset (from the recovery menu or from Google's Find My Device). The reset erases everything. Afterwards, to set up the phone, you'll also need the Google account that was linked to it (anti-theft protection).
What you get back after the reset
Before going ahead, check from a computer what's safe: - Google Photos and Google Drive; - Google Contacts; - the phone backup in the Google account or the manufacturer's cloud; - the WhatsApp backup on Google Drive; - the microSD card, if present: remove it before the reset.
What NOT to do
- Don't rely on programs or services that promise to “unlock Android without losing data”: on recent phones it isn't possible, and many are scams.
- Don't install modified firmware.
When the lab helps
If you know the code but the phone is broken or the screen is cracked, the data can be recovered. See phone with a broken or black screen and Android and Samsung data recovery. For iPhone: iPhone “unavailable”.

