If your Android phone is rooted and you didn't mean it to be, don't factory reset it yet. Back up what you can, confirm that root is really present, and then remove it by restoring the stock software. Root is usually reversible. Data loss usually comes from the wrong recovery step, not from root itself. For a related guide, see Still Logged In on an Old Device? How to Sign Out of All Sessions. For a related guide, see Phone Won't Connect to Bluetooth? 10 Ways to Fix Pairing Problems.
This guide covers Android phones. On an iPhone, the equivalent is a jailbreak, which almost never happens by accident. If you did jailbreak one, back it up and restore it through a computer using Apple's instructions.
Confirm the phone is actually rooted
Android doesn't normally root itself. It usually happens when someone runs a "one-click root" app, flashes a patched boot image (commonly with Magisk), follows a tutorial that goes further than intended, or buys a used phone that was already modified. Check these signs:
- An app called Magisk, KernelSU, APatch, or SuperSU in your app list. Magisk can be renamed to something random, so also check Settings > Apps for unfamiliar entries.
- A warning at startup that the bootloader is unlocked.
- Banking, wallet, or streaming apps refusing to run, or Play Protect certification showing as uncertified (Play Store > profile icon > Settings > About > Play Protect certification).
- A result from a root checker app confirming root access.
Samsung owners: if the phone was modified with Odin or a custom boot image, the Knox warranty bit may have been tripped. That is permanent and can disable Samsung Pay/Wallet and Secure Folder even after you go back to stock.
If the phone still boots: back up first
Unlocking an Android bootloader normally erases the phone, so if that happened recently, the wipe has already occurred and only a backup can restore your old data. If you are still seeing your old photos and apps, back up now:
- Turn on your Google backup (the exact path varies, often Settings > Google > All services > Backup, or Settings > System > Backup) and run Back up now.
- Open Google Photos or your preferred cloud app and confirm that photos and videos are uploaded.
- Connect the phone to a computer, set USB mode to File transfer, and copy DCIM, Downloads, Documents, and any app-specific folders (WhatsApp media, for example).
- On Samsung, Smart Switch is a good extra option. Check each app's own backup, such as chat history, authenticator codes, and password managers.
Check that the files open on the computer before moving on. Don't let this step slide, because every recovery option below is safer once you have a copy.
If the phone is bootlooping or stuck
Don't choose "Wipe data/factory reset" in recovery as a first move. A bootloop caused by a bad patched image or root module often leaves your personal data intact, and a wipe would destroy it.
- Try Android Safe Mode. The method varies by brand. Often you hold the power button, then long-press Power off, or hold Volume Down during boot. If it boots, uninstall recently added root apps or modules. Magisk generally disables modules in Safe Mode.
- Reflash only the boot image. Download the factory firmware that exactly matches your model, region, and build number. Extract
boot.img(some newer devices useinit_boot.img) and flash it with the manufacturer's method. For fastboot-capable phones this isfastboot flash boot boot.img. This returns the stock boot partition without erasing user data. - Samsung: Odin flashes official firmware, and using
HOME_CSCinstead ofCSCis generally meant to keep data. It isn't guaranteed, and Odin isn't officially supported by Samsung. If you're unsure, ask a Samsung service center.
If the phone still won't start, or the data partition was wiped, recovery isn't realistic. Modern Android storage is encrypted, and a wipe discards the keys. A phone repair shop or the manufacturer's service center is the next stop, and only a prior backup will restore your data.
Remove root
Work through these from least to most invasive. Each one assumes you already have your backup.
1. Uninstall from the root app (Magisk)
Open the Magisk app and look for Uninstall Magisk. Then choose Restore Images if offered, which puts back the original boot image, or Complete Uninstall. Restart the phone. The button's location varies by version. If it's missing or the restore fails, go to the next option. Simply deleting the Magisk app doesn't remove root.
2. Flash the stock boot image or full firmware
This is the most reliable method. Use only the official firmware for your exact model.
- Pixel: Google's Android Flash Tool (flash.android.com) or the factory images at developers.google.com/android/images.
- Samsung: Odin with Samsung firmware for your model and region.
- Motorola, Xiaomi, OnePlus, others: use the manufacturer's recovery or flashing tool and its current instructions. These procedures differ by model, so a generic walkthrough would be unsafe.
Full flashing often wipes data. Some tools let you keep it, but don't count on that.
3. Relock the bootloader (optional, and riskier)
Only do this after the phone is running complete stock firmware. Relocking wipes the phone, and relocking with modified software can leave some phones unbootable. It is usually required for banking and wallet apps to pass strict integrity checks, but if you don't need that, leaving the bootloader unlocked on stock software is safer. Follow your manufacturer's relock steps exactly.
A normal factory reset on its own usually doesn't remove root installed through a patched boot partition, so don't use it as an unrooting method.
Fix problems that remain
- Banking or payment apps still refuse to run: check for leftover root apps, then check Play Protect certification again. If the bootloader remains unlocked, some apps will keep failing even without root.
- System updates fail: OTA updates check the boot and system partitions, so modified ones can cause failures. Restore stock firmware, then try again.
- Random crashes or battery drain: remove apps that requested root and recent modules, restart, and monitor for a day. If problems continue, a clean stock install with a restore from backup is the cleanest fix.
- Restore stalls: restore app data selectively instead of the whole backup, especially if a root-era app was misbehaving.
If you never installed anything
An unexplained root app or Superuser prompt may mean the phone was previously modified or, less commonly, compromised by malware. Don't sign in to new accounts on it. Copy only photos and documents, not apps, then restore stock firmware or factory reset, and change important passwords from a different device. Review Google account activity and sign out unknown devices.
Check that it's fixed
- A root checker no longer reports root access, and no Magisk or similar app is present.
- The phone restarts normally and receives a system update.
- Play Protect certification shows as certified.
- Your banking, wallet, and streaming apps open normally.
- Your photos, messages, and authenticator accounts are present.
Next step: make the backup, identify the exact method that rooted the phone, and use the manufacturer's official firmware for the fix. If you can't find firmware for your exact model, or the phone won't boot and has important data on it, stop and take it to the manufacturer's service center or a reputable repair shop rather than experimenting with random files.