Wondershare Recoverit

Memory Card Recovery

  • Retrieves data from all types and brands of memory cards
  • Supports the recovery of over 1000 file types stored on memory cards
  • Capable of recovering data regardless of the cause of your SD card data loss
  • The intuitive interface enables simple 3-step memory card data recovery
  • Offers both quick and deep scanning options to locate and restore all missing data
Free Download Free Download Free Download Learn More >
memory card recovery

How to Format an SD Card Using CMD in Windows 11/10

A safety-first guide to formatting an SD or memory card from Windows Command Prompt, with direct FORMAT and DiskPart methods, 2026 FAT32 changes, troubleshooting, and recovery guidance.
Eleanor Reed
Eleanor Reed Originally published Jan 22, 25, updated Sep 16, 26
robot TL;DR:

Use the direct format command to quickly reformat a healthy SD card that already has a drive letter, or use the DiskPart utility to completely rebuild the partition layout of a damaged card, ensuring you recover important files before running either destructive tool.
    ● Open Command Prompt as Administrator and execute a command like format E: /FS:exFAT /Q to clear an accessible card, replacing E: with the correct drive letter and matching the file system to your target device.
    ● Run the DiskPart tool for broken partition structures by selecting the verified disk number, using the clean command to erase the layout, and creating a new primary partition, but avoid the clean all command if you need to recover lost data later.
    ● Updated Windows 11 24H2 and 25H2 systems can now format FAT32 volumes up to 2TB via the command line instead of stopping at the old 32GB limit, though you should generally stick to exFAT for SDXC cards to maintain hardware compatibility.


Ask AI for a summary

Need to format an SD card from Command Prompt? Windows gives you two useful CMD routes: the regular format command for a card that already has a usable drive letter, and DiskPart when you need to rebuild the card's partition layout. Both can erase access to existing files, so the safest method depends on the card's current state and whether you still need the data.

Quick Answer

For a healthy card with a drive letter: use format E: /FS:exFAT /Q /V:SDCARD, replacing E: with the SD card's actual letter.

For a broken partition layout: use DiskPart only after verifying the correct disk, then run clean, create a new primary partition, format it, and assign a drive letter.

If files still matter: copy readable files first. If the card is inaccessible but still detected with the correct capacity, recover files to another drive before formatting.

For FAT32 in 2026: updated Windows 11 24H2/25H2 command-line tools can format FAT32 volumes up to 2TB; older Windows builds may still hit the former 32GB limit.

Free Download
Free Download
In This Article
    1. Choose the Right CMD Route
    2. Choose the Right File System
    1. Quick Format a Healthy SD Card
    2. Run a Full Format Only When Appropriate
    1. Identify the Correct SD Card
    2. Rebuild and Format the Card
    1. Windows 11 Raised the Command-Line FAT32 Limit
    2. Match the File System to the SD Card Standard
    1. The Disk Is Write-Protected
    2. The Volume Is Too Big for FAT32
    3. Windows Was Unable to Complete the Format
    4. The SD Card Is RAW, Unallocated, 0 Bytes, or Not Detected
    1. When Recovery Software Makes Sense
    2. Recover SD Card Files With Recoverit

Part 1. Check Before You Format an SD Card Using CMD

A CMD format is destructive by design: Windows creates a new file system, and DiskPart can also remove the existing partition structure. Before entering any command, decide whether you are formatting a healthy card for reuse or trying to deal with a card that already contains important, inaccessible files.

Choose the Right CMD Route

SD Card State Best Next Step Why
Card opens normally and has a drive letter Use the direct format command It formats the existing volume without first deleting the partition table.
Card has a damaged or unwanted partition layout but is detected with the correct capacity Use DiskPart after backing up or recovering needed files DiskPart can remove the existing partition structure and build a new volume.
Card is RAW or asks to be formatted and files matter Recover data first; do not format yet Formatting writes new file-system metadata and can reduce recovery options.
Card shows 0 bytes, No Media, or is not detected in any reader/computer Do not force a CMD format Windows does not have a usable storage target to format; reader, controller, or physical failure may be involved.

If Windows is specifically showing a format prompt while your files are still needed, use the recovery-first workflow in SD card needs to be formatted instead of starting with DiskPart.

Choose the Right File System

For most removable SD cards, the safest compatibility choice is based on the card standard and the device that will use it. The SD Association capacity specification maps SDHC cards to FAT32 and SDXC/SDUC cards to exFAT.

Card / Use Case Typical File System What to Know
SDHC, over 2GB to 32GB FAT32 Broad device compatibility, but a single FAT32 file cannot exceed 4GB.
SDXC, over 32GB to 2TB exFAT The SD Association standard file system for SDXC; suitable for large video files.
SDUC, over 2TB to 128TB exFAT Use only with hardware that explicitly supports SDUC capacities.
Windows-only storage workflow NTFS only if the target device supports it Many cameras, consoles, and embedded devices do not expect NTFS on SD cards.

Do not force a nonstandard file system just because Windows offers it. If a camera, console, dash cam, or other device provides its own formatting function, check that device's manual before choosing a file system.

Part 2. Format an SD Card Using the Direct CMD Format Command

If the SD card already appears in File Explorer with a drive letter and you simply want to reformat that volume, the direct Windows format command is the shortest route. Microsoft documents the syntax as format volume /FS:file-system, with /Q for quick format.

Quick Format a Healthy SD Card

Step 1. Confirm the SD card drive letter.

Open File Explorer > This PC and note the letter assigned to the SD card. In the example below, E: is used only as a placeholder. Do not copy E: unless that is actually your SD card.

Step 2. Open Command Prompt as Administrator.

Search for Command Prompt, right-click it, and choose Run as administrator.

open command prompt as administrator to format an sd card

Step 3. Run the format command for the file system you need.

For an SDXC card that should use exFAT:

format E: /FS:exFAT /Q /V:SDCARD

For a card or device that specifically requires FAT32:

format E: /FS:FAT32 /Q /V:SDCARD

Replace E: with the real SD card drive letter. /Q requests a quick format, while /V:SDCARD assigns the volume label SDCARD. According to Microsoft's FORMAT documentation, quick format deletes the file table and root directory without doing a sector-by-sector scan for bad areas, so it is intended for previously formatted volumes that you know are in good condition.

Step 4. Wait for the completion message and verify the card.

When the format finishes, reopen the SD card in File Explorer, check the file system in Properties, and safely eject the card before moving it to another device.

Run a Full Format Only When Appropriate

To run the regular format process without the quick-format switch, omit /Q:

format E: /FS:exFAT /V:SDCARD

This takes longer because Windows can check the volume for bad areas while formatting. Do not use repeated full formats as a way to "repair" a card that keeps returning read/write errors. If errors come back after a successful format, treat that as a reliability warning and replace the card rather than trusting it with new photos or video.

Part 3. Format an SD Card via CMD With DiskPart

DiskPart is the stronger CMD method. Use it when the card's existing partition layout must be removed and recreated, not as the default first step for every format. Microsoft notes that DiskPart's clean command removes partition or volume formatting from the selected disk. That is different from clean all, which writes zeros to every sector.

Identify the Correct SD Card

Step 1. Start DiskPart.

diskpart
start diskpart from command prompt

Step 2. List all disks.

list disk
list disks in diskpart before formatting an sd card

Step 3. Select the SD card by its verified disk number.

Compare the listed capacities with the SD card's labeled capacity, disconnect other removable drives if possible, then replace X below with the correct number:

select disk X
detail disk
select the correct sd card disk in diskpart

Stop if the size, volumes, or other details do not match your SD card. Disk numbers are not universal, so a rule such as "always avoid Disk 0" is not a substitute for verifying the actual device.

Rebuild and Format the Card

Only continue after any needed files have been backed up or recovered.

Step 4. Remove the existing partition layout.

clean
run clean on the selected sd card in diskpart

Microsoft states that clean removes partitions or volume formatting from the selected disk. clean all is much more destructive because it zeroes every sector; do not use clean all when there is any chance you may need data recovery. See the official DiskPart clean command reference.

Step 5. Create a new primary partition.

create partition primary
create a primary partition on the sd card in diskpart

Step 6. Format the new partition.

For exFAT:

format fs=exfat quick label=SDCARD

Or, if the target device specifically requires FAT32:

format fs=fat32 quick label=SDCARD
format an sd card as exfat or fat32 in diskpart

Step 7. Assign a drive letter and exit.

assign
exit
assign a drive letter after formatting an sd card in diskpart

Windows assigns an available drive letter automatically when assign is used without a letter. Reopen File Explorer and confirm that the card now reports the intended capacity and file system.

Free Download
Free Download

Part 4. File System Choices for SD Cards in 2026

The biggest 2026 change for this query is no longer the command syntax. It is Windows' FAT32 command-line formatting limit.

Windows 11 Raised the Command-Line FAT32 Limit

Microsoft's April 30, 2026 Windows 11 preview update increased the command-line FAT32 formatting limit from 32GB to 2TB for Windows 11 versions 24H2 and 25H2. The change was then included in the May 12, 2026 cumulative update, KB5089549, which incorporates the prior preview improvements. You can review the change in Microsoft's April 2026 release notes and the May 2026 cumulative update notes.

That means a current Windows 11 24H2/25H2 PC can format much larger FAT32 volumes from the command line than older Windows versions. However, this Windows capability does not mean FAT32 is automatically the correct format for every large SD card. Device specifications still matter, and FAT32 still has a 4GB maximum individual file size.

Match the File System to the SD Card Standard

For standards-based compatibility, SDHC cards are normally FAT32, while SDXC and SDUC cards are normally exFAT. A 128GB SDXC card may technically be formatable as FAT32 on an updated Windows 11 system, but doing so can make it nonstandard for devices that expect SDXC media to use exFAT.

If your real goal is specifically to format a 64GB, 128GB, or larger card as FAT32 for an older device, use the dedicated SD card FAT32 guide and confirm the target device's capacity and file-system requirements first.

Part 5. Fix CMD SD Card Format Errors Safely

When a CMD format fails, do not automatically add more destructive commands. Match the error to the card state first.

The Disk Is Write-Protected

First check the lock tab on a full-size SD card or SD adapter. A physical lock cannot be overridden by CMD. If there is no physical lock and DiskPart reports a software read-only attribute, you can inspect and clear it after selecting the correct disk:

diskpart
list disk
select disk X
attributes disk
attributes disk clear readonly

The correct command is attributes disk clear readonly. Microsoft's attributes disk reference confirms that a disk must be selected before disk attributes can be changed. If read-only status immediately returns, try another reader and computer. A failing card controller can force read-only behavior to protect remaining data.

The Volume Is Too Big for FAT32

If Windows reports that the volume is too large for FAT32, first check your Windows version and updates. The 2TB command-line limit is a Windows 11 24H2/25H2 change from 2026; Windows 10 and older Windows 11 builds may still behave differently. If the target device supports exFAT, use exFAT instead. If the target device specifically requires FAT32, follow its vendor instructions rather than repeatedly forcing the format.

Windows Was Unable to Complete the Format

This error has a broader set of causes than this CMD-focused page should duplicate. Write protection, a damaged file system, a failing reader, and deteriorating flash memory can all be involved. Use the dedicated Windows was unable to complete the format SD card guide for the full decision path.

If formatting succeeds once but the same errors return, replace the card. Formatting can recreate a file system; it cannot repair worn flash cells, a failing controller, broken contacts, or other physical faults.

The SD Card Is RAW, Unallocated, 0 Bytes, or Not Detected

What Windows Shows If Files Matter Formatting Advice
RAW but correct capacity is visible Stop writes and recover files first Format only after recovery or when the data is no longer needed.
Unallocated space with correct capacity Do not create a new volume first Creating a partition writes new metadata; recover first if data matters.
0 bytes / No Media Test another reader, port, and computer Do not keep issuing clean/format commands if usable capacity is not exposed.
Not detected anywhere Stop repeated DIY attempts CMD cannot format a device Windows cannot see; consider professional recovery for important data.

If the card is corrupted but still detected, see the broader SD card repair guide. Keep repair and format attempts separate from the recovery phase when the files are valuable.

Part 6. Recover Files Before or After Formatting an SD Card

The safest time to protect data is before formatting. If the SD card opens normally, copy important files to another healthy drive first. If the card is inaccessible but Windows still detects it with a plausible capacity, a recovery scan can be appropriate before you run format, clean, or create a new partition.

When Recovery Software Makes Sense

Wondershare Recoverit Memory Card Recovery is designed for logical data-loss cases such as accidental deletion, formatting, RAW file systems, and inaccessible memory cards that are still detectable by the computer. It is not a fix for a physically cracked, severely water-damaged, overheating, or completely undetected card.

recoverit logo
Wondershare Recoverit
Your Safe & Reliable Data Recovery Expert
Download Download

Easily recover deleted or lost files in 500+ data loss situations, such as deletion, formatting, and disk corruption. The software confidently retrieves all data types, regardless of how they went missing.

  • Before formatting: use recovery first when the card is readable by the system but files are missing or inaccessible.
  • After an accidental quick format: stop using the card immediately, because new writes can overwrite recoverable data.
  • Save recovered files elsewhere: never restore files back to the same SD card during the recovery process.

Recover SD Card Files With Recoverit

Step 1. Choose the memory card.

Install Recoverit on the computer, connect the SD or microSD card through a stable reader, open the SD Card Recovery section, and select the detected card.

choose the detected sd card in recoverit memory card recovery

Step 2. Scan and narrow the results.

Let the scan run, then use file type, date, size, search, and preview tools to identify the files you need. Avoid saving anything to the source card while scanning.

scan the sd card for lost files in recoverit

Step 3. Preview and recover to a different location.

Select the recoverable files and save them to the computer or another healthy drive, not to the original SD card.

recover sd card files to a different healthy drive

Recovery is not guaranteed. Results depend on whether the lost data has been overwritten, the card's logical and physical condition, encryption, the type of format performed, and whether the operating system can still detect the storage device.

Part 7. When CMD Is Not the Best SD Card Formatter

CMD is useful when you specifically need a Windows command-line workflow, but it is not always the best choice for device compatibility. The SD Association's SD Memory Card Formatter is designed specifically for SD/SDHC/SDXC/SDUC cards, and the Association recommends it over general operating-system formatting tools for standards-compliant SD formatting.

  • Camera, drone, dash cam, or console: if the device offers an in-device format function, that is often the best way to create the layout and folders it expects.
  • Healthy SD card on Windows: use direct CMD format when you need a fast command-line method.
  • Partition problems: use DiskPart only when the existing partition structure actually needs to be rebuilt.
  • Important inaccessible files: recover or copy them before formatting.
  • Recurring errors: replace the card instead of treating repeated formatting as a permanent hardware repair.

Conclusion

To format an SD card using CMD, use the direct format command when the card already has a healthy volume and drive letter. Use DiskPart when you genuinely need to remove and rebuild the partition layout. In 2026, updated Windows 11 24H2/25H2 systems also remove the old 32GB command-line FAT32 formatting ceiling, but SDHC/SDXC standards and your target device's requirements should still determine whether FAT32 or exFAT is appropriate. Most importantly, protect or recover valuable files before running destructive commands.

Free Download
Free Download

FAQ

  • What CMD command formats an SD card?
    If the SD card already has a drive letter, a direct command such as format E: /FS:exFAT /Q /V:SDCARD can format it. Replace E: with the real card letter. If the partition layout needs to be rebuilt, use DiskPart, verify the correct disk, then use clean, create partition primary, format, and assign.
  • Can Windows 11 format an SD card larger than 32GB as FAT32 from CMD?
    Yes on updated Windows 11 24H2 and 25H2 systems that include Microsoft's 2026 FAT32 command-line change, which raised the limit from 32GB to 2TB. Older Windows builds may still hit the former limit. A large SDXC card is normally specified for exFAT, so confirm the target device's requirements before forcing FAT32.
  • What is the difference between FORMAT and DiskPart for an SD card?
    The direct FORMAT command reformats an existing volume. DiskPart is a disk-management environment that can select a whole disk, remove its partition information with clean, create a new partition, format it, and assign a drive letter. DiskPart is more destructive and should be used only when its extra control is needed.
  • Does DiskPart clean erase every byte on an SD card?
    No. Microsoft's documentation says clean removes partition or volume formatting information from the selected disk. clean all is the command that writes zeros to every sector. Both are destructive to normal access, so recover important files before using them.
  • Why does CMD say my SD card is write-protected?
    Check the physical lock switch on the SD card or adapter first. If the lock is open, DiskPart can display and clear a software read-only attribute with attributes disk and attributes disk clear readonly. If read-only status keeps returning, test another reader and computer because the card may be failing.
  • Can I recover files after formatting an SD card in CMD?
    Sometimes. Stop using the card immediately and scan it only if the computer still detects the storage. Recovery depends on overwrite, card condition, encryption, and the type of format or DiskPart operation used. Save any recovered files to a different healthy drive.
Eleanor Reed
Eleanor Reed Sep 16, 26
Share article:
Get Recoverit Get Recoverit