keepcalculator

06 Numbers and Powers

Fix Xperia XZ IMEI Null Problem

Card No. 06·49560 · Updated · Standard formula, shown below

If your Sony Xperia XZ is showing an unknown or null IMEI number, you may lose network connectivity, making calls and mobile data impossible. This guide walks you through the most common fixes, from simple software resets to restoring the IMEI using engineering mode. You will need a Windows PC, a USB cable, and a few free tools. The steps are technical but doable with care.

What You’ll Need

  • A Windows PC (Windows 7 or later)
  • A USB cable that supports data transfer
  • Your Xperia XZ phone, charged above 50%
  • Backup of your important data (optional but recommended)
  • Download of the correct firmware for your exact model (e.g., F8331, F8332) from a trusted source
  • Download of the Xperia Companion software (for driver installation)
  • A text editor like Notepad to create a script file

Step-by-Step

  1. Back up your data. Connect the phone to a PC and copy photos, videos, and documents to a safe folder. The process may wipe your device.
  2. Check the current IMEI. Dial *#06# on the phone. If it shows ‘IMEI: Unknown’ or a single zero, you have the null IMEI issue. Note the model number from Settings > About phone.
  3. Install drivers. Install Xperia Companion on your PC. It installs the necessary ADB and fastboot drivers. Alternatively, install the Google USB driver via Android Studio.
  4. Enable Developer options and USB debugging. Go to Settings > About phone > tap ‘Build number’ seven times. Then go to Settings > Developer options > enable ‘USB debugging’.
  5. Connect the phone to the PC. Use the USB cable. When prompted, allow USB debugging on the phone. Open a Command Prompt (cmd) window on the PC and type adb devices. Your device should appear with ‘device’ status.
  6. Back up the current TA partition (if possible). If your bootloader is locked, skip this step. If unlocked, you can back up the TA partition using a tool like TA Backup, but this is optional and not required for the fix.
  7. Flash the stock firmware using FlashTool. Download FlashTool (a free Sony flashing utility) and the correct firmware FTF file for your model. In FlashTool, click the lightning icon, select ‘Flashmode’, choose the firmware, and follow the prompts. This will reinstall the system and may restore the IMEI if it’s a software corruption.
  8. Check the IMEI again. After flashing, dial *#06#. If the IMEI is restored, you are done. If not, proceed to the engineering mode method.
  9. Enter engineering mode. With the phone on, dial *#*#7378423#*#* (that’s *#*#SERVICE#*#*). This opens the service menu. If it doesn’t work, try *#*#3646633#*#* for the MTK engineering menu (but Xperia XZ uses Qualcomm, so the first code is correct).
  10. Access the IMEI writing tool. In the service menu, go to ‘Connectivity’ > ‘CDS Information’ > ‘Radio Information’. You’ll see a command line. This is where you’ll send AT commands.
  11. Send the AT command to write IMEI. Type the following command, replacing ‘XXXXXXXXXXXXXXX’ with your original 15-digit IMEI (you can find it on the original box or receipt):
    AT+EGMR=1,7,"XXXXXXXXXXXXXXX"
    Press send. Wait for ‘OK’ response.
  12. Write the second IMEI (if dual SIM). For dual-SIM models, also send:
    AT+EGMR=1,10,"XXXXXXXXXXXXXXX"
    using the second IMEI if you have one.
  13. Reboot the phone. Turn it off and on again. Dial *#06# to verify the IMEI is now displayed correctly.
  14. Test connectivity. Make a test call and try mobile data to confirm everything works.

Common Mistakes

  • Using the wrong firmware: Flashing a firmware meant for a different Xperia XZ variant (e.g., F8331 vs F8332) can cause IMEI loss or boot loops. Always match the exact model number.
  • Incorrect AT command syntax: Missing the quotes or the comma can cause the command to fail. Copy the command exactly as shown, with the IMEI inside double quotes.
  • Skipping driver installation: If ADB doesn’t recognize your phone, the whole process fails. Ensure drivers are installed and USB debugging is on.
  • Entering the wrong service menu code: The code is *#*#7378423#*#*. Some users type *#*#4636#*#* which is the testing menu, not the service menu.
  • Not backing up data: Flashing erases everything. If you skip backup, you lose photos and contacts.

Tips

  • Write down your original IMEI now. It’s printed on the back of the phone (under the battery) or on the original box. Without it, you cannot restore it.
  • Use a stable PC and cable. A faulty cable can interrupt the flashing process and brick the phone.
  • Keep the phone charged. If it dies during flashing, it may become unresponsive. Keep it above 50%.
  • Check the IMEI after each step. This helps you know which step fixed the issue.
  • If you are not comfortable with flashing, seek professional help. A local phone repair shop can do this for you.

Troubleshooting

  • ADB says ‘unauthorized’: On the phone, a dialog asks for USB debugging permission. Tap ‘Allow’ and check ‘Always allow’. If not, revoke permissions and reconnect.
  • FlashTool fails with ‘cannot load firmware’: The FTF file may be corrupt. Download it again from a different source. Ensure you have the correct drivers installed.
  • AT command returns ‘ERROR’: Double-check the IMEI length (must be 15 digits). Also ensure the phone is not in ‘airplane mode’ and that you are in the correct menu.
  • IMEI still null after writing: Some phones have a locked bootloader that prevents writing. You may need to unlock the bootloader (this voids warranty) or use a paid tool like QPST. This is beyond the scope of this guide.
  • Phone stuck in bootloop after flashing: Perform a factory reset from recovery mode (Volume Up + Power). If that fails, re-flash the firmware with a clean wipe option selected.

Frequently Asked Questions

Q: Is it legal to repair my own IMEI?
A: In most countries, it’s legal to restore your own device’s IMEI if you own it and the IMEI is the original one. But tampering with IMEI for fraudulent purposes is illegal.

Q: What causes the IMEI to become null?
A: Common causes include a failed software update, flashing a wrong firmware, or a corrupted TA partition.

Q: Will this work on other Xperia models?
A: The AT command method works on many Qualcomm-based Xperia devices, but the service menu codes may differ. The flashing steps are similar for most Xperia models.

Q: Do I need root access?
A: No, the service menu method works on stock, unrooted phones. Flashing also works without root.

Q: What if I don’t know my original IMEI?
A: Check the box, the back of the phone (under the battery), or your purchase receipt. If you can’t find it, contact your carrier or Sony support (they may ask for proof of purchase).

Q: Can I use a random IMEI?
A: No. Using an IMEI that is not yours is illegal and can cause network issues. Only use your device’s original IMEI.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →