How to Remove Your Xiaomi Password Without Losing Data: A Complete 2026 Guide

The forgotten password on Xiaomi smartphone is a situation that thousands of users face every day. The main problem is that a standard reset via Recovery Mode erases all data, which is not always acceptable. Fortunately, there are legal ways to unlock without losing photos, contacts and applications. In this article, we will discuss 5 working methods relevant to the models of 2020-2026, including the Redmi Note 12, POCO X5, Xiaomi 13 and others.

It's important to understand that not all methods are universal. Success depends on the version of MIUI, the status of the Mi Account, the availability of debugging over USB and even the firmware region. We will describe each option in detail, specify the limitations and risks, and provide unique data on compatibility with the latest security updates from Xiaomi (patches from June 2026). If you are not sure about your actions, you better contact the service center, so as not to turn the phone into a brick.

1 Unlocking through Mi Account (official method)

The safest method if you have linked your device to a Xiaomi account is suitable for most models, including the Redmi 10, POCO F4 and Xiaomi 12T. The main condition is that the phone must have Internet access (Wi-Fi or mobile network).

Algorithm of action:

  • πŸ”Ή On the lock screen, tap Forgot your password? (or Forgot password? on English firmware).
  • πŸ”Ή Select Restore via Mi Account and enter the login/password from the linked account.
  • πŸ”Ή Confirm the unlock through SMS or email (depending on your account security settings).
  • πŸ”Ή Create a new one. PIN-code.

⚠️ Note: If the phone is not connected to the network, this method will not work, and Xiaomi may request additional verification (for example, a linked phone number) if more than 30 days have passed since the last authorization.

πŸ“Š What kind of smartphone you Xiaomi?
Redmi Note Series Series Series
POCO
Xiaomi (flagship)
Redmi (budget)
Other

2.Use of Fastboot Mode (for advanced users)

The method is suitable if the debugging USB (USB Debugging) was enabled before locking. Requires a computer with Mi Flash Tool drivers installed and a package ADB/Fastboot. Works on MIUI 12–14, but may not work on devices with a blocked bootloader (bootloader).

Step-by-step:

  1. Turn off your phone and press the Power button + Volume down to log into Fastboot Mode.
  2. Connect the device to the PC through USB-cable.
  3. Open the command line (Windows) or terminal (macOS/Linux) and do:
fastboot oem unlock-go

If the team is not supported, try:

fastboot flashing unlock

⚠️ Note: On new models (Xiaomi 13 Ultra, Redmi Note 12 Pro)+) This method is often blocked by the manufacturer. Before trying, check the status of the bootloader with the command:

fastboot oem device-info

If Device unlocked: false is not available without Xiaomi’s official permission.

Install the Mi Flash Tool|Download ADB/Fastboot|Enable debugging on USB (if the phone is unlocked)|Check the status of bootloader|Backup of data (if possible)-->

3. Password bypass through ADB (only for unlocked devices)

It works if you've already activated USB debugging on your phone and you've been allowed access to your computer, it's good for MIUI 11-14, but it requires technical skills, and the main advantage is that the data stays intact.

Instructions:

  • πŸ”§ Connect your phone to your PC and open the terminal.
  • πŸ”§ Enter the commands one by one:
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. If the commands don't work, try the alternative:

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

⚠️ Note: On devices with data encryption (on by default on the MIUI 12+) This method can lead to loss of access to internal memory.

What if the ADB can’t see the device?
If the adb device command returns a blank list, try: 1. Reinstall drivers (use Mi). PC Suite). 2. Change USB-cable (original or data support required). 3. Include USB Debugging (Security Settings) in additional developer settings (if the phone is partially unlocked). 4. Try another PC or OS (e.g. Ubuntu instead of Windows).

4. Reset password via TWRP (for devices with custom recavery)

If your Xiaomi has custom TWRP reclaimers installed, you can manually delete password files. The method is suitable for enthusiasts who previously unlocked the bootloader and installed an alternative firmware. It does not work on stock devices!

Algorithm:

  1. Load to TWRP (Plug Power + Volume Up).
  2. Go to Advanced β†’ File Manager.
  3. Delete files: /data/system/gesture.key /data/system/password.key /data/system/locksettings.db

Reset the device.

Xiaomi modelSupport for TWRPRisk of data lossDifficulty
Redmi Note 10 ProYes (unofficially)Low.Medium
POCO X3 ProYes (officially)Medium.Tall.
Xiaomi 12Partially (requires patch)High-pitchedVery high.
Redmi 9ANo (closed bootloader)β€”β€”

⚠️ Note: Delete system files through TWRP may disrupt Google Pay, Banking applications and other services tied to device security. After resetting the password, it is recommended to perform Factory Reset through settings (without data loss).

πŸ’‘

If after deleting the password files, the phone requests a PIN when turned on, try entering any character set (e.g., 0000) – the system may miss the check due to the lack of authentication files.

5.Official reset via Xiaomi Service Center

If all of the above methods do not work, you need to contact an authorized service center. Xiaomi provides an official unlock service using the owner’s passport (or document confirming the purchase).

  • πŸ“‹ Guaranteed data retention (if the phone is not encrypted).
  • πŸ” Legality – No risk of blocking IMEI.
  • πŸ› οΈ Ability to diagnose other problems (for example, a damaged connector).

Disadvantages:

  • ⏳ Waiting time: 3 to 7 days.
  • πŸ’° Cost - from 1,500 to 5 000 rubles (depending on the model and region).
  • πŸ“„ Documents required (passport, check or box with a passport) IMEI).

⚠️ Warning: Unofficial services often use exploits to unlock, which can result in a Mi Account lock or loss of warranty.Please check reviews and Xiaomi certificate before contacting.

πŸ’‘

Official resets via the service are the only 100% secure way to do so if you are unsure of your technical skills or fear losing data.

Frequent Mistakes and How to Avoid Them

Many users make critical mistakes when trying to remove a password, which leads to complete loss of data or β€œbricking” of the device.

  1. Ignoring backup. Even if you plan to save data, create a backup via Mi Cloud or Google Drive (settings β†’ accounts β†’ sync).
  2. Use of dubious software: Utilities like the "Mi Unlock Tool" from third-party developers often contain viruses or spyware.
  3. Interrupt the unlocking process. If you have started resetting via Fastboot or TWRP, don't turn off the cable or turn off the phone until you fully restart.
  4. Unverified ADB commands. Some instructions on the Internet advise you to delete system files that are not associated with a password (for example, settings.db), which leads to malfunctions in Android.

If after an unsuccessful attempt to unlock the phone stopped turning on or got stuck on the MI logo, try:

  • πŸ”„ Sign in to Recovery Mode and run Wipe Cache.
  • πŸ”§ Reflash the device via the Mi Flash Tool (you will need the official firmware for your model).
Can I remove the password from Xiaomi if I forgot the username from Mi Account?
No, without access to the linked Mi Account, official unlocking is not possible. The only options are: Restore access to the account via email or a linked phone number. Contact Xiaomi with proof of ownership of the device (check, box with IMEI). Third-party methods (for example, through EDL Mode) require special equipment and often lead to data loss.
Why, after resetting the password through ADB, does the phone ask for a PIN when turned on?
This is because Android stores some of the lock data in the encrypted /data partition. Solutions: Enter any PIN (e.g., 1234) – sometimes the system misses the check. Perform a reset via TWRP by deleting locksettings.db* files (see section 4). If nothing helps, you will have to do Factory Reset (with loss of data).
Does the method work with removing gesture.key on Xiaomi with MIUI 14?
Starting with MIUI 13, Xiaomi tightened protection. Deleting gesture.key or password.key can only work if: The device is not encrypted (checked in security settings). USB debugging was activated before locking. The phone has an old firmware version (until April 2023). On new devices (Xiaomi 13/14, Redmi Note 12), this method is blocked at the kernel level.
What if banking applications stopped working after unlocking?
This is due to a breach of system file integrity (e.g. after tampering with TWRP or ADB). Solutions: Reinstall problematic applications. Revert to the banking service (support call may be required); reset Factory Reset through settings (without data loss if the phone is not encrypted). If nothing helps, run the official firmware through Mi Flash Tool (data will be deleted).
Can you unlock Xiaomi through service codes (##)?> No, service codes (e.g. #7780##) on Xiaomi do not work to reset passwords. These combinations are designed to test hardware and do not affect screen locking. Using "secret codes" from the Internet can lead to: Network settings reset (loss of stored Wi-Fi). Activation of diagnostic mode (does not affect password) In rare cases - to a hard reset (loss of all data).