How to Reset Your Xiaomi Phone If You Forgot Your Password

The situation when the owner of Xiaomi can not get into the system because of a forgotten pattern lock or pin code is quite common.The smartphone turns into a locked brick, access to contacts and photos is limited, and panic increases with every minute. Fortunately, the Android operating system and the shell of MIUI (or the new HyperOS) provide several scenarios for getting out of this predicament.

It's important to understand that in most cases, you'll have to take drastic measures to bypass the security. A complete data reset is the only reliable way to return access to the device if you don't remember the unlock code. All files stored in internal memory will be permanently deleted, so it's worth preparing for this step morally.

Before you start to act, you need to clearly define the current state of the gadget: is it online? Is it debugging on USB? Is the Mi Account tied? The answers to these questions determine the choice of the specific unlock method. Below we will discuss in detail all possible options, from simple remote commands to hardcore flashing through Recovery.

It’s worth noting that the current security versions of Google and Xiaomi require proof of identity after a reset, and if the device has enabled Find Device, the system will require you to enter a login and password from an account that was synchronized earlier, a protection mechanism against theft that can’t be avoided by simple formatting.

Use Find Device for Remote Cleaning

The most civilized and easy way to regain control of a smartphone is to use the manufacturer's cloud service, which only works if the locked device logs in to a Mi Account and the Internet (Wi-Fi or mobile data) is turned on, and the "Find Device" function in the security settings must be activated.

To start the procedure, you will need any other gadget with access to the network: a computer, a tablet or a friend's phone. Go to the official i.mi.com website and log in using the same credentials as on the locked device. The service interface allows you not only to track the location, but also to control the device remotely.

  • πŸ” Select your device from the list at the top of the screen if there are several of them.
  • πŸ—‘οΈ Find and click the "Erase Device" button).
  • πŸ” Confirm the operation by entering the password from the Xiaomi account.
  • πŸ”„ Wait for the process to be completed, after which the phone will restart in factory condition.

Once you do this, the phone will be completely cleared, the pattern lock or digital code will be deleted along with all user data, and when you first turn on, the device will require you to enter the password from the Mi Account that was set before locking, a mandatory security measure that you will not be able to ignore.

⚠️ Warning: If the device did not have the Internet or search function enabled, this method will not work, in which case the smartphone will not receive a remote reset command until it connects to the network.

πŸ“Š Have you ever had a smartphone lock?
Yeah, I forgot my password.
No, I'm using FaceID.
Stolen phone blocked
So far, no problems.

Reset via Recovery (Hard Reset)

If remote access is not possible, the Recovery Mode, a low-level interface that is available even when the screen is locked, allows you to perform administrative tasks, including formatting memory partitions, and logs into this menu with a combination of physical buttons.

The login procedure may vary depending on the model and firmware version. Most often, you need to turn off your smartphone completely, then press the power and volume buttons simultaneously. Hold them until the Mi or Android logo appears, then release the power button, continuing to keep the volume.

β˜‘οΈ Algorithm of actions in Recovery

Done: 0 / 4

In the Recovery menu, the navigation is done with volume buttons (up-down), and the choice is confirmed by the power button. On some models, such as MIUI 12/13/14, the menu can support touch control, which greatly simplifies the process. You need to find Wipe Data or Clear Data.

The system will warn you that all data will be destroyed. Confirm the action by selecting Wipe All Data. After that, the cleaning process will begin, which will take from a few seconds to a couple of minutes. When completed, the message will appear "Data wiped successfully." All you have to do is select the Reboot to restart the system.

⚠️ Attention: On new versions MIUI After resetting through Recovery, you may need to enter a password from your Mi Account, and if you don't remember it, unlocking it will be extremely difficult.

What to do if Recovery is blocked?
Some carriers or enterprise versions of the software may block access to Recovery, which requires the use of specialized PC software such as the Mi Flash Tool and the availability of an unlocked bootloader, which is a more complex procedure requiring a wait of 7-14 days after submitting an application to Xiaomi.

Unblocking through Google Account (for older versions)

On devices with Android below 5.1 (which is rare these days, but perhaps on very old models like the Redmi 1S or the early Mi), there was a possibility of resetting your password through your Google account. After five failed attempts to enter the code, the "Forgot your password?" or "Forgot your pattern lock" button appeared on the screen.

By clicking on this button, a user could enter a login and password from their Google account associated with the device, and after successful authorization, the system suggested installing a new security method or removing it altogether, a mechanism called FRP (Factory Reset Protection), but in early implementations it was less stringent.

In today’s Android 10-14, this method doesn’t work as it is in the classic form, and now, after resetting (even through Recovery), the system will require you to confirm an account that was synced to the phone before locking, so that the attacker who stole the phone can’t just drop it and use it as if nothing had happened.

MethodConditions requiredData securityDifficulty
Find DeviceInternet, Mi AccountNo (deletion)Low.
Recovery ModePhysical accessNo (deletion)Medium
Google FRPOld Android (< 5.1)No (deletion)Low.
Xiaomi ADBIncluded debuggingYeah (possibly)Tall.

πŸ’‘

If you buy a used Xiaomi phone, be sure to ask the seller to log out of his Mi Account and Google account right in front of you, otherwise after the first reset, you will get a locked device.

Use of debugging by USB and ADB

This is the most technically challenging method, but it gives you the best chance of success in specific situations. It only works in one case: if you have already turned on the Debugging option in the Developer menu before locking the screen. USB (USB If this function has been disabled, the method is useless.

To implement it, you'll need a computer with ADB and Fastboot drivers installed. Connect your phone with a cable to your PC. If the "Allow debugging from this computer?" window appears on the lock screen and you can confirm it (sometimes connecting the keyboard via OTG helps), then you've gained access to the file system.

adb shell rm /data/system/gesture.key


adb shell rm /data/system/keyguard/locksettings.db




adb shell rm /data/system/locksettings.db-wal




adb shell rm /data/system/locksettings.db-shm

Executing these commands in the terminal will delete files that store information about the pattern lock and pin code. Once rebooted, the protection will disappear and you can log in to the menu without a password. However, on newer versions of MIUI with enhanced protection, this trick may not work, since files can be encrypted or protected by access rights that are not available without root rights.

If standard commands don’t help, you can try a more aggressive ADB reset method that emulates factory reset, but with a greater chance of success than menu buttons:

adb reboot recovery

Or a data cleanup team (does not work on all firmware)



adb shell am broadcast -a android.intent.action.FACTORY_RESET

⚠️ Attention: Use ADB If Windows can't see the phone, check the Device Manager and install universal Google drivers. USB Driver or specific to Xiaomi.

πŸ’‘

USB debugging is a powerful tool for developers that can save a phone from flashing in a critical situation, but only if it was turned on in advance.

Mi Account and FRP issues after reset

Often, users are faced with a situation where the password from the screen is reset, but the phone requires activation. This is FRP (Factory Reset Protection) protection. The device requests a login and password from a Google or Mi Account that was synced to the phone before the reset. This is done to protect against theft.

If you remember your account, just type it in. If you forget both your screen password and your account password, it gets complicated. You can re-access your Google account through Forgot Password on any other device, but it takes time (usually 24 hours for security).

With Mi, it's more stringent. If you don't remember the password, you can restore it through id.mi.com by linking your phone number or email. However, if your phone number is lost or your SIM card is not active, it's almost impossible to restore access to your Xiaomi account without contacting customer support with purchase checks.

  • πŸ“ž Try to restore access to the phone number associated with the account.
  • πŸ“§ Check the saved passwords in your browser (Chrome, Safari), they may be there.
  • πŸ“„ Find a check or box from your phone – they may be needed to unblock the service center.

When the help of a service center is needed

There are cases when independent actions do not lead to results or are too risky: if the phone is blocked by the operator, has the status of stolen in the database, or if after all the manipulations the Mi logo (bootloop) is hanging, it is better to contact the professionals.

Official Xiaomi service centers can unlock the device only if you show proof of ownership (check, warranty card, box with IMEI). Without a check, you will be denied service, as this is contrary to security policy.

Private workshops offer FRP software reset services, but it is always a risk. Unqualified intervention can result in a motherboard (a β€œbrick”) that cannot be repaired software, and the use of pirated reset software may threaten your personal data in the future.

What is IMEI and where can I find it?
IMEI is a unique device identifier, which can be seen on a locked phone by quickly pressing the power button 5-7 times (on some models), or on the sticker under the battery (if it is removable) and on the original box, which is the number you need to check the lock status.

Frequently Asked Questions (FAQ)

Can I reset my password without losing my photos and contacts?
Unfortunately, on modern versions of Android and MIUI, this is not possible unless you have USB debugging enabled and backup done to the cloud. Password reset always involves formatting the data section where both the key cipher and your files are stored, and the only chance is to remember the password or find it in the records.
What if the phone says "Device locked" after resetting?
This means that FRP protection is working. You need to enter your Google or Mi Account information that was synced to your phone before the reset, and if you don't remember it, try to re-access your accounts through your computer, and without that, your phone will remain locked.
Will the phone drop if the battery runs out during the process?
If the battery runs out during data formatting, the file system may get damaged and the phone will stop booting.Be sure to have at least 50-60% battery life before starting any operations through Recovery.
Will the phone reset the password?
Yes, a full clean flash through the Mi Flash Tool is guaranteed to delete all data and passwords. However, it is a more complex process, requiring an unlocked bootloader that unlocks with a wait of 7 to 30 days.