How to change the digital lock code on the Xiaomi phone: all working methods

Why Change Your Digital Code to Xiaomi and When You Need It

Digital code (PIN, password or pattern lock) is the first barrier to protecting your data on a Xiaomi smartphone. Over time, it may be necessary to change it: for example, if the old code has become known to outsiders, you suspect a data leak or just want to make it difficult to access the device, also a change of code is required when buying a used phone when the previous owner did not reset the settings, or if you forgot the current password but have access to your Mi Account.

It’s important to understand that the procedure differs depending on the type of lock: it can be a classic 4-digit PIN, a complex alphanumeric password or a pattern lock. On the new Xiaomi 13/14 series and Redmi Note 12/13, biometrics (fingerprint or facial scan) are also available, but it always works on top of the main code. If you plan to sell the phone, changing the code is a must before resetting to factory settings.

In this article, we will discuss all the current ways to change digital code to Xiaomi, including official methods through settings, recovery through Mi Account, as well as emergency measures like Hard Reset (if other options are not available). MIUI β€” from MIUI 12 to MIUI 14 and the latest HyperOS.

Method 1: Change the code through your phone settings (if you know the current password)

It is the easiest and most secure method available on all Xiaomi, Redmi and POCO models. It works if you remember the current lock code and have access to the settings menu. The instructions are universal for MIUI 12/13/14 and HyperOS, but may differ slightly from menu item names.

To change the digital code:

  1. Open the Settings app (the gear icon on the desktop).
  2. Go to the Passwords and Security section (on some firmwares – Screen Lock and Password).
  3. Select Screen Lock β†’ enter the current password/PIN/pattern lock for confirmation.
  4. Press the Password (or PIN/pattern lock if you want to change the lock type).
  5. Enter the new code twice and confirm the changes.

On Xiaomi with HyperOS (such as Xiaomi 14 or Redmi K70), the path can look like this: Settings β†’ Lock screen β†’ Type of lock screen. The system will require you to enter the old password, then prompt you to choose a new one.

Make sure your phone is at least 30% charged.

Connect to Wi-Fi or mobile network (you will need to sync with Mi Account)

Remember or write a new code in a safe place

Check that you have access to mail linked to your Mi Account.

-->

If you want to change the type of lock (for example, with the PIN The system will ask you to enter the old code first, and then configure the new method. AMOLED-screens (for example, Xiaomi 13 Pro or Redmi) K60) Also available is the Always-on Display option, which can display notifications even on a locked screen – its settings do not depend on the type of code.

πŸ’‘

If you often forget passwords, use Smart Lock in your security settings, which unlocks your phone in trusted locations (like your home) or when you connect to a trusted device (like your Mi Band smartwatch).

Method 2: Change the code through Mi Account (if you forgot the password, but the account is tied)

If you forget the current lock code, but the phone is tied to your Mi Account, you can reset your password through Xiaomi’s official service, which only works when you have an active internet connection and if you have previously enabled account sync, and is suitable for most models, including the Redmi Note 11/12, POCO X5 and Xiaomi 12T.

Instructions for remediation:

  1. On the lock screen, click Forgot Password? (or Forgot Password on English firmware).
  2. Select the recovery option through Mi Account.
  3. Enter the email or phone number associated with the account and confirm the identity via SMS or mail.
  4. Follow the instructions on the screen to create a new password.

If the option Forgot the password? is missing, it can mean:

  • πŸ“΅ Phone not connected to the Internet (turn on mobile data or Wi-Fi).
  • πŸ”„ The device is disabled synchronization with Mi Account.
  • πŸ›‘οΈ Custom firmware installed (for example, LineageOS or Pixel Experience).
  • 🏭 The phone is released for the Chinese market (models with a prefix) CN titled).
What if you don’t receive an SMS with a confirmation code?
If the SMS does not arrive, check: 1. Correctness of the phone number entered (should match the one associated with the Mi Account). 2. Internet connection (try switching from Wi-Fi to mobile data). 3. No lock by the operator (sometimes SMS is delayed due to spam filters). 4. Try to request the code via email or use a backup recovery method (if it was configured).

On some firmware (for example, MIUI Global for the European market), after resetting the password through Mi Account, additional verification may be required - the system will ask you to enter a backup PIN or answer a control question. If you do not remember this data, only Hard Reset remains (see method 4).

PIN-code

pattern lock

Password (letters + numbers)

Fingerprint + PIN

Face + PIN

Another option

-->

Method 3: Reset code via Fastboot (for advanced users)

This method is suitable if you forgot your password, but the phone is enabled debugging. USB (USB Debugging and Bootloader Unlocked requires a computer with drivers installed. ADB/Fastboot Attention: Incorrect actions can lead to data loss or device "brick!

Step-by-step:

  1. Turn off your phone and press the Power button + Volume down to enter Fastboot mode.
  2. Connect the device to the PC through USB-cable.
  3. Open the command line (Windows) or terminal (macOS/Linux) and execute: fastboot devices If the device is determined, continue. If not, install the drivers.
  4. Enter a command to reset the lock (does not work on all models!): fastboot erase frp This command removes Factory Reset Protection, which may allow you to reset the password.
  5. Restart your phone as normal and try to install a new code.

Note that newer models (Xiaomi 13/14, Redmi Note 12 Pro+) may not work due to enhanced protection, and once fastboot erase frp is commanded, a full Hard Reset may be required, which will delete all data from the device.

πŸ’‘

Resetting via Fastboot is a risky method, and is only suitable for users with an unlocked bootloader and experience with ADB. On most modern Xiaomi, this method is blocked by the manufacturer.

Method 4: Hard Reset (complete reset)

Hard Reset is an extreme measure that removes all data from the phone, including apps, photos and settings. It should only be used if other methods have not worked, and access to the device is critical. The method works on all Xiaomi models, but after resetting, the phone will return to factory settings.

How to make a Hard Reset:

  1. Turn off the phone.
  2. Press the Power Button + Volume up and hold for 10-15 seconds until the Mi logo and Recovery menu appear.
  3. Use the volume buttons for navigation and the power button to select the Wipe Data (or Clear Data) item.
  4. Confirm the action by selecting Wipe All Data.
  5. After the process is complete, select Reboot to reboot.

On some models (such as the POCO F5 or Redmi K50), the Recovery menu may be in Chinese, in which case, look for characters corresponding to the data reset (usually this is the third or fourth item).

πŸ’‘

If after Hard Reset, the phone asks you to enter the old password (due to Factory Reset Protection), you will need to log in to the Mi Account that was tied to the device before the reset.

Frequent Mistakes and How to Avoid Them

When you change your digital code to Xiaomi, users often face typical problems, and here are the most common mistakes and ways to solve them:

Mistake.Reason.Decision
Can't enter a new password.A code that is too simple (e.g. 1234 or 0000)Use a combination of 6+ characters with numbers and letters
The system does not accept the current passwordKeyboard in another language or Caps Lock enabledCheck the layout and register of symbols
The option "Forgot your password?" is missing.No connection to the Mi Account or no Internet connectionConnect to the network or use Hard Reset
After resetting, an old password is requiredFactory Reset Protection (FRP) is activatedSign in to the Mi Account that was previously linked
Resetting through Fastboot does not workThe bootloader is blocked or the model does not support the commandUse Hard Reset or Xiaomi’s official service

Another common problem is that the phone freezes when you change your password, which can be due to a conflict with the MIUI shell or a lack of memory. If the screen is getting stuck while you save the new code, try:

  • πŸ”„ Reboot your phone (hold the power button for 10-15 seconds).
  • πŸ“± Go to Safe Mode (hold the off button) β†’ "Safe regime”) and try again.
  • πŸ—‘οΈ Free up space in memory (delete unnecessary files or applications).

πŸ’‘

If the phone gives an error "Too many attempts to enter" - wait 30 minutes or restart the device. Some models (for example, Xiaomi 12S Ultra) after 5 failed attempts require you to enter a Google account.

Additional security measures after code change

Changing the digital code is only half the battle, and to protect your data on Xiaomi as securely as possible, follow a few additional steps:

  1. Set up two-factor authentication (2FA) for Mi Account: Go to Settings β†’ Xiaomi Account β†’ Security and activate confirmation via SMS or through an authenticator application (e.g. Google Authenticator).
  2. Back up important data: Use Settings β†’ About Phone β†’ Backup or Cloud Services (Mi Cloud, Google Drive).
  3. Activate device encryption: In Settings β†’ Additional β†’ Encryption and credentials, enable Encrypt Phone, which will protect data even when you physically access the device.
  4. Set up Smart Lock for convenience: In Settings β†’ Passwords & Security β†’ Smart Lock Add trusted devices or places where the phone will unlock automatically.

On HyperOS models (such as Xiaomi 14 or Redmi K70 Pro), Private Mode is also available, which allows you to hide notifications and apps on the lock screen. To activate it, go to Settings β†’ Lock Screen β†’ Privacy.

πŸ’‘

If you lose your phone often, turn on Find the device in your Mi Account, which will allow you to remotely block or erase data from your phone in the event of a theft.

FAQ: Answers to Frequent Questions

Can I change the lock code without losing data?
Yes, if you remember the current password, use the method through settings (Method 1). If you forgot the password but you have Mi Account attached, use recovery (Method 2). In both cases, the data will be saved. Hard Reset and Fastboot reset will delete all files.
What if after changing the code, the phone asks for a password from Mi Account?
This is a standard Factory Reset Protection (FRP) security measure, and enter the email and password from the Mi Account account that was linked to the phone before the reset. If you don't remember the data, restore access through the official account.xiaomi.com website.
Does Fastboot code reset work on Xiaomi 13 Pro?
On most modern models (Xiaomi 12/13/14 series, Redmi Note 12/13), the fastboot erase frp command is blocked by the manufacturer. The only working methods are recovery via Mi Account or Hard Reset.
How to change the code if the phone is bought from hand and tied to someone else’s Mi Account?
In this case, contact the previous owner and ask them to delete the device from their Mi Account (via Settings β†’ Xiaomi Account β†’ Devices). If you can not contact, only Hard Reset remains, but after that the phone may require you to enter the data of the old account (due to FRP).
Can I bypass screen locking on Xiaomi without losing data?
There are no formal methods. Informal methods (for example, through ADB or exploits in MIUI) require an unlocked bootloader and technical knowledge, but there is no guarantee of success, the most reliable option is to recall the password or restore access through Mi Account.