How to unlock Xiaomi phone if you forget your password: the full guide

When a smartphone suddenly stops letting its owner in, it's one of the most stressful things for the user. You pick up your Xiaomi, you type in the usual combination, but the screen treacherously reports an error. After several failed attempts, the device locks up for a minute, then for five, and sometimes for an hour. The panic mounts, because there may be important contacts, photos and access to banking applications inside. But don't despair, because the engineers of Android and MIUI have envisaged several scenarios for restoring access.

Before you start taking action, you need to evaluate the situation and understand what kind of lock is installed. PIN-A code, a complex password, or a fingerprint unlock that suddenly stops being read, and the way you protect yourself and your Mi Account status will determine how you proceed. In some cases, it will be possible to save data, in others – you will have to make sacrifices for the sake of returning the functionality of the device.

In this article, we will discuss in detail all the known ways to unlock a Xiaomi phone if you forget your password. We will look at both standard methods through cloud services, and more radical options through Recovery mode. It is important to understand that modern security systems are designed to protect your data from outsiders, so some methods can lead to complete deletion of information. The only way to save data with a forgotten password is to use the “Find device” function, provided that it was activated in advance and the phone is connected to the Internet.

Use the “Find Device” (Mi Cloud) function

The most civilized and safe way to get back to the system is to use a cloud service from the manufacturer. Find Device allows you to remotely control your smartphone if you log in to your Mi Account and have data enabled, and the good thing about it is that it doesn't require a cable connection or a computer on hand, just any other gadget with Internet access.

First, you need to go to the official Mi Cloud site from any browser, you need to log in with the same ID used on the locked phone, if you remember the username and password from the account, the system will immediately offer a list of associated devices, select your smartphone from the list, and the control panel will open before you.

In the control menu, find the "Device Lock" or "Unlock" button, and here's an important caveat: if you just lock the screen with a new code, the old password won't disappear and the new one will become active. However, in some versions of MIUI, there's a remote unlock option that removes all the screen security mechanisms, and once confirmed, the phone should receive a command and unlock.

What to do if the “Find Device” function does not work?
The function may not work if the phone is turned off, in flight mode, or does not have an active mobile Internet/Wi-Fi connection. Also, the command will not be executed if the device is disabled geolocation or sync with Mi Cloud.

It's worth noting that the effectiveness of this method depends on the settings that were put up earlier, if the device search function was turned off in the security settings, this path will be closed, in which case you will have to consider more complex options that require intervention in system partitions.

💡

Remote unlocking works only when the phone is actively connected to the network and the “Find Device” function is enabled in the Mi Account settings.

Resetting settings through Recovery mode

If cloud-based methods are not available, a recovery mode known as Recovery Mode comes to the rescue, a special diagnostic interface built into the firmware of each Android smartphone, and allows low-level operations such as cleaning the cache, installing updates, or completely resetting the system to factory settings (Hard Reset).

To enter this mode, you need to turn off your phone completely. Then press the volume button and the power button at the same time. Hold them until the Mi logo or Recovery menu appears. Depending on the version of the shell, the menu can be touch-sensitive or controlled by volume buttons (up/down) and power button (select).

In the menu that opens, select a language (usually English and Chinese) and find Wipe Data or Delete Data. The system will warn you that all files will be deleted. Confirm the action by selecting Wipe All Data. Once the process is complete, the phone will prompt you to return to the main menu (Back to Main Menu) and reboot.

☑️ Reset algorithm via Recovery

Done: 0 / 4

⚠️ Warning: Once reset via Recovery, the phone will require you to enter the password from the Mi Account that was previously associated with the device, which is Action Lock, and it is almost impossible to circumvent it without access to the account.

This is the most universal method, because it works even when the touch screen is partially non-functioning or the system is frozen, the main thing is to make the buttons physically healthy, after the reboot you will get a clean phone, as if just from the store, but without your personal files.

📊 What type of lock is you currently holding?
pattern lock
Digital. PIN-code
A complex password
Fingerprint.
Face ID

Unlocking through Google’s Find Device service

An alternative to Xiaomi’s branded service is Google’s standard tool: If your smartphone has a Google account activated and geolocation enabled, you can try your luck through android.com/find. This method has historically allowed you not only to track location, but also to change the password of the screen lock.

Log in from your computer or other phone using the same Google account as on your locked device. In the list of devices, select your Xiaomi. In the side menu, you will see several options: Call, Lock and Clear.

Click on Lock, and the system will prompt you to enter a new password, and unlike Mi Cloud, here you set a temporary password that will replace the old one, enter a new combination, confirm the action, and in a few minutes (if you have a network), the old pattern lock or code will be replaced.

However, with modern versions of Android (starting with version 9-10 and up), Google has gradually eliminated the ability to directly change the screen lock password through the web interface for security reasons, which is now often only available for older devices or requires the installation of the “Device Policy” app, which is not available on all smartphones.

MethodWe need the Internet.Data retentionI need an account.
Mi CloudYes.Maybe.Mi Account
RecoveryNo.No.Mi Account (after reset)
Google FindYes.No (most often)Google Account
ADB (debugging)No.Yes.Not required

Use of USB debugging (ADB)

For advanced users who have pre-installed USB Debugging in the developer menu, there is a way to unlock through a computer, which allows you to delete the file that stores the password hash without affecting the user's personal data, but it only works on older versions of Android and requires drivers.

You'll need a computer, USB-cable ADB Drivers. Connect your phone to your PC. Open the command line on your computer (cmd) and enter the command to check the connection: adb devices. If the device is determined, you can proceed to delete the system lock files.

adb shell rm /data/system/gesture.key


adb shell rm /data/system/password.key




adb shell rm /data/system/locksettings.db

Once you've done these commands, you delete the files that are responsible for the pattern lock and the digital password, and then you have to reboot the device, and you can type any combination on the lock screen, and the phone should let you log in, and you should immediately set a new password in the security settings.

⚠️ Note: On modern smartphones with data encryption, this method may not work, as access to the partition /data/system Unlocking can be prevented by the security system itself.

If you didn't have a developer menu on, it's not going to work. You can't check the status of debugging after the fact, so you just have to guess or try to plug in the device and watch the PC reaction. It's one of the few chances to save photos without completely resetting.

💡

If teams ADB Not working, try to reconnect the cable to another USB-port or use the original cable, as cheap counterparts often only support charging, but not data transfer.

Specialized software for resetting

There is a category of software developed by enthusiasts and repair specialists to work with the Xiaomi file system, programs like Mi Unlock Tool (official) or third-party utilities (Unlock Tool, Mi Account Unlocker) can help in difficult cases, but it is important to distinguish between tools for unlocking the bootloader and tools for removing the screen password.

The official Mi Unlock utility is designed to unlock the bootloader, which is necessary to flash the global version into Chinese or obtain root rights. It does not remove the screen password directly, but is a mandatory step for many deep recovery methods. It requires permission from Xiaomi, which is not immediately issued.

Third-party software often exploits vulnerabilities in older versions of MIUI. These programs may try to reflash the security section or modify system files. Using untested software carries risks ranging from infecting your computer with viruses to completely failing your smartphone (the “brick”). Use only proven tools from forums like 4PDA or XDA.

Often, these programs are paid or require complex setup. For the average user who has simply forgotten the code, using paid software for a one-time action may not be economically feasible. It is easier to contact a service center if the data is critical and standard methods have not helped.

Prevention and backup

The best way to deal with forgotten passwords is to have them missing at a critical moment or to have a reliable copy of data. Regular backups are not just a good habit, but a necessity in today's digital world. Xiaomi offers built-in backup tools that shouldn't be neglected.

Set up automatic synchronization of photos and contacts with Google Photos and Mi Cloud. This will take a couple of minutes, but will save you in case of loss of access. It is also recommended to write complex passwords in a paper notebook or use password managers, which can be accessed through biometrics or a master password that you remember exactly.

Check the recovery function periodically, make sure your phone number is linked to your account, your email is up to date, and Find Device is active, and when you're stressed, remembering which email you registered your phone with three years ago will be very difficult.

💡

Regularly syncing data to the cloud is the only guarantee that you will not lose important information when you need to reset your settings.

Frequently Asked Questions (FAQ)

Can I unlock Xiaomi without losing data if I forget my password?
Without data loss, this is only possible if USB debugging was enabled in advance and specific ADB methods were used, or if Find Device function was activated to remotely change the password. 90% of the time, if you forget a password, you have to do a full reset, which deletes all photos, contacts and applications.
What if your phone says “Device Locked” after resetting?
This is Mi Account (Activation Lock) protection, and you need to enter the username and password from the Mi Account that was linked to the phone before the reset, and if you don't remember your account details, you can restore access through the recovery procedure on Xiaomi's official website by submitting a check to purchase the device.
How many times can I enter the wrong password?
After 5 wrong attempts, the phone locks for 30 seconds. With each successive series of errors, the lock time increases (1 minute, 5 minutes, 15 minutes, 1 hour). After many failed attempts, the system may suggest resetting the settings, which will lead to deletion of the data.
Will the phone help to remove the password?
Yes, Clear Install, via Fastboot, deletes all data, including the password, but it will require an unlocked bootloader (which is difficult to do without access to the system) or an authorized service center account, and simply flashing on top of the existing system will not remove the password.