keepcalculator

06 Numbers and Powers

Unlock SD Card: Fixes for Write Protection

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

If your SD card is suddenly read-only, showing “The disk is write protected” or “Card is locked,” the fix is usually a tiny physical switch on the card’s side, or a software attribute that needs clearing. This article walks you through every reliable method to unlock an SD card, from the simplest hardware check to command-line tools, and explains why the card became locked in the first place.

Why Does an SD Card Get Locked?

SD cards have two distinct ways of becoming write-protected: a mechanical switch and a software flag. The mechanical switch is a small slider on the left edge of the full-size SD card. Slide it down (toward the gold contacts) to unlock, up to lock. It is purely physical—no electronics read it, so a broken or loose switch can make the card permanently locked from the card’s perspective. The software lock is a hidden byte in the card’s controller firmware that the operating system reads. It can be set by a device (a camera, phone, or card reader) that wrote to the card and then failed to clear the flag, or by a corrupted file system. Understanding which type you have determines the correct fix.

First: Check the Physical Lock Switch

This is the most common cause and the easiest to fix. Remove the SD card from the device and look at the left side (when the label faces you). You’ll see a small notch with a slider. If the slider is in the upper position (toward the top of the card), it’s locked. Slide it down firmly until it clicks into the lower position. Then reinsert the card and try writing to it again.

If the slider is already down but the card still reports locked, the switch may be broken or stuck. Try these steps:

  • Move the slider up and down several times to dislodge any debris.
  • Clean the switch area with a dry cotton swab or a tiny amount of isopropyl alcohol.
  • If the slider is missing or loose, a tiny piece of tape over the notch (where the switch would be) can sometimes work as a temporary fix, but it’s not reliable and can damage the card reader.

If the physical switch is fine, the problem is almost certainly a software lock.

Clear the Read-Only Attribute on Windows

Windows often sets a “read-only” attribute on the drive, which is different from the card’s hardware lock. You can clear it using the DiskPart command-line tool. This works on Windows 10 and 11.

  1. Insert the SD card into your computer’s card reader.
  2. Open Command Prompt as Administrator (search “cmd”, right-click, “Run as administrator”).
  3. Type diskpart and press Enter.
  4. Type list disk and press Enter. Note the disk number that matches your SD card’s size (e.g., Disk 1). Be absolutely sure you select the correct disk—you could erase the wrong drive.
  5. Type select disk X (replace X with the correct number) and press Enter.
  6. Type attributes disk clear readonly and press Enter.
  7. Type exit and press Enter.

After this, try writing to the card. If DiskPart reports “Disk attributes cleared successfully,” the software lock is gone. If it says “Disk attributes cannot be cleared,” the card’s controller itself is locked, which usually means the card is failing or has been permanently write-protected by the manufacturer.

Use the regedit Method (Windows)

Some Windows installations have a registry setting that forces all removable drives to be read-only. This is rare, but worth checking if DiskPart didn’t work.

  1. Press Win + R, type regedit, and press Enter.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.
  3. If the key StorageDevicePolicies doesn’t exist, right-click on Control, select New > Key, and name it StorageDevicePolicies.
  4. Inside that key, look for a DWORD value named WriteProtect. If it exists, double-click it and set its value to 0. If it doesn’t exist, create it (New > DWORD (32-bit) Value) and set it to 0.
  5. Close regedit and restart your computer.

This is a system-level setting, so it affects all removable drives. If you don’t see the key, the registry is not the cause.

Format the SD Card (When You Don’t Need the Data)

Sometimes the file system is corrupted, and the card appears locked even though it isn’t. Formatting will erase everything, so only do this if you’ve backed up the data or don’t need it. Use the SD Association’s official formatter tool (SD Memory Card Formatter) for best results, or the built-in Windows format tool.

  • Windows: Open File Explorer, right-click the SD card drive, select Format, choose FAT32 (for cards up to 32GB) or exFAT (for 64GB and larger), and click Start.
  • macOS: Open Disk Utility, select the SD card, click Erase, choose MS-DOS (FAT) for 32GB or less, or ExFAT for larger, and click Erase.
  • Android: Go to Settings > Storage > SD card > Format as portable or internal storage.

If formatting fails with a “write protected” error, the card’s controller is locked, and formatting won’t help.

When the Card Is Physically Damaged or Fake

If none of the software methods work, the card may be physically failing or counterfeit. A genuine SD card has a controller that can fail over time—especially if it was exposed to extreme heat, moisture, or static. A counterfeit card (often sold as a huge capacity at a low price) frequently has a fake capacity and becomes write-protected when you try to write beyond its real size. Signs of a failing card:

  • Files disappear or become corrupted.
  • The card is hot to the touch.
  • It works in one device but not another.
  • It shows a much smaller capacity than printed.

In these cases, the card is not worth repairing. Replace it with a card from a reputable brand and buy from an authorized seller to avoid counterfeits.

Frequently Asked Questions

Why does my SD card say “The disk is write protected” even though the switch is unlocked?

This usually means the software lock is set, not the physical switch. Try the DiskPart command to clear the read-only attribute. If that fails, the card’s controller may be faulty, or the card is counterfeit.

Can I unlock an SD card with a broken lock switch?

Sometimes. If the switch is just stuck, cleaning it may help. If it’s physically missing, a tiny piece of tape over the notch can sometimes work, but it’s unreliable and can get stuck in the reader. The safest fix is to replace the card.

Will formatting remove the write protection?

Only if the protection is due to a corrupted file system. If the card’s controller has a hardware write-protect flag, formatting will fail. Try formatting after clearing the read-only attribute with DiskPart.

Does the lock switch on an SD card actually do anything?

Yes, it sends a mechanical signal to the card reader, which then refuses to write. It’s not read by the card’s controller, so if the switch is broken, the card may still appear locked even though the controller is fine.

Can I recover data from a write-protected SD card?

Yes, because the card is still readable. Copy the files to your computer first, then attempt the unlocking methods. If the card is physically failing, copy what you can immediately.

Is there a way to unlock an SD card on a phone?

If the phone reports the card as read-only, try the same physical switch check. For software locks, you’ll need to connect the card to a computer and use DiskPart or a formatting tool. Most phones don’t expose the read-only attribute.

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 →