Xiaomi’s “The Device Is Locked”: What to Do and How to Get an Unlock Code

The message “The device is locked” on the screen of a Xiaomi smartphone is one of the most unpleasant situations for a user: the device turns into a “brick”, does not respond to password input, and the system requires a mysterious unlock code that you do not have. The reasons for blocking can be different from accidentally activating protection to buying a used phone with a tied Mi Account.

In this article, we’ll look at all the working ways to unlock, from official (via Xiaomi) to technical (Fastboot or EDL reset), how to proceed if a phone requires an unlock code after you have firmware, reset or linked to another account, and why some methods can permanently kill the device and how to avoid it.

Why Xiaomi Shows “The Device Is Locked” and Requires Unlock Code

Locking a device requiring unlock code is part of Xiaomi’s protection system, which works in several cases:

  • 🔒 Activation of Factory Reset Protection (FRP) — If the phone was reset to factory settings without a Mi Account detachment.
  • 📦 Buying a used device with a tied account (even after a reset, the system requests the original code).
  • 🔧 Failed firmware via Fastboot or Mi Flash Tool if unofficial firmware was used.
  • 🚨 Hardware lock after unsuccessful attempt to unlock the bootloader (OEM Unlock).
  • 🔄 Reset via Recovery on devices with MIUI 12+, where additional protection is included.

It is important to understand that unlock code is not the same as unlock code (OEM Unlock. The first is requested after the device is locked, and the second is requested before the firmware is unlocked. PIN-code SIM-card or pattern lock of the lock screen.

On some models (such as the Redmi Note 10 Pro or the POCO X3 Pro), the message may look like “This device is locked by FRB” or “Mi Account locked” – these are variants of the same problem.

📊 Which Xiaomi model is your problem?
Redmi Note 9/10/11
POCO X3/X4
Mi 11/12
Another model
I don't know.

Official ways to unlock: when you can do without technical manipulation

If your device is locked, the first thing you should do is try legal methods that don't require any firmware tampering, which are 70 percent effective and warranty-free.

1 Unlocking through the original Mi Account

If your phone is linked to your Mi Account but you have forgotten your password:

  1. Go to account.xiaomi.com.
  2. Restore access via email or phone number ("Forgot your password?" button).
  3. After recovery, enter account data on the locked device.

If the phone is hand-held and tied to someone else's account, try contacting the previous owner.In some cases, Xiaomi allows you to re-tether the device if you have a purchase check.

2. Appeal in support of Xiaomi

Unlocking through support will require:

  • 📄 Check or warranty card (proof of possession).
  • 📱 IMEI Devices (you can find out via *#06# on another phone if your phone is completely blocked).
  • 📧 Email linked to your Mi Account (if your account is yours).

Support may be contacted:

  • 🌐 via the official website (section "Contact Us»).
  • 📱 In the Mi Community mobile application (the "Support" tab»).
  • 📞 By phone (numbers for Russia: 8 800 775-66-88, For other countries, on the Xiaomi website).

The request is 3 to 14 days in time, and in some cases, support may request a photo of the box or serial number of the device.

💡

If Xiaomi support refuses to unlock, clarify the reason. Often the problem is resolved after providing additional documents (for example, a purchase contract).

Hard Reset Unlocking: It Doesn't Always Work

Hard Reset is the first method users try, but on Xiaomi devices with MIUI 12 and later, this method often does not work due to FRP (Factory Reset Protection) protection.

If you still want to try it,

Disconnect the device from charging

Make sure that the battery charge is > 30%

Prepare your computer with the Mi Flash Tool (in case the reset doesn’t work)

Download the official firmware for your model-->

Instructions for Hard Reset

  1. Turn off the phone.
  2. Press the button combination to enter Recovery: For most models: Volume up + Power. For POCO F3 and some others: Volume down + Power.

Recovery

«Wipe Data» → «Wipe All Data»

Confirm the action and wait for the process to be completed.

If the phone needs to unlock code again after reset, then FRP protection has worked.

What if Hard Reset doesn’t help?
If the reset does not remove the lock, it means that the device is tied to the Mi Account at the hardware level.In this case, two options remain: 1. Official unlock through Xiaomi support (see section above). 2. Firmware via Fastboot or EDL (Attention: firmware through EDL Requires an authorized Xiaomi account and can result in total loss IMEI misstep!

Unlocking through Fastboot: for advanced users

If official methods have failed and the device is still locked, you can try unlocking it via Fastboot mode, a method that is suitable for models with an unlocked bootloader (OEM Unlock).

You will need to:

  • 💻 Computer with installed Xiaomi drivers (you can download on the official website).
  • 🔌 Cable USB Type-C (preferably original).
  • 📁 Firmware for your model (for example, Fastboot) ROM For the Redmi Note 9).
  • 🛠 Mi Flash Tool or XiaoMiTool V2.

Step-by-step instruction

  1. Download and install the Mi Flash Tool.
  2. Unpack the firmware archive into a folder without Cyrillic characters (e.g., C:\Xiaomi\ROM).
  3. Turn off the phone and press Volume Down + Power to log into the Fastboot.
  4. Connect the device to the computer.
  5. Launch the Mi Flash Tool, select the firmware folder and click Refresh (your device should appear).
  6. At the bottom, select Clear All (not Clear All and Lock!) and click Flash.

It takes 5-10 minutes. After restarting, the device should start without locking. If you see a Flash not done error, try:

  • 🔄 Reconnect. USB-cable.
  • 🔌 Use another port USB (preferably USB 2.0).
  • 📥 Download a different firmware version (e.g. Global Stable instead of China).

💡

Fastboot removes all data from the device, including photos and apps, and if the phone had important files, it is unlikely to recover them after unlocking.

Unlocking through EDL: an extreme method with risks

EDL (Emergency Download Mode) is a firmware emergency mode that bypasses all locks, used when other methods fail, but has serious risks:

  • ⚠️ Loss of loss IMEI (phone will stop catching the network).
  • ⚠️ Device brick (complete failure).
  • ⚠️ An authorized account is required to download firmware.

To enter the EDL, you need:

  1. Turn off the phone.
  2. Press Volume up + Volume down + Nutrition (on some models - only Volume up + Nutrition).
  3. Connect to a computer – the device will be defined as Qualcomm HS-USB QDLoader 9008.

Next, you will need a special firmware for EDL (for example, through XiaoMiTool V2 or Mi Flash Pro). Without experience, it is not recommended - it is better to contact the service center.

⚠️ Attention: Firmware through EDL on devices with a MediaTek processor (e.g., Redmi) 9A) It requires an additional auth file, which can only be obtained from official Xiaomi partners.

What to do if nothing helps: alternative solutions

If all of the above methods do not work, the following options remain:

MethodSuitable forRisks.Cost
Contact the Xiaomi Service CenterAll models.Possible refusal if there are no documentsFree (under guarantee) or 1000-3000 ₽
Buying an Unblock Code on Third Party SitesRedmi, POCO, Mi (except for new flagships)Fraud, viruses, and unguaranteed results500–2000 ₽
Replacement of motherboardDevices with damaged firmwareHigh cost, data loss5000–15000 ₽
Using "holes" in firmware (exploits)Older models (MIUI 10–11)Possible Brit, Vulnerability to VirusesFree of charge.

Should you buy the unlock code on third-party sites (such as AliExpress or specialized forums)?

  • 🕵️‍♂️ Fraudsters can sell non-working code or steal your account details.
  • 💻 Some codes are actually viruses masquerading as unlock programs.
  • 📵 Even if the code works, Xiaomi can lock the device again in a few days.

If you still decide on this option, check the reviews about the seller and use a virtual card for payment.

How to avoid blocking in the future: prevention

To avoid the problem of “The device is locked” again, follow these rules:

  • 🔑 Untie Mi Account before selling: Go to Settings → Accounts. → Mi Account. Press Exit and confirm the unbundle. Do Hard Reset (see instructions above).

Do not buy used phones without checking

  • Ask the seller to exit the Mi Account with you.

Do not flash the device without unlocking the bootloader

  • First, unlock OEM Unlock in Settings → For Developers.
  • Use only official firmware from the Xiaomi website.