New direction for the Mi Flagship Store at Glattzentrum More information here.

Forgot my unlock code: is there a way without losing data?

Forgotten the unlock code of your Xiaomi smartphone, meaning the pattern, PIN or password? After a restart, Android asks for this code, even if you normally use your fingerprint. There is no official way to bypass the code. If you no longer know it, the only option is a factory reset.

Important
A factory reset deletes all locally stored data on the device. Without a backup it cannot be recovered. We can neither reset nor bypass the unlock code.

Why does the phone ask for the code after a restart?

Android security feature After every restart, the device has to be unlocked once with a pattern, PIN or password. Only then does the fingerprint work again. Entering the SIM PIN does not replace this, as it is a separate protection.

What is possible and what is not?

Bypassing or replacing the unlock code There is no official way to do this without unlocking, not even with a fingerprint or another login. This protects your data from unauthorised access.
Not possible
Factory reset According to Xiaomi, the only option if the code has been forgotten. Local data is lost in the process.
Possible
Restore data from a backup If you created a backup beforehand, for example through your Google or Xiaomi account, you can restore it after the reset.
With a backup

What to do

1
Try the code again calmly Often it is just a transposed digit, different upper or lower case, or a different starting point on the pattern. After several failed attempts the device locks for a short time. Wait for the countdown before trying again.
2
Prepare before the reset Charge the battery and have the login details of your Google and Xiaomi accounts ready. After the reset, the device may ask for these accounts to confirm.
3
Reset to factory settings Follow Xiaomi's guide for your model, linked below. The button combination may differ by device.
4
Set up again and restore the backup Set a new unlock code and restore your data from the backup, if you have one.
Good to know
We advise against programs and guides from the internet that promise access without data loss. They are unreliable, may contain malware and bypass your device's protection.

Official guides

Xiaomi: unlocking your phone mi.com/uk/support/faq/details/KA-07085
Google: unlock an Android device support.google.com/android/answer/7663172

Frequently asked

Can I still back up my data before the reset?
Not without unlocking. You have no access to the local data. Only content that is already backed up in the cloud is kept.

Why does the fingerprint not work after a restart?
After every restart Android asks once for the pattern, PIN or password. After that the fingerprint works again.

Is the SIM PIN enough to unlock the phone?
No. The SIM PIN only protects the SIM card. The unlock code belongs to the device and is requested afterwards.

Is this a warranty case?
No. A forgotten code is not a defect but a deliberate protection of the device.

Can you unlock my phone for me?
No. We have no way to reset or bypass the unlock code.

I forgot the password of my Xiaomi account. Is that the same thing?
No. The Xiaomi account is separate from the device unlock code. We have no access to Xiaomi accounts. You reset the password via the Xiaomi login page.

What happens to my accounts after the reset?
The device may ask you to log in with the Google and Xiaomi accounts that were previously set up on it. Keep the login details ready.

This information is based on Xiaomi and Google sources and is provided without guarantee. Menus and button combinations may differ depending on the model and software version.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article