Forgot the password on Xiaomi: how to unlock without losing data in 2026

A forgotten password on Xiaomi is a situation that thousands of users face every day, and the main problem is that most standard unlocking methods (such as resetting via Recovery) result in a complete cleanup of internal memory. However, there are methods to get back to the device without losing photos, contacts and apps. In this article, we will discuss current ways to unlock for models from 2020 to 2026, including bypassing the pattern lock, PIN-code and fingerprint.

It’s important to understand that the effectiveness of the method depends on the version of MIUI, the status of the Mi Account and the availability of debugging over USB. For example, on the Xiaomi 13 Pro with MIUI 14 and a tied account, the chances of successful unlocking are higher than on the Redmi Note 8 without synchronization.

1 Unlocking through Mi Account (official method)

The most reliable way is to use a tied Mi Account, which works on all Xiaomi, Redmi and POCO models if:

  • πŸ”— Device connected to the Internet (Wi-Fi or mobile network).
  • πŸ“± Mi Account was tied to phone before lockdown.
  • πŸ”’ Find Device is activated in the settings.

Instructions:

  1. On the lock screen, tap Forgot password? (or Forgot password? on English firmware).
  2. Select Sign in via Mi Account and enter the login/password from the linked account.
  3. Confirm unlocking via SMS or email (if two-factor authentication is enabled).
  4. Set a new password or pattern lock.

πŸ’‘

If the button "Forgot password?" does not appear, try to enter any password 5 times in a row - the system will offer alternative login options.

⚠️ Note: If you have previously changed your Mi Account password and haven’t updated it on your phone, this method won’t work, and Xiaomi can block login attempts after 10 failed attempts for 24 hours.

2. Use of ADB (for devices with debugging enabled)

The method is suitable if the phone was previously enabled debugging USB (USB Debugging. It's rare, but if you activate it for development or root access, the chances of getting access back without resetting are high.

Tools required:

  • πŸ–₯️ Computer with Windows/Linux/macOS.
  • πŸ”Œ Cable USB (preferably original).
  • πŸ› οΈ Utilities. ADB Fastboot (download from the official Android website).

Step-by-step:

  1. Connect your phone to your PC and open the command prompt (cmd in Windows or Terminal on macOS/Linux).
  2. Check the connection command: adb devices If the device is displayed, move to the next step. If not, install Xiaomi drivers.
  3. Delete the password file: adb shell rm /data/system/gesture.key adb shell rm /data/system/password.key adb shell rm /data/system/locksettings.db adb shell rm /data/system/locksettings.db-wal adb shell rm /data/system/locksettings.db-shm
  4. Reboot your phone: adb reboot

Install Xiaomi drivers on PC| Download ADB and Fastboot|Enable USB debugging on your phone (if possible)|Connect your phone to your PC with the original cable-->

⚠️ Attention: MIUI 13/14 This method may not work because of the increased security. If the phone requires the password again after rebooting, try an alternative command:

adb shell am start -n com.android.settings/.ChooseLockGeneric

3. Unlock via Fastboot (for stitched devices)

The method is suitable for users who have custom recavators installed (for example, TWRP) or unlocked the bootloader, in which case you can delete the lock files manually.

Procedure:

  1. Turn off your phone and press the Power button + Volume down to log into the Fastboot.
  2. Connect your device to your PC and check for detection: fastboot devices
  3. Download to TWRP (if installed): fastboot boot twrp.img
  4. In TWRP, go to Advanced β†’ File Manager and delete files: /data/system/gesture.key /data/system/password.key /data/system/locksettings.db

Reboot the phone.

Xiaomi modelSupport for TWRPProbability of success
Xiaomi 12/13 series❌ No official. TWRPLow (a patched bootloader is required)
Redmi Note 10/11βœ… Yes (unofficial assemblies)High (80%)
POCO F3/F4βœ… Yes (official and custom)Average (60%, depending on firmware)
Redmi 9/9Aβœ… Yes.High (90%)

⚠️ Note: Newer models (Xiaomi 14, Redmi Note 12) are officially prohibited from unlocking the bootloader. IMEI.

Mi Account|ADB|Fastboot/TWRP|Reset via Recovery|Nothing tried-->

Bypassing locking through service codes (for older models)

On devices up to MIUI 12 (e.g. Redmi 5/6, Mi 8), sometimes service codes to reset a password are triggered.This method does not guarantee a 100% result, but can help in a last resort.

Try the following combinations:

  • πŸ“ž ##7378423## - Resetting security settings (works on the MIUI 9–11).
  • πŸ“± ##3646633## - Engineering menu (Security may include reset option).
  • πŸ”“ ##7780## - soft reset (not always deletes the password, but it's worth trying).

If after entering the code, the phone rebooted, but the password remained - try entering any key 5 times in a row to call the recovery menu.

Why did the service codes stop working on the new Xiaomi?
With MIUI 12, Xiaomi has tightened security policies by blocking most engineering codes, now only running root-access firmware or custom builds, and modern models (Xiaomi 13T, Redmi Note 12 Pro+) use hardware encryption, making it almost impossible to bypass password software without data loss.

5 Unlocking through "Find the Device" (Mi Cloud)

If your phone has Find Device enabled and it's connected to the Internet, you can try unlocking it remotely, which works even if you don't remember your Mi Account password, but you have access to email/SMS to recover.

Instructions:

  1. Go to i.mi.com and log in.
  2. Select the locked device in the list.
  3. Press Find the device. β†’ Unlock.
  4. Confirm the action via SMS or email.
  5. Set a new password on your phone after unlocking.

⚠️ Note: If the phone is off or offline, the unlock command will wait until the first Internet connection. MIUI 14 This method may not work due to privacy policy limitations.

6. Alternative methods (for experienced users)

If standard methods don't work, you can try more complex options, which require technical skills and carry risks:

  • πŸ”§ Flip-through EDL: Suitable for bricks (not included phones) Requires an authorized Xiaomi account and special equipment (EDL On models from 2023 to 2026, this method is blocked by Xiaomi servers unless the device has been officially unlocked.
  • πŸ“± Use exploit: For some models (Redmi Note) 8 Pro, POCO X3) There are vulnerabilities that can get around the lock, CVE-2020-14125 for MIUI 11. Current exploits are searched for in forums XDA Developers or 4PDA.
  • πŸ”„ Replacement of motherboard: Last resort if data is critical. Service centers can move a memory chip (eMMC/UFS) It is a new price, but it is expensive. 5 000 β‚½) and does not guarantee 100% data retention.

πŸ’‘

Before using alternative methods weigh the risks: unofficial firmware or exploit can lead to IMEI blocking, loss of warranty or a β€œbrick”.

What do you do if nothing helps?

If all methods are exhausted, then you only have to reset hard through Recovery, which will delete all data, but will return access to the phone.

  1. Turn off the phone.
  2. Press the Power button + Volume up until the Mi logo appears.
  3. Select a language and go to Wipe Data β†’ Wipe All Data.
  4. Confirm the reset and wait for the reset.

After discharge:

  • πŸ”„ Restore data from a backup (if it was in Mi Cloud or Google).
  • πŸ“² Install the apps again from Google Play.
  • πŸ”’ Set up a new password and be sure to save it in your password manager (like Bitwarden or KeePass).

⚠️ Attention: On phones with MIUI 13/14 After reset, you may need to enter data from your previous Mi Account (Factory Reset Protection) if you do not remember your username / password, the phone will become a β€œbrick” before contacting the service center.

FAQ: Frequent questions about unlocking Xiaomi

Can you unlock Xiaomi without losing data if USB debugging has been turned off?
Not if the debugging is on USB (USB Debugging) was not activated in advance, methods with ADB The only chance is to use a tied Mi Account or exploits for a particular model (for example, there was a bug with an emergency call bypass for the Redmi Note 7).
Will resetting via the Mi Flash Tool help save data?
No, the Mi Flash Tool does a complete flashing of the device, which deletes all data, and it's only used to restore bricks or officially update the firmware, and if you're asked to "switch your phone to save data," that's a scam.
What if, after unlocking through Mi Account, the phone asks for an old password?
This is a well-known error on MIUI 12-14. Solutions: Try entering any password 5 times - can the button "Forgot the password?" appear. Connect the phone to your PC and use ADB to delete locksettings.db files (if debugging was enabled).
Can I unlock Xiaomi through a service center without a check?
In theory, yes, but in practice, service centers require proof of purchase (check, warranty card or binding to Mi Account). β‚½) It does not guarantee the safety of data, and in some cases, it may be necessary to replace the motherboard.
How to avoid blocking in the future?
Recommendations: πŸ” Use a password manager (e.g. Google Password Manager or Google Password Manager) 1Password). πŸ“± Activate Smart Lock in Security Settings (unlocking to a trusted location or device). ☁️ Regularly back up your Mi Cloud or Google Drive. πŸ”§ Put the debugging on. USB (Settings β†’ The phone. β†’ Version. MIUI β†’ 7 times, then add more. β†’ For developers β†’ Debugging by USB).