How to Change the Write Protection on an SD Card

Write protection on an SD card is one of those small obstacles that can feel surprisingly confusing — especially when your computer insists a card is read-only and you can't figure out why. The good news is there are several ways to remove write protection, and most of them take less than two minutes once you know what to look for.

What Write Protection Actually Does

Write protection is a safeguard that prevents any new data from being written to a storage device — and prevents existing data from being deleted or overwritten. On an SD card, this is useful when you're archiving photos you never want accidentally erased, or passing a card between devices and want to ensure nothing gets changed.

The problem is that write protection can be triggered in more than one way, and the fix depends entirely on why it's active.

The Physical Lock Switch: The Most Common Cause 🔒

The simplest and most overlooked cause is the physical write-protect switch built into full-size SD cards (the standard SD and SDHC/SDXC form factor). Look at the left edge of your SD card — there's a small plastic slider.

  • Slid toward the bottom (toward the card's contacts): write protection is on
  • Slid toward the top: write protection is off

Slide it up, reinsert the card, and the problem is often solved immediately.

Important caveats here:

  • MicroSD cards do not have a physical switch. If you're using a microSD card in a full-size adapter, the adapter itself has the switch — not the card. Check the adapter.
  • The plastic switch can wear down or break over time. If the switch moves freely but keeps slipping back, the adapter may need replacing.
  • Some card readers have their own lock mechanisms independent of the card.

Removing Write Protection Through Your Operating System

If the physical switch isn't the issue — or you're working with a microSD card — the write protection may be set in software.

On Windows

Windows has a built-in command-line tool called Diskpart that can clear write protection flags:

  1. Press Windows + R, type diskpart, and press Enter (run as administrator)
  2. Type list disk and press Enter — identify your SD card by its size
  3. Type select disk # (replace # with the SD card's number)
  4. Type attributes disk clear readonly
  5. Type exit

This clears the read-only attribute stored on the disk. After running these commands, eject and reinsert the card.

You can also check via File Explorer: right-click the SD card drive, select Properties, and look for a read-only checkbox under the General tab — though this method is less reliable for storage devices than Diskpart.

On macOS

macOS handles this differently. Open Disk Utility (found in Applications > Utilities), select your SD card from the sidebar, and check whether a First Aid repair resolves any filesystem flags that may be causing the restriction. macOS doesn't expose a write-protection toggle the same way Windows does — if the physical switch is off and the card still appears locked, a filesystem error or disk format issue is more likely the culprit.

On Linux

Use the hdparm command to check for software write protection:

sudo hdparm -r /dev/sdX 

Replace /dev/sdX with your card's device path. If the result shows readonly = 1, you can clear it with:

sudo hdparm -r0 /dev/sdX 

File System and Formatting Issues

Sometimes write protection isn't a toggle at all — it's a symptom of a deeper problem. 🛠️

An SD card formatted as NTFS on Windows may behave as read-only when inserted into a Mac or Linux system, because those platforms don't always have full NTFS write support out of the box. Similarly, a card formatted in exFAT or FAT32 will behave differently depending on the OS version and available drivers.

A corrupted file system can also trigger apparent write protection. The card isn't technically locked — the OS is simply refusing to write because it detects filesystem errors. Running a disk check (chkdsk on Windows, First Aid in macOS Disk Utility) can sometimes resolve this without data loss.

If the filesystem is too damaged to repair, reformatting is the nuclear option. Reformatting will erase all data, so only do this if you've recovered what you need or the card is empty.

When Write Protection Points to a Dying Card

SD cards have a limited number of write cycles — this is especially true of lower-endurance cards. Some cards enter a self-imposed read-only mode when they detect that their flash memory is nearing the end of its reliable lifespan. This is a protective behavior, not a bug.

SymptomLikely Cause
Lock switch is off, but card stays read-onlySoftware flag or filesystem error
Card works in one device but not anotherFilesystem compatibility mismatch
Diskpart commands don't persistCard hardware may be failing
Card randomly became read-only after years of useEnd-of-life flash memory behavior

If Diskpart clears the attribute but the card reverts to read-only after ejecting, the card itself may be failing — and no amount of software fixes will permanently resolve it.

Variables That Affect Which Fix Works for You

The right approach depends on several factors that vary from one situation to the next:

  • Card type and form factor — full-size SD vs. microSD changes whether a physical switch is involved
  • Operating system — Windows, macOS, and Linux each handle write attributes differently
  • Card reader — some third-party readers have their own lock behavior independent of the card
  • Card age and usage history — heavy-use cards may be entering hardware-level read-only mode
  • Filesystem format — exFAT, NTFS, FAT32, and others behave differently across platforms
  • Whether data recovery is a priority — this determines whether reformatting is an acceptable step

Each of these variables pushes toward a different fix, and in some cases, the combination of two or three of them explains why a straightforward solution didn't work the first time.