How to erase all data from Xiaomi phone: a complete guide to resetting to factory settings

Resetting Xiaomi’s smartphone to factory settings is a procedure that is required when selling a device, fixing critical failures or preparing to be transferred to another user. However, completely deleting data on phones of this brand has nuances, from the features of MIUI to hidden memory parts that are not always cleared by standard methods. In this article, we will discuss all the current methods – from simple reset through the menu to forced formatting via Fastboot – and explain why some methods leave traces of data and how to avoid it.

It's important to understand that even after resetting through settings, some of the information can be recovered by specialized programs, such as files in internal memory that are deleted without overwriting, or data from /data and /cache partitions that are not always cleaned correctly. We tested all methods on the Redmi Note 12 Pro+, POCO X5 Pro and Xiaomi 13 Ultra models, the results are summarized in the comparison table below.

1.Reset preparation: what to do before deleting data

Before starting the reset, follow the mandatory steps to avoid losing important information and avoid locking the device:

  • πŸ“± Create a backup through Settings β†’ The phone. β†’ Backup or manually copy files to your PC. Mi Cloud cloud storage does not store all data (e.g, SMS And the notes may not be synchronized).
  • πŸ”’ Untie your Mi Account in Settings β†’ Xiaomi account β†’ If you do not, the phone will require the previous account to be logged in after the reset).
  • πŸ“Ά Delete. SIM-Formatting internal memory does not affect external drives, but it is better to remove them in advance.
  • πŸ”‹ Charge the battery to at least 50%. Interrupting the reset process can damage system files and "brick" the device.

⚠️ Note: If you are selling a phone, check the battery status via ##4636## (menu Battery Information.

For models with a locked bootloader (most Xiaomi after 2019), a reset via Recovery may require confirmation via Mi Account.If you forget your password, restore it in advance at account.xiaomi.com.

πŸ“Š How often do you reset your phone?
Never.
Once a year.
Just before the sale.
In case of serious failures

2. Method 1: Reset via the settings menu (the easiest method)

This method is suitable for working devices without critical failures. It removes:

  • πŸ“‚ All user data (photos, videos, documents).
  • πŸ“± Installed applications and their settings.
  • πŸ”§ System settings (Wi-Fi, Bluetooth, wallpaper, etc.).

But it doesn't affect:

  • πŸ”„ System updates (the phone will remain on the current version) MIUI).
  • πŸ“ Hidden sections (e.g, /vendor or /boot).

Instructions:

  1. Open Settings β†’ About the phone β†’ Reset settings.
  2. Select to erase all data (reset to factory).
  3. Enter a pattern lock or PIN-code.
  4. Confirm the action by pressing Erase Everything.

It takes 5-15 minutes to reboot, and you'll be asked to adjust your phone as new, and if the screen has been stuck on the MI logo for more than 20 minutes, you've made an error (see "What to do if the reset freezes").

β˜‘οΈ Preparing for reset via settings

Done: 0 / 4

3. Method 2: Hard Reset via Recovery Mode (if the phone is not turned on)

If your Xiaomi smartphone doesn’t boot or hangs on your logo, use Restore Mode, which works even when your system files are damaged, but requires physical access to your device’s buttons.

How to log in to Recovery:

  1. Turn off the phone (press Power + Volume up for 10 seconds).
  2. Keep Power + Volume up until the Mi logo appears.
  3. Let go of Meals, but keep Volume up until the Recovery menu appears.

On the Recovery menu (English or Chinese):

  1. Select Wipe Data (use volume buttons for navigation, power for confirmation).
  2. Confirm Wipe All Data.
  3. After completion, select Reboot.

⚠️ Note: On some models (POCO F3, Redmi K40) After resetting via Recovery, you may need to re-activate via Mi Account, even if you untied your account in advance.

If the Recovery menu is in Chinese, focus on the icons:

  • 🧹 β€” Data Cleanup (Wipe Data).
  • πŸ”„ β€” reboot (Reboot).
  • πŸ“± β€” Connecting with PC (Connect with MIAssistant).
What happens if Recovery does not open?
If the phone vibrates after holding the buttons, but the menu does not appear, try: 1. Connect the charger (sometimes it works at low charge). 2. Use the Power + Volume down combination (on some models). 3. Recovery via Fastboot (requires a PC and an unlocked bootloader).

Method 3: Reset via Fastboot (for power users)

The Fastboot method is the most radical one, and it completely overwrites partitions of memory, including /data, /cache and /system.

  • πŸ”§ The phone does not respond to other resetting methods.
  • πŸ“¦ You must remove all traces of data (for example, before selling).
  • πŸ”„ Refuse the device to another version MIUI.

Procedure:

  1. Install Platform Tools on your PC.
  2. Enable USB Debugging in Settings β†’ About Phone β†’ MIUI version (click 7 times, then go back to Additional Settings β†’ For Developers).
  3. Connect your phone to your PC and execute in the command line: adb reboot bootloader fastboot flashing unlock fastboot erase userdata fastboot erase cache fastboot reboot

The fastboot flashing unlock command will unlock the bootloader, but new models (Xiaomi 12T, Redmi Note 11 and later) will require an account to be linked to the device through the official Xiaomi tool.

Resetting methodDeletes the data.Demands a PC.It works on a locked phone.Implementation time
Through settingsPartially (remains traces in /data)No.Yes.5-15 minutes
Recovery ModeCompletely (except /vendor)No.Yes.10-20 minutes
FastbootCompletely (all sections)Yes.No (needs unlocked bootloader)20-30 minutes
MI Flash ToolCompletely (flashing)Yes.No.30–60 minutes

5. Method 4: Flashing through the MI Flash Tool (complete cleaning)

If you need to not only erase data, but also install clean firmware (for example, after viruses or a failed update), use the MI Flash Tool.

  • πŸ”„ Remove all sections, including /system and /boot.
  • πŸ“₯ Installs the version you have selected MIUI (For example, the Chinese instead of the Chinese).
  • πŸ”§ Corrects errors caused by system files corruption.

Instructions:

  1. Download the official firmware for your model (.tgz format).
  2. Uncamp it into a folder without Cyrillic characters.
  3. Install the MI Flash Tool.
  4. Transfer the phone to Fastboot mode (hold Power + Volume down).
  5. Connect to your PC, in MI Flash Tool, select a folder with firmware and press Refresh β†’ Flash.

⚠️ Attention: Firmware through MI Flash Tool with clean all option deletes all data without recovery, including: IMEI on some models (Redmi) 9A, POCO M3). Before the procedure, check the backup copy IMEI (team *#06#).

πŸ’‘

If the phone doesn’t turn on after firmware, try repeating the process with the clean all and lock option – this sometimes helps with bootloader errors.

Method 5: Delete Data via ADB (for developers)

The ADB method is suitable if the phone is turned on, but the settings menu is not available (for example, due to a launcher failure), it allows you to erase data without logging in.

Steps:

  1. Connect your phone to a PC with USB debugging enabled.
  2. Open the command line in the platform-tools folder and execute: adb shell rm -rf /data/* rm -rf /cache/*
  3. Reboot your device: adb reboot recovery and run Wipe Data in the Recovery menu.

This method doesn't delete the data completely, it only cleans the folders.

adb shell


mkfs.f2fs /dev/block/by-name/userdata

But this will result in loss of access to internal memory before flashing.

7.What to do if the reset freezes or the phone does not turn on

If the screen is black or the MI logo is lit for more than 30 minutes after reset:

  • πŸ”Œ Connect the charger – sometimes the process is suspended due to low charge.
  • πŸ”„ Forced to restart the phone (hold power) + Volume up 20 seconds).
  • πŸ“‘ Check your PC connection – if the phone is defined as Qualcomm HS-USB QDLoader 9008, will require firmware through EDL-The mode (only for experienced users).

If the phone has stopped responding to the buttons:

  • πŸ”§ Try hardware reset: turn off the battery (if removable), then plug in the charging and hold the power for 1 minute.
  • πŸ’» Connect to your PC and check in Device Manager if your phone is defined as Android Bootloader Interface. If so, use Fastboot to unlock it.

πŸ’‘

If the phone requires a password from your old Mi Account after a reset and you don’t remember it, contact Xiaomi with a check to buy. Unlocking is impossible without proof of ownership.

8 How to verify that data has been deleted

Even after the reset, some of the information can remain in memory to make sure that it is completely cleaned up.

  1. Install the DiskDigger app and scan the internal memory. If you have files, the reset was incomplete.
  2. Connect your phone to your PC and use PhotoRec to search for deleted data.
  3. Check the sections through ADB: adb shell ls -la /data/ If the folders are not empty, reset again.

For guaranteed removal (e.g., before selling) use:

  • πŸ”„ Repeatedly re-recorded through MI Flash Tool (sweep the device 2-3 times in a row).
  • πŸ”’ Encryption: Enable encryption in Settings before resetting β†’ Security β†’ Encrypting the phone. Once reset, the data will be irrecoverable.

FAQ: Frequent questions about Xiaomi reset

Can I recover data after resetting through Recovery?
Partially. Files that are deleted without overwriting are restored by programs like Dr.Fone or EaseUS MobiSaver. Use Fastboot or MI Flash Tool to delete them completely.
Why does the phone ask for the old Mi Account password after a reset?
This is Mi Account Lock protection. It works if: You didn't untie your account before the reset. The phone was stolen (locked by the previous owner); the reset was done through Recovery on models with an associated account. Solution: enter your previous account details or contact Xiaomi with proof of purchase.
How to reset Xiaomi if you forget the pattern lock?
Methods: Log in to Recovery (hold Power + Volume up) and select Wipe Data. Use ADB (if debugging is enabled): adb shell rm /data/system/gesture.key For models with MIUI 12+ and unlocked bootloader, swipe Recovery through Fastboot. On new models (Xiaomi 13, Redmi Note 12) without a tied account, reset is not possible - you will need an official unlock.
Will the MIUI version reset after the data is cleaned?
No. Resetting through settings or Recovery doesn't roll back the firmware version. To get back to the factory version, you need to flash the device through the MI Flash Tool.
Can you reset Xiaomi without losing data?
No. Any factory reset deletes user data. The alternative is to reset (without deleting files): Settings β†’ System β†’ Additional β†’ Reset. But it doesn't clean the applications and their data.