How to Change Partition Type ID using Diskpart & The Best Safe Alternative

Need to change a partition type to a Recovery or EFI System Partition? Follow our complete step-by-step guide to using the Diskpart "set id=" command, or use AOMEI Partition Software to change partition types safely without coding.

By Lucas    Updated on May 12, 2026

Quick Answer:

How do you change a partition type ID in Windows 11/10?

A partition type ID tells the Windows Operating System what a specific partition is used for (e.g., a basic data drive, a hidden Recovery partition, or an EFI system partition). You can change this ID using two primary methods:

  • Using Diskpart (Command Line): Advanced users can open Command Prompt, run the diskpart utility, select the target partition, and execute the command set id=. For MBR disks, you use hex codes (like id=27 for Recovery). For GPT disks, you use long GUID strings.
  • Using AOMEI Partition Software (GUI Alternative): Because typing the wrong command in Diskpart can instantly make your computer unbootable, IT professionals recommend using AOMEI Partition Software. This visual software allows you to change the partition type ID using a simple drop-down menu with just a few clicks, completely eliminating the risk of command-line typos.

In the world of Windows disk management, not all partitions are created equal. Behind the scenes, the Windows Operating System assigns a unique identifier—known as a Partition Type ID—to every single partition on your hard drive.

This ID dictates how Windows treats the partition. For example, a "Basic Data" partition is given a specific ID, so Windows knows it can assign a drive letter (like C: or D:) to it. Meanwhile, an "EFI System" or "Recovery" partition is assigned a completely different ID so Windows knows to hide it and protect it from accidental deletion.

Sometimes, system administrator users need to change this partition type ID manually. Whether you are trying to hide a sensitive data drive, fix a broken recovery environment, or configure a custom boot partition, you need the right tools.

In this comprehensive guide, we will teach you how to change a partition type ID using the native Windows Diskpart utility. More importantly, we will highlight the extreme risks of this method and show you the safest, visual GUI alternative to get the job done without crashing your system.

Crucial Knowledge: MBR vs. GPT Partition IDs

Before you type a single command, you must know what disk style you are using: MBR (Master Boot Record) or GPT (GUID Partition Table). The format of the partition type ID changes depending on your disk style.

  • MBR Disks use a simple 2-digit Hexadecimal code.
  • GPT Disks use a complex 32-character GUID (Globally Unique Identifier) string.

Common MBR Partition Type IDs (Hex Codes):

  • 0x07: NTFS Basic Data Partition (Standard Windows drives)
  • 0x0B or 0x0C: FAT32 Basic Data Partition
  • 0x12: OEM Recovery Partition
  • 0x27: Windows Hidden Recovery Partition
  • 0xEF: EFI System Partition

Common GPT Partition Type IDs (GUIDs):

  • Basic Data Partition: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
  • EFI System Partition: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
  • Windows Recovery Environment: de94bba4-06d1-4d40-a16a-bfd50179d6ac

How to Change Partition Type via Diskpart (Command Line)

Diskpart is a highly advanced tool. There is no "Undo" button. If you accidentally select your active C: drive and change its ID to an OEM Recovery partition, your computer will immediately crash and refuse to boot. Proceed with extreme caution.

Step 1. Press the Windows Key + R, type cmd, and press Ctrl + Shift + Enter to open Command Prompt as an Administrator.

Step 2. Type diskpart and press Enter to launch the utility.

Step 3. Type list disk and press Enter. Note the number of the disk containing the target partition.

Step 4. Type select disk N (replace N with your disk number) and press Enter.

Step 5. Type list partition and press Enter. Note the number of the partition you want to modify.

Step 6. Type select partition M (replace M with your partition number) and press Enter.

To set the new ID, type the following command depending on your disk style:

  • For MBR Disks: Type set id=27 (Replace "27" with your desired Hex code).
  • For GPT Disks: Type set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac (Replace with your desired GUID).

Step 7. Press Enter. If executed correctly, Diskpart will display: "DiskPart successfully set the partition ID."

Step 8. Type exit to close the utility.

Note: If Windows refuses to change the ID because the partition is actively in use, you can force the change by appending override to the end of the command, e.g., set id=27 override.

Change Partition Type ID in Windows 11 &10 GUI Alternative: AOMEI Partition Software

For 99% of computer users, risking a total system failure by typing long strings of GUID code into a black command terminal is simply not worth it. If you want to change a partition type ID safely, quickly, and visually, you should use AOMEI Partition Software.

Instead of memorizing complex hex codes and risking typos, AOMEI provides a clean Graphical User Interface (GUI). It allows you to select your partition visually, choose the new ID from a pre-labeled drop-down menu, and preview the change before permanently applying it to your hard drive.

AOMEI Partition Software

A safe and reliable disk partition management tool that helps you migrate OS to SSD or HDD, reorganize disk space, and improve overall PC performance.

 

Step 1. Install and Launch

Download, install, and open AOMEI Partition Software. You will immediately see a clear, color-coded visual map of all your disks and partitions.

Step 2. Select the Target Partition

Locate the specific partition you want to modify. Right-click on it, navigate to the Advanced menu, and click on Change Partition Type ID.

Step 3. Choose the New ID from the Menu. Select the ID you need and click OK.

A simple dialog box will pop up. Instead of making you type a code, the software provides a drop-down menu.

  • If your disk is MBR, the menu will list options like 0x27 (Recovery Partition) or 0x07 (NTFS).
  • If your disk is GPT, the menu will clearly label the GUIDs, such as Windows Recovery Environment or EFI System Partition.

Step 4. Apply the Changes.

You will return to the main interface. The change has not been finalized yet—AOMEI protects you with a "Virtual Preview." Review the pending operation on the left panel. If everything looks correct, click Apply at the top left and then Proceed. The software will safely execute the backend code for you.

Conclusion

Changing a partition type ID is a powerful disk management technique that allows users to configure recovery environments, hide sensitive data, or repair corrupted EFI system partitions.

While the native Windows Diskpart command-line utility is capable of executing the set id= command, the requirement to memorize complex MBR Hex codes and lengthy GPT GUIDs makes it incredibly risky for the average user.

To guarantee the safety of your data and prevent accidental OS corruption, utilizing a visual GUI tool like AOMEI Partition Software is highly recommended. By trading risky command-line typing for a simple, pre-labeled drop-down menu, you can configure your hard drive's partitions exactly how you want them with zero stress and absolute precision.

FAQs

Q: Will changing the partition type ID format the drive or delete my files?
A: No, changing the partition type ID does not alter the actual file system (like NTFS or FAT32) or delete the data stored inside the partition. It simply changes the "label" that tells Windows how to interact with the partition.

Q: I changed a partition ID to "Hidden/Recovery" and now I can't see the drive in File Explorer. How do I fix it?
A: This is normal! When a partition is tagged as a Recovery or EFI System Partition, Windows automatically removes its drive letter to protect it from being tampered with by the user. To make it visible again, use AOMEI or Diskpart to change the ID back to a Basic Data Partition (0x07 for MBR), and then assign it a new drive letter.

Q: What is the difference between changing the partition type ID and converting MBR to GPT?
A: Changing the partition type ID only affects a single partition's identifier label. Converting from MBR to GPT changes the entire physical hard drive's architecture and how the motherboard reads the boot sector. If you need to convert an entire disk to GPT for Windows 11 compatibility, AOMEI Partition Software has a dedicated "Convert to GPT" tool that does this without data loss.

Q: Can I use Diskpart on a Mac or Linux system?
A: No, Diskpart is a proprietary command-line disk partitioning utility created exclusively for Microsoft Windows Operating Systems.

Lucas · Editor
I prefer peaceful and quiet life during vacation,but sometimes I watch football match if my favorite club performs brilliantly in that season. And I love reading, painting and calligraphy, thus I send my friends festival handwriting cards every year.