Android flashes "SD card is corrupted" or "Blank SD card," and the gallery empties out. If that's where you are, the main thing to know is this: the photos and videos are probably still on the card. Android just can't read them anymore.
What you do in the next ten minutes decides how much comes back. Most of what follows is about not making things worse.
An SD card has a file system, which is a record of every file and its location. Android reads that record every time you insert the card. If the record gets damaged, the phone can't list your files, so it reports the card as corrupted and offers to format it.
The usual causes are pulling the card while the phone is writing to it, the battery dying during a copy, bad sectors on an old card, a cheap counterfeit card, or a loose contact in the slot. The data itself normally stays on the card. Formatting removes the broken record and lets new files overwrite the old ones, and that is how people lose photos for good.
Turn the phone off and take the card out.
Don't format it, and don't keep reinserting it.
Don't save or copy anything onto it.
If you already formatted it, the same applies. Stop using it, and go straight to the Stellar section below.
Sometimes the card is fine. Clean the gold contacts with a dry cloth, check the slot for dust, and try the card in another phone. A damaged slot can look exactly like a corrupted card.
Then try a computer. A USB card reader costs very little, and a lot of laptops have an SD slot if you use a microSD adapter. If the card opens, copy all the files to your hard drive and stop there. If Windows asks you to format it or shows it as RAW, keep reading.
Also look at your cloud backup. If Google Photos or Samsung Cloud was on, the pictures may already be safe online.
Some viruses, and some interrupted writes, set files to hidden. The card looks empty, yet its used space says otherwise. In Windows, open Command Prompt as administrator and run this, using your card's drive letter in place of X:
attrib -h -r -s /s /d X:\*.*
If the files show up, copy them off. If not, move on.
Here's where I'd tell most people to go, because it's the most dependable way to deal with real corruption. Recovery apps that run on the phone itself have an obvious problem: they depend on the same Android that can't read the card, and the best ones often need root access, which isn't something a typical user wants to try on a phone that holds the only copy of their photos. A computer-based tool avoids all of that.
Stellar Photo Recovery is a well-known photo recovery software made for photos, videos and audio, which covers nearly everything people store on a phone card. It reads the card at a low level rather than trusting the broken file system, so it can find files on cards that are corrupted, formatted, or reported as RAW. It recognizes common formats such as JPEG and PNG as well as many camera RAW files and popular video types. The scan reads the card without writing to it, which is the behavior you want when the card is unstable. And because you can preview files before recovering them, you don't have to guess what's worth saving.
Steps:
Connect the card to your computer with a card reader.
Install Stellar Photo Recovery from the official Stellar website. Install it on your computer, not on the SD card.
Open it and select the option for photos, audio and video.
Choose your SD card from the list of drives and start the scan.
If your files don't appear, run the deep scan. This takes longer, because it goes through the whole card, but it finds more.
Open a few previews to confirm the files are intact.
Select the files you want, click Recover, and save them to a folder on your computer. Do not save them back to the card.
Check that the recovered files open properly before you do anything else to the card.
Once your files are safe, you can fix the card. On Windows, open Command Prompt as administrator and type chkdsk X: /f, replacing X with the drive letter. That scans the file system and repairs errors. If the card works after that, you can keep using it, though I'd format it anyway.
If chkdsk fails, format the card. Do it from the phone (Settings, then Storage, then the SD card, then Format, with small differences by brand) or from a computer. The free SD Memory Card Formatter from the SD Association works well. Use exFAT if the card is bigger than 32 GB, FAT32 if it's 32 GB or smaller.
If the error comes back, or the card gets hot, slows down or disappears from the phone, replace it. They wear out.
You won't always get everything. Overwritten files are gone. Some videos come back damaged, and some photos show gray areas or stop partway. If a computer can't detect the card at all, the problem is likely physical, such as a dead controller, and the only option is a professional recovery service, which costs money.
A formatted card still has a decent chance. Formatting often clears only the file system, so a deep scan may find most of the old files, as long as nothing new was written afterward.
Can I recover data without a computer? Only in limited cases. If your phone still reads the card partly, you can copy files to internal storage. For a card that's truly corrupted, a computer gives you far better results.
Will scanning damage the card? A read-only scan doesn't write anything to it. What does damage a card is formatting it, or saving new files onto it.
How long does a scan take? It depends on the card's size and condition. A quick scan on a small card can be a few minutes. A deep scan of a 128 GB card can take an hour or more, so leave the computer plugged in and don't interrupt it.
Does the card's brand matter? For recovery, not much. For reliability, yes. Branded cards fail less often than no-name ones.
Use "Unmount" or "Eject" in the storage settings before removing the card. Don't pull it out while the phone is saving something. Buy cards from known brands, from sellers you trust, because fakes fail a lot. And back up. An SD card shouldn't be the only place your photos live. Turn on automatic backup to the cloud, or copy the card to a computer once a month.
Remove the card, don't format it, check your cloud backups, and scan the card with Stellar Photo Recovery on a computer. Save the recovered files somewhere other than the card, and only then repair or replace it. In most cases that sequence gets your files back.