How to unlock a Xiaomi phone without data loss: the full guide 2026

A forgotten pattern lock, PIN-Xiaomi code or password is a situation that one in five users encounter, and the main problem is that most standard unlock methods (such as resetting via Recovery) lead to a complete cleanup of internal memory. However, there are ways to get around the lock without losing data – from official Mi Account tools to technical solutions through the use of the Internet. ADB or Fastboot.

In this article, we will discuss 7 working methods relevant to the 2018-2026 models (including the Redmi Note 12, POCO X5, Xiaomi 13T We will focus on the nuances of when this will work and when it will make things worse, for example, unlocking through Mi Cloud is only possible with an attached account, and using it is possible to use it. EDL-The regime requires a special cable and risks cancelling the warranty.

We warn you right away that none of these methods is 100% guaranteed to save data, and the probability of success depends on the phone model, the version of MIUI, and the type of lock (password, fingerprint, Face ID), and if the phone is encrypted, the chances are significantly reduced.

1 Unlocking through Mi Account (official method)

The safest way to do this is to use a linked Mi Account, which works if:

  • πŸ“± The phone is connected to the Internet (Wi-Fi or mobile network).
  • πŸ”‘ Remember the username and password from Mi Account.
  • πŸ”„ The device is enabled synchronization with the cloud.

After 5 failed attempts to enter a password, the system will offer the option "Forgot your password?" Click on it and follow the instructions:

  1. Enter the email or phone number associated with the account.
  2. Confirm your identity via SMS or email.
  3. Create a new unlock password.

⚠️ Warning: If the phone is not connected to the network, this method will not work. 9A s MIUI 12.5) Re-authorization in applications may be required after unlocking.

πŸ’‘

If you don’t have access to your linked phone number, try to restore your account via backup email. Go to account.xiaomi.com and select Forgot Password β†’ Restore via email.

2.Use of Fastboot Mode (for advanced users)

The method is suitable if you have access to a computer and installed Xiaomi drivers. The bottom line: through Fastboot you can reset your password without affecting user data. However, this only works on devices without encryption (check in the settings: Settings β†’ Additional β†’ Encryption and accounts).

Step-by-step:

  1. Turn off the phone. Press Volume down + Power to enter the Fastboot.
  2. Connect the device to the PC via USB.
  3. Open the command prompt (cmd) and type: fastboot devices If the device is displayed, continue. If not, install the drivers.
  4. Enter the command to delete the password: fastboot erase userdata Attention! On some firmware, this command resets all data. For secure deletion of only the password, use: fastboot erase locksettings
  5. Reboot the phone: fastboot reboot

πŸ”Ή Important: On models with MIUI 13+ And if you turn on encryption, this method will cause data loss. β†’ The phone.

Install Xiaomi drivers on PC|Download the platform ADB (like, from here)|Check if the device is displayed in fastboot devices|Backup of data (if possible)-->

3. Unlocking through ADB (Android Debug Bridge)

The method works if the phone previously had USB debugging mode enabled (Settings β†’ About Phone β†’ MIUI Version β†’ 7 times press to unlock developer options β†’ Settings β†’ Additional β†’ For developers β†’ USB debugging). If debugging is not activated, the method will not work.

Instructions:

  1. Connect your phone to your PC via USB (use the original cable!).
  2. Open the command line and type: Adb devices If the device does not appear, confirm the debugging permission on the phone screen.
  3. Delete the file with the password: adb shell rm /data/system/gesture.key or PIN-code: adb shell rm /data/system/password.key
  4. Reboot the device: adb reboot

Once rebooted, the password will be reset, but all data will remain in place, but on MIUI 14, this method may not work due to the changed key storage structure.

πŸ“Š What Unlocking Method Have You Tried Before?
Mi Account
Fastboot
ADB
I went to the service center.
Never blocked your phone.

4 Unlocking through Mi Cloud (remotely)

If the β€œFind Device” function is enabled on the phone (Settings) β†’ Mi Account β†’ Mi Cloud β†’ Find the device, you can try to unlock it remotely, and this method works even if the phone is turned off, but it requires that you do not have to:

  • 🌐 Internet connection (on next turn on).
  • πŸ“ Geolocation enabled (not necessarily, but increases the odds).
  • πŸ”’ Linked Mi Account Account.

Instructions:

  1. Go to i.mi.com and log in.
  2. Select the locked device in the list.
  3. Click β€œUnlock the device” and confirm the action.

⚠️ Note: On some models (e.g, POCO F4) After you remotely unlock, you may need to enter your old password when you first connect to Wi-Fi. If you don't remember it, it won't work.

MethodConditions requiredData retentionDifficulty
Mi AccountLinked account, Internetβœ… Yes.⭐
FastbootDrivers, PCs, no encryption⚠️ Partially.⭐⭐⭐
ADBUSB debugging enabledβœ… Yes.⭐⭐
Mi CloudThe function "Find the device", the Internetβœ… Yes.⭐
EDLSpecial cable, firmware.❌ No.⭐⭐⭐⭐

5. Unlock through EDL mode (for power users)

EDL (Emergency Download Mode) is an emergency firmware mode that allows you to reflash your phone without unlocking the bootloader. This method voids the warranty and can lead to complete data loss if the wrong firmware is selected. Use it only as a last resort!

What you need:

  • πŸ”Œ EDL-cable (or homemade adapter with contact closure).
  • πŸ’» Mi Flash Tool and firmware for your model.
  • πŸ”§ Knowledge in phone firmware.

Instructions:

  1. Turn off the phone.
  2. Connect. EDL-cable (or close contacts on the board).
  3. Launch the Mi Flash Tool, select the firmware and click "Flash".
  4. Wait until the end (10-15 minutes).

⚠️ Warning: Wrong firmware can turn a phone into a brick before use EDL Check firmware compatibility with your model in forums (for example, 4PDA or Xiaomi.eu).

What if the phone doesn’t turn on after EDL?
If after firmware through EDL the phone does not respond to the power button, try: 1. Connect to charging for 30-60 minutes (possibly the battery has run out). 2. Repeat the firmware with another version of the software. 3. Contact the service center - independent "resuscitation" without experience can aggravate the problem.

6. Contact the Xiaomi Service Center

If all of these methods do not work, you can contact the official service center.

  • πŸ› οΈ Guaranteed data retention (if possible).
  • πŸ“„ Official documentation and check.
  • πŸ”„ Recovery of the guarantee.

There are, however, downsides:

  • ⏳ Waiting (from 3 days to 2 weeks).
  • πŸ’° Cost (from 1,500 to 5,000 rubles depending on the model).
  • πŸ”’ In some cases, the wizard may refuse to save data (for example, if encryption is enabled).

Before the service visit:

  1. Check if the warranty period (usually 12 months) has expired.
  2. Bring a check or a box from your phone.
  3. Check by phone if they are unlocking without losing data.

πŸ’‘

Official Xiaomi service centers in Russia can be found on the website mi.com/ru/service/location. Check before visiting if they work with your model – some new devices (e.g. Xiaomi) 14) They can only be served in a limited number of centers.

7. Alternative methods (with the risk of data loss)

If data storage is not essential, you can use standard reset methods:

  • πŸ”„ Hard Reset via Recovery: Press the Volume Up + Power, select "Wipe Data." All data will be deleted!
  • πŸ“± Mi Account reset (if phone is stolen): All data can be deleted remotely on i.mi.com.
  • πŸ› οΈ Flip-through SP Flash Tool: Suitable for MediaTek processor devices (e.g. Redmi) 10A).

⚠️ Attention: On phones with MIUI 13+ And the encryption that's enabled, even after you reset it through Recovery, may require you to enter the old password, and then you can only use a full flashing through Fastboot or a full flashing. EDL.

FAQ: Frequent questions about unlocking Xiaomi

Can I unlock Xiaomi if I forget my Mi Account password?
No. Without access to a linked account, official unlocking methods will not work; the only option is to contact the service center with documents on the phone (if it was officially purchased), in some cases, you can try to restore access to the account through Xiaomi support, but the process can take up to 30 days.
Why does a Fastboot phone require an old password?
This is because of File-Based Encryption (FBE), which encrypts user data. Even after a password is reset, the system requests the old key to decrypt it. Solution: Fastboot erase userdata, or EDL, to refashion the phone.
Does ADB unlock work on Xiaomi with MIUI 14?
Since MIUI 13, Xiaomi has tightened protection and the standard adb shell rm /data/system/gesture.key commands have stopped working. However, some models have an alternative method: adb shell su rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot.
What to do if the phone is locked after the firmware?
If you have been using Fastboot or EDL The phone is locked on the Mi Account screen, which means that the account is tied to the device. Solution: Log in to the same account that was tied to the firmware. If the account is lost, contact Xiaomi with proof of purchase. On unofficial firmware (for example, Xiaomi.eu) you can bypass the lock through a patch. anti_rollbck, But it's risky.
How to avoid blocking Xiaomi in the future?
So that you don't have to face the problem again: πŸ” Use a fingerprint or face. ID password-in-app. πŸ“ Write your password to a secure location (e.g. Google Password Manager). ☁️ Enable backup in Mi Cloud (Settings) β†’ Mi Account β†’ Mi Cloud β†’ Backup). πŸ”§ Check regularly if the debugging is included USB (case-by-case ADB).