How to Recover Your Xiaomi Password Without a Data Reset: 2026 Proven Methods

Why Standard Resetting Is Not the Way Out

The forgotten password on Xiaomi is a situation that one in five users face, and the first thought at this point is to reset the device to factory settings via Recovery Mode. But this method has a critical disadvantage: you lose all the data β€” photos, messages, contacts and installed applications, which is especially painful for those who did not back up to Mi Cloud or PC.

Fortunately, there are alternative ways to unlock that save information, based on the features of the MIUI firmware (versions 12-14), the built-in tools of Xiaomi and the capabilities of the Fastboot mode. It is important to understand that the effectiveness of methods depends on the device model, the software version and the presence of a tied Mi Account. For example, on new flagships (Xiaomi 13 Ultra, Redmi Note 12 Pro+), some loopholes are already closed, while on budget models (POCO M5, Redmi A2) the chances are higher.

In this article, we’ll look at 5 working ways to restore access without losing data, including official and semi-official methods. Each has its own nuances – from having to confirm via SMS to using a PC with ADB drivers installed.

  • πŸ”‹ Battery level above 30% (to avoid shutdown during the procedure).
  • πŸ“Ά Wi-Fi or mobile internet access (required for some methods).
  • πŸ’» A computer with a handy Windows/macOS (for methods with Fastboot or ADB).
πŸ“Š What kind of Xiaomi model do you have?
Redmi (Note/Number series)
POCO
Xiaomi (Flagship Series)
Black Shark
other

Method 1: Unlocking with Mi Account (official method)

The most legal and safe way is to use a tied Mi Account. It works if you previously logged in to an account on a locked device and remember your login / password. Xiaomi has provided a remote unlock function, but with important restrictions:

⚠️ Note: If the device has the Find Device option enabled, after 5 failed attempts to enter a password, the system can block unlocking through Mi Account for 24-72 hours.

Step-by-step:

  1. Go to the Mi Account website from another device (PC, tablet, phone).
  2. Sign in under the same account that is linked to the locked smartphone.
  3. In the Devices section, find your phone and select the Find Device option.
  4. The map will show the location of the gadget. Below will be the "Unlock" button.
  5. Confirm the action via SMS or email (depending on your account security settings).

Once successfully unlocked, the smartphone will restart and you can set a new password, which works on all models running MIUI, but requires:

  • πŸ“± Linked account Mi (without it the method is useless).
  • 🌐 Accessing the Internet on a blocked device (via Wi-Fi or mobile network).
  • ⏳ Time to wait. SMS/email (Sometimes the confirmation comes with a delay until 10 minute).

πŸ’‘

If the Unblock button is inactive, try disabling two-factor authentication in Mi Account settings for 5 minutes, then try again.

Method 2: Use Fastboot Mode (for advanced users)

Fastboot mode is a low-level device interaction tool through a PC. It allows you to bypass the lock screen, but requires an unlocked bootloader. If you previously unlocked it through the official Xiaomi tool, the chances of success are high. Otherwise, the method will not work.

You'll need:

  • πŸ–₯️ Computer with drivers installed ADB/Fastboot (You can download it here).
  • πŸ”Œ USB-cable (preferably original).
  • πŸ“„ File. twrp.img For your model (downloaded from the site) TWRP).

Instructions:

  1. Turn off your smartphone. Press the Volume Down + Power buttons until the Fastboot logo appears.
  2. Connect the device to the PC. Open the command line (Win + R β†’ cmd) and type:
fastboot devices

If the device is identified (the serial number appears), continue. If not, re-install the drivers.

  1. Enter the command to temporarily download TWRP:
fastboot boot twrp.img
  1. The TWRP menu will open on your smartphone. Go to Advanced β†’ File Manager.
  2. Delete files: /data/system/gesture.key (for pattern lock), /data/system/password.key (for PIN/password), /data/system/locksettings.db (for all types of lock).
  3. Reboot the device (Reboot β†’ System)

⚠️ Note: Deleting these files will reset the lock settings, but will not affect user data (photos, apps, etc.). 12T, Redmi K50) After such manipulation, you may need to re-assign your Mi Account.

Install ADB/Fastboot Tools on PC|Download twrp.img forecast|Prepare original USB-cable|Check the battery level (>30%)|Disable antivirus (can block commands)

-->

Method 3: Password bypassing ADB (for MIUI 12 and older)

The ADB (Android Debug Bridge) tool allows you to control your device via the command line if you have previously enabled USB debugging mode, which only works if you have activated debugging before locking your phone. If not, skip this section.

Algorithm of action:

  1. Connect the locked smartphone to the PC via USB.
  2. Open the command line and check the connection:
adb devices

If the device appears as unauthorized, confirm access on the phone screen (if possible).

  1. Enter the commands in turn:
adb shell


su




rm /data/system/gesture.key




rm /data/system/password.key




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

After the reset, the password will be reset, which is suitable for most models on MIUI 12-14, but has limitations:

Model/SeriesSupport ADB-unlockNotes
Redmi Note 10/11βœ… Yes.Requires proof of superuser rights (su).
POCO X3/X4βœ… Yes.Some firmwares need to remove gatekeeper.password.key.
Xiaomi 11/12⚠️ Partially.It works only on custom firmware or root rights.
Black Shark 4/5❌ No.Protection against password reset via ADB at the kernel level.
What if the ADB can’t see the device?
If the adb device command returns a blank list, try: 1. Reinstall drivers (use) XDA Drivers). 2. Change USB-cable (cheap cables often do not support data transfer). 3. Enable "Charge Only" mode in the notification curtain (if available). 4. Try another USB-port (preferably) USB 2.0).

Method 4: Reset password through service code (for older models)

On Xiaomi devices until 2019 (e.g. Redmi) 4X, Mi A1, Mi Max 2) there was a service code for resetting the pattern lock or PIN-This method doesn't work on new models, but it can help owners of older gadgets.

Instructions:

  1. On the lock screen, enter any password/key 5 times until the message "Repeat in 30 seconds" appears.
  2. Press the "Emergency Call" button.
  3. Enter the code: ##7780### or #3646633###.
  4. In the menu that opens, select "Wipe Lock Settings" (the name may vary).
  5. Confirm the reset - the device will reboot without a password.

This method will not work for:

  • πŸ“± Models with MIUI 11 and later (locked at the firmware level).
  • πŸ”’ Devices with Mi Cloud Lock enabled (requires login/password input after rebooting).
  • πŸ›‘οΈ Smartphones with data encryption (File-Based Encryption).

πŸ’‘

Service codes are a vulnerability that Xiaomi has fixed in new firmware.Don't waste time on this method if your device is released after 2019.

Method 5: Recovery of access via Mi Flash Tool (Risky method)

If all previous methods failed, the last option is to run the device through the Mi Flash Tool and save data.

  • πŸ–₯️ Windows PC with Mi Flash Tool installed.
  • πŸ“ Fastboot firmware for your model (download only from official sources).
  • πŸ”§ Unlocked bootloader (if not previously unlocked, it will not work now).

Step-by-step:

  1. Turn off your phone and turn it into Fastboot mode (Loud down + Power buttons).
  2. Connect to your PC and start the Mi Flash Tool.
  3. In the program, click Select and specify the path to the unpacked firmware.
  4. At the bottom, select the option β€œClean all and lock” β†’ replace with β€œClean all” (this will save the data in the /data section).
  5. Press Flash and wait until it is completed (10-15 minutes).

⚠️ Note: Even when choosing the "Clean all" option, there is a risk of data loss if the firmware contains errors or is incompatible with your model. Before the procedure, be sure to check the firmware version through the command: fastboot getvar product And compare it with the name of the downloaded file.

After the firmware, the device will boot without a password, but:

  • πŸ”„ You will have to reconfigure some settings (Wi-Fi, accounts).
  • πŸ“² Some system applications may not work properly (requires an update via Settings) β†’ The phone).
  • πŸ”’ If you have enabled Mi Cloud Lock, you will need to log in to Mi Account.

What to do if nothing helps

If all of these methods are useless, you have three options:

  1. Contact the service center Xiaomi. Official SC can unlock the device on the documents of the owner (passport, check), but this is a paid service (from the owner). 1500 before 5000 β‚½ depending on the model. List of centres: mi.com/service.
  2. Reset the device with data loss. Press Volume up + Power, in the Recovery menu, select Wipe Data β†’ Wipe All Data. This method is guaranteed to remove the lock, but remove all contents.

If you have opted for a Recovery reset, try extracting data using Dr.Fone or Tenorshare 4uKey before doing so, which allows you to scan the internal memory of a locked device and save photos, contacts and messages to your PC. Note that the effectiveness depends on the model and version of MIUI.

FAQ: Frequent questions about unlocking Xiaomi

Can I unlock Xiaomi without losing data if I don’t remember the username from Mi Account?
If you don't have a Mi Account attached or you don't remember the login details, the odds are minimal. The only option is the methods via Fastboot or ADB, but they require pre-preparedness (unlocked bootloader, debugging enabled). On the newer models (Xiaomi 13, Redmi Note 12), these loopholes are closed.
Why does the phone ask for an old PIN after resetting the password through Mi Account?
This is a feature of MIUI protection: If the device has been enabled with File-Based Encryption, the system may require the old password to be entered to decrypt, in which case only a full reset via Recovery will help.
Does unlocking through service codes work on POCO?
No. The POCO lineup (even MIUI-based) devices use modified firmware where password reset service codes are disabled, with the exception of the 2018-2019 models (POCO F1, POCO X2), but even there, success is not guaranteed.
Can you unlock Xiaomi through Google Account like other Android devices?
Xiaomi has removed the unlock function through Google Account since MIUI 9. Even if you see the Google login field on the lock screen, it is inactive and only serves for visual compatibility with Android.
What happens if you interrupt the firmware through the Mi Flash Tool?
Interrupting the firmware process can cause the device to "brick" (inoperability) at best, the phone will load into the Fastboot, at worst, it will require soldering of the memory chip. Always wait for the procedure to be completed (green tick in the Mi Flash Tool).