How to unlock Xiaomi with a forgotten PIN code

The situation when a user forgets the digital access code to his smartphone is much more common than is commonly believed. Owners of Xiaomi, Redmi and Poco devices are not immune from this, as the security mechanisms of the Android system and the MIUI shells become stricter. If you encounter a locked screen, panic early: there are several proven ways to restore access to data or, in extreme cases, return the functionality of the gadget.

It is important to understand that modern data protection methods are aimed at preserving confidentiality, so it is often impossible to fully save information without prior backup. Resetting is the most effective method when the pattern lock or digital password is completely forgotten. Before starting any manipulations, make sure that the device is charged at least 50-60% so that the process does not interrupt at the most inopportune moment.

In this article, we will discuss all the current options, from using a cloud service to hard reset through the engineering menu. The choice of the specific method depends on the version of the operating system, the presence of a Mi Account and the USB debugging enabled. Carefully study each item to choose the most suitable for your case.

Using Mi Accounts to Remotely Unblock

The most gentle and easy way to unlock a device without losing data is only available to users who have previously linked their Mi Account to a smartphone, which works if the device is on the Internet and activated the Find Device function. Xiaomi security system allows you to remotely control access through the official web portal.

First, you need to go to i.mi.com from any other device (computer or tablet), enter your login credentials, the login and password used on the locked phone, and after successful authorization, the system will offer a control menu where you need to select the lock option.

The service interface allows you to set a new temporary password that will replace the forgotten PIN. After you set a new combination, wait a few minutes for the server to sync with the smartphone. Then try entering a new code on the locked device.

  • 📱 Make sure that your locked phone has mobile internet or Wi-Fi enabled.
  • 🔐 You should remember the password from your Mi Account, not just the screen PIN.
  • ⏳ The synchronization process can take from 1 to 5 minutes depending on the quality of the communication.

⚠️ Note: If Find Device was disabled in the phone settings before locking, this method will not work.

📊 Do you use a Mi Account on your smartphone?
Yeah, I always do.
No, never came in.
Forgot my account details.
I only use it for the cloud.

Resetting with Recovery Mode (Hard Reset)

If the cloud method is not available, the only reliable option is to completely reset data through the recovery menu, a process known as Hard Reset that will completely clean up the internal memory of the smartphone, returning it to a factory state. All photos, contacts and applications will be deleted, so this step is a last resort.

To enter recovery mode, you need to turn off your smartphone and pinch a certain combination of buttons. On most Xiaomi and Redmi models, this is the simultaneous clamping of the volume button and the power button. Hold them until the brand logo appears, then release the power button, continuing to keep the volume.

In the Recovery menu, you can control the volume buttons (up/down) and the on button (select). You need to find the Wipe Data or Clear Data item. After you choose, confirm the action by pressing Wipe All Data. The system will warn you that action is irreversible - confirm the reset again.

☑️ Preparation for Hard Reset

Done: 0 / 4

Once the cleaning process is complete, the phone will automatically restart, the first load can last longer than usual, up to 10-15 minutes, and when turned on, the system will ask you to enter data from a Google account that was synced with the device earlier, as part of the protection against theft.

Unlocking through Google’s Find My Device service

An alternative to Xiaomi’s branded service is Google’s standard tool: If a locked device has GPS and internet activated and a Google account logged in, you can try to unlock it remotely, a method that works for older versions of Android, but newer versions often only allow you to erase data.

Go to android.com/find and log in to the same Google account that you use on your smartphone. The system will try to locate your device. From the management menu, select the "Erase Device" option.

This command will force the reset process to start, and the remote cleaning works even if the phone is in sleep mode, but it's important to connect to the network periodically, and once you do that, the phone will return to the factory settings, and the PIN will be reset along with the rest of the data.

ParameterMi CloudGoogle Find My DeviceRecovery Mode
Data retentionMaybe.No (erasing)No (erasing)
The Internet's DemandI'll be sure.I'll be sure.Not required
DifficultyLow.Low.Medium
The risk of blockingLow.Low.Medium (in case of errors)
What to do if your phone is not connected to the internet?
If the smartphone is off or has no access to the network, remote methods (Mi Cloud and Google Find My Device) will not work. The command to unlock or reset will be performed only when the device goes online.

Using ADB to remove the lock (for advanced)

For users familiar with the computer and command line, there is a method of unlocking through USB debugging. This method only works if the USB Debugging function was included in the Developer Menu before locking the screen, and the computer already has the debugging rights for this device.

You'll need to install ADB drivers on your PC and connect your phone with a cable. Open the command line or terminal in the tool folder of the platform. Enter a command to check the connection:

adb devices

If the list shows a device with device status, then the connection is established. Next, you can try to delete the file that stores information about the pattern lock or password.

adb shell rm /data/system/gesture.key

Or, for a digital password:

adb shell rm /data/system/password.key

Once you have completed the command, restart the device. In some cases, this allows you to log in without entering a password or with any arbitrary code. However, on modern versions of MIUI with an updated security level, this method is often ineffective due to the encryption of the /data partition.

⚠️ Attention: Attempts to enter commands ADB on devices without debugging enabled, do not try to install third-party drivers from unverified sources, this can lead to infection of the computer.

💡

If ADB can’t see the phone, try installing Google USB Driver Universal Driver or Qualcomm/MTK specific drivers depending on your smartphone’s processor.

Bypassing locking through Smart Lock

Android’s Smart Lock feature allows you to keep your device unlocked under certain conditions. If you’ve previously configured trusted locations, Bluetooth devices, or facial recognition, it’s possible that the phone unlocks automatically when conditions are met.

Try to remember if you've added your home or office to your trusted list. GPS-The phone can let you in without a PIN. Also check if the smartphone is paired with a smartwatch or headphones — when you connect to a trusted Bluetooth device, the lock is sometimes removed.

This method is more a preventive measure or lucky chance than a full recovery manual. However, it is worth checking all possible scenarios, especially if there is no reset PC at hand. Smart Lock is set up in Settings → Security → Smart Lock.

Note that newer versions of MIUI may have a limited or hidden Smart Lock functionality in the depths of the security menu, and if you don’t find it, it’s inactive or not fully supported by the manufacturer.

  • 📍 Trusted places only work when switched on GPS high precision determination.
  • 🎧 Trusted devices require Bluetooth to be on and the device to be within range.
  • 👤 Facial recognition may be less reliable than a PIN, but faster to use.

Prevention and backup

To avoid future loss of access, it is critical to back up regularly. In the Xiaomi ecosystem, this can be done via Mi Cloud or locally to a memory card/computer. Backup allows not only to restore contacts and photos, but also to quickly configure a new phone or a recovered one after a reset.

Write your PINs and graphic keys down to a safe place, like a paper notebook or a password manager on your computer, and your memory tends to be a little bit of a failure, especially when it comes to numbers that are rarely used, and don't use too simple combinations like 1234 or 0000.

💡

Regular synchronization with the cloud is the only way to ensure data safety if you need an emergency reset.

Check your Mi Account periodically and remember your password. Your account is the key to your data in the manufacturer's ecosystem. If you forget your password, too, it will be almost impossible to restore access to your phone without contacting the service center with a check for purchase.

Frequently Asked Questions (FAQ)

Can I unlock Xiaomi without losing data?
Without data loss, you can only unlock your phone through Mi Cloud (if Find Device is enabled) or Smart Lock. In all other cases, including Hard Reset, the data will be deleted without recovery if no backup is made.
What to do if your phone requires a post-reset (FRP) account?
This is Google Protection (FRP) and you have to enter a login and password from a Google account that was synced to your phone before you reset, and if you don't remember them, you can restore your account through Google, but it's very difficult to unlock your phone without that data legally.
How long does it take to reset completely through Recovery?
The data formatting process usually takes 5 to 15 minutes depending on the amount of internal memory and the speed of the drive, and the first download after the reset can also take longer than usual - up to 10-20 minutes.
Will the phone be reflashed if the PIN is forgotten?
Yes, completely flashing the device through the Mi Flash Tool will also reset all data and remove the lock, but it is a more complex and risky process that requires an unlocked bootloader, which is impossible to do on a locked phone without special permissions.