How to Format an SD Card

Wipe an SD card with a Windows PC

Before you put an old SD Card in your new smartphone or camera, you might want to wipe the data on the card by formatting it. Here's how to format an SD card using a Windows PC.

Instructions in this article apply to Windows 10, 8, and 7.

What You Need to Format an SD Card

Most modern computers have an SD card slot somewhere on the side of the computer. SD cards come in different sizes, so you may need an adapter if you have a micro SD card. If your computer doesn't have an SD card slot, you will need to use an SD card reader that can plug into a USB port.

How to Format an SD Card on Windows

To format an SD card on a Windows PC:

  1. Insert the SD card into your computer.

    Illustration of a person placing an SD card into a laptop
    Lifewire / Derek Abella
  2. Open File Explorer and locate the drive letter for your SD card. Right-click the drive and select Format.

    Right-click the SD card drive and select Format.
  3. If the Capacity of your SD card is less than 64 GB, set the File System to FAT32. If it's 64 GB or higher, set the File System to exFAT. Select Start to begin.

    You can give the formatted drive a name by entering it into the Volume label.

    Set the File System and select Start.
  4. Select OK to ignore the warning that all of the data on the drive will be erased and begin formatting the card.

    Select OK to ignore the warning and begin formatting the SD card.

How to Format Write-Protected SD Cards

Sometimes when attempting to format an SD card, you will receive an error saying that it is write-protected, or read-only. Most cards have a little tab on the edge that you can move up or down. If your card is write-protected/read-only, move the tab to the opposite position (i.e. if it's up, move it down; if it's down, move it up).

If the drive is still write-protected, or if there is no tab, follow these instructions:

If there is a physical tab on the SD card, then this process overrides the above instructions, and you'll need to amend the position of the tab to turn read-only on and off.

  1. Right-click the Start menu and select Windows PowerShell (Admin) on Windows 10 or Command Prompt (Admin) on Windows 8.

    If you are using Windows 7 or earlier, select the Start menu, right-click Command Prompt, and select Run as administrator. You may need to navigate through the menus to find the Command Prompt icon.

    Right-click the Start menu and select Windows PowerShell (Admin) on Windows 10.
  2. Type diskpart in the Command Prompt window and press Enter.

    Type diskpart in the Command Prompt window and press Enter.
  3. Type list disk and press Enter. A list of all the available disks on your computer will appear. Look for the disk number that resembles the size of the SD card.

    Type list disk and press Enter.
  4. Type select disk # (where # is the number of the disk for the SD card) and press Enter.

    Select the disk number for the SD card.
  5. Type attributes disk clear readonly and press Enter.

    Type attributes disk clear readonly and press Enter.
  6. Type clean and press Enter.

    Type clean and press Enter.
  7. When the process is complete, type exit and press Enter, then close the Command Prompt and format the SD card using File Explorer as outlined above.

    When the process is complete, type exit and press Enter, then close the Command Prompt.

How to Tell if an SD Card Has Been Partitioned

If you've installed a version of Linux to your SD card for use on a single board computer, such as a Raspberry Pi, then the card has likely been partitioned so that it can boot correctly into Linux. Before you can re-purpose that SD card for other uses, you must remove the partition.

To determine if your SD card has a partition, right-click the Start menu and select Disk Management.

If using Windows 7 or earlier, click the Start menu and type diskmgmt.msc in the search box to find the Disk Management tool.

Right-click the Start menu and select Disk Management.

Beside the disk number for your SD card, you may see a number of partitions. Usually, the first partition will be named unallocated. If this is the only partition listed, then the instructions above should work. If there are multiple partitions, they must be removed before you can format the card.

Beside the disk number for your SD card, you may see a number of partitions assigned to your SD card in the Disk Management tool.

How to Remove Partitions From an SD Card

To format the SD card so that it is one continuous partition:

  1. Right-click the Start menu and select Windows PowerShell (Admin) on Windows 10 or Command Prompt (Admin) on Windows 8.

    If you are using Windows 7 or earlier, select the Start menu, right-click Command Prompt, and select Run as administrator. You may need to navigate through the menus to find the Command Prompt icon.

    Right-click the Start menu and select Windows PowerShell (Admin) on Windows 10.
  2. Type diskpart in the Command Prompt window and press Enter.

    Type diskpart in the Command Prompt window and press Enter.
  3. Type list disk and press Enter. Find the disk number that matches your SD card (it should be the same size).

    Type list disk and press Enter.
  4. Type select disk # (where # is the number of the disk for the SD card) and press Enter.

    Select the disk number for the SD card.
  5. Type list partition and press Enter.

    Type list partition and press Enter.
  6. Type select partition 1 and press Enter.

    Type select partition 1 and press Enter.
  7. Type delete partition and press Enter. Repeat steps 6 and 7 until there are no more partitions

    As soon as you delete the first partition, the next one will become partition 1, so it will always be partition 1 that you delete.

    Type delete partition and press Enter.
  8. Type create partition primary and press Enter.

    Type create partition primary and press Enter.

Once the process is complete, you can close the Command Prompt and format the SD card as normal.