PhotoRec for Mac: how to install it, run a photo scan, and an easier option
THE SHORT ANSWER
PhotoRec is free, open-source recovery software from CGSecurity, and it runs on a Mac
in Terminal. The easiest way to install it is Homebrew: run brew install testdisk, then
sudo photorec. Choose the card, set the file system type to Other, choose a folder on a
different drive, and let it run. It’s capable and costs nothing. In exchange, you work
in text menus with no previews and sort through generically named files at the end.
Checked 18 November 2026 against CGSecurity’s official site and Homebrew’s formula page. Sources are linked in each section.
What PhotoRec is
PhotoRec is a file recovery program written by Christophe Grenier of CGSecurity. It’s released under the GNU General Public License, version 2 or later (CGSecurity). It comes in one download with TestDisk, its sister tool for repairing partitions. The current stable release is 7.2, from February 2024, and a 7.3 beta is in progress (download page).
PhotoRec ignores the card’s file system and looks for files in the raw data, so it works after a delete or a format, and on cards your Mac can’t mount. CGSecurity says it recognises more than 480 file extensions in about 300 file families (CGSecurity). That includes the camera formats photographers care about, such as CR2, CR3, NEF and ARW raw files, and MOV and MP4 video (format list).
It opens the source read-only, so the scan itself doesn’t change your card (CGSecurity).
How to install PhotoRec on a Mac
There are two official routes. Homebrew is easier and runs natively on Apple silicon.
With Homebrew (recommended)
Homebrew’s testdisk package is version 7.2 and has native builds for Apple silicon
(Homebrew). PhotoRec is built and installed
with it (TestDisk source).
-
If you don’t have Homebrew yet, install it with the command on brew.sh.
-
Open Terminal (Applications › Utilities) and run:
brew install testdisk -
Start it with
sudo photorec, as described below.
With CGSecurity’s download
The download page offers TestDisk and
PhotoRec 7.2 for Mac as an Intel 64-bit build for macOS 10.15 or later. The page notes that
M1 Macs can run the 7.3 beta. Unpack the archive, open Terminal in that folder, and run
sudo ./photorec.
How to recover photos with PhotoRec, step by step
Before you start: stop using the card, and have a destination with enough free space on a different drive or on your Mac. Don’t save recovered files onto the card you’re scanning. CGSecurity warns against writing to the same partition (CGSecurity).
The steps and menu labels below come from CGSecurity’s PhotoRec Step By Step guide (checked 18 November 2026). Its screenshots are from an older PhotoRec, so the screens on your Mac may look slightly different. Move around with the arrow keys and press Return to choose.
-
Connect the card, open Terminal and run:
sudo photorecPhotoRec needs administrator access to read the card directly. If you start it without
sudo, it asks to restart itself withsudo. Either way, type your Mac’s login password when Terminal asks for it. Nothing appears on screen as you type. -
Select the disk. Pick your card from the list. Check the size so you don’t pick the wrong drive, then press Return. If the card is listed twice, CGSecurity suggests the
/dev/rdisk…entry over/dev/disk…, because it’s faster. -
Select the partition. Choose the card’s partition. The menu at the bottom offers Search, Options and File Opt. To recover only photos and videos, open File Opt first and clear the file types you don’t need. Fewer types means fewer false hits to sort through later.
-
Choose Search.
-
Pick the file system type. Choose Other. That covers FAT32 and exFAT, which cameras use. Only an ext2, ext3 or ext4 (Linux) drive needs the other option.
-
Choose what to scan. [ Whole ] extracts files from the whole partition. Use it after a format or when the card is corrupted. [ Free ] scans only the unallocated space, so it finds only deleted files. CGSecurity lists it for FAT, NTFS and ext file systems, not exFAT, so on cards over 32 GB (SDXC cards, which use exFAT), choose Whole.
-
Choose the destination. PhotoRec asks whether to save recovered files in the folder it shows, with a [Y/N] prompt. Use the arrow keys to move to a folder on another drive (external drives are under
/Volumes) or on your Mac, then confirm with Y. -
Wait for the scan to finish. The count of recovered files updates as it goes, and a large card can take a long time.
What you get at the end
Open the destination folder in Finder. PhotoRec writes recovered files into numbered
subfolders, recup_dir.1, recup_dir.2 and so on, and you can open them before the scan
finishes (Step By Step).
The files inside have generic names. A recovered photo is called something like
f1234567.jpg: an f, a number for where the file started on the card, and the file
extension (PhotoRec 7.2 source). Thumbnails found inside photos are saved as
t….jpg, and if you chose to keep corrupted files, their names begin with b, for broken
(Step By Step). Sometimes PhotoRec can also add the original name, when it’s stored
inside the file itself, but most of the time it can’t
(PhotoRec FAQ).
The Step By Step guide suggests sorting the results by extension and by date. PhotoRec sets each file’s modification date from the photo’s own metadata when it can (Step By Step).
What PhotoRec does well
- It’s free, with no recovery limit and no upsell. It’s open source, too, so anyone can inspect the code.
- Broad format support. It recognises hundreds of file types, so it can also recover documents and other files that photo-only tools ignore.
- Read-only scanning. It doesn’t write to the card you’re recovering from.
- Runs everywhere. The same tool works on Mac, Windows and Linux.
If you’re comfortable in Terminal, or you need non-photo files back too, PhotoRec is a genuinely good choice.
Where PhotoRec gets awkward on a Mac
- Terminal only. On a Mac it runs in text menus driven by the keyboard. There’s a graphical version, QPhotoRec, but CGSecurity’s download page doesn’t list a Mac build (download page).
- No preview. PhotoRec writes everything it finds to the destination, and you sort through the results afterwards. You can’t pick the photos you want first.
- Generic file names. Recovered files are named
fplus a number for where each one was found on the card (PhotoRec 7.2 source), spread acrossrecup_dir.Nfolders (Step By Step). 2,000 recovered images means 2,000 names likef1234567.jpg. - Administrator access. You run it with
sudoand type your password into Terminal, which some people aren’t comfortable doing.
None of these are flaws in the recovery itself. They’re the cost of a free, cross-platform command-line tool.
When Shotback is the easier choice
Shotback is our app, so weigh this section accordingly. It’s a native Mac app for one job: recovering photos and videos from SD and other memory cards, USB sticks, external drives and disk images.
- Previews before you save. Scan, then browse everything it found as a grid of thumbnails, filtered by type, date or camera. The scan and preview are free. Previews are reduced and watermarked until you buy.
- Names that mean something. Files are named from the date and camera stored inside
them, like
2026-05-14_183022_Canon-EOS-R6.CR3, and can be sorted into folders by date. - A normal Mac app. No Terminal and no
sudo. You approve its read-only helper once in System Settings. - Pay once, only to save. One-time purchase, no subscription.
What PhotoRec does that Shotback doesn’t: it’s free, it recovers documents and hundreds of other file types, and it runs on Windows and Linux too. If you need any of that, use PhotoRec.
For more free options, including the Trash and Photos’ Recently Deleted album, see free SD card recovery on Mac. If the card itself is misbehaving, start with how to fix a corrupted SD card or SD card not showing up on Mac.
Frequently asked questions
Is PhotoRec safe to use on a Mac?
Yes, if you follow one rule. PhotoRec opens the card or drive read-only, so the scan doesn't change it. The risk is where you save: CGSecurity warns never to write recovered files to the same partition you're recovering from. Pick a folder on your Mac or another drive.
Does PhotoRec work on Apple silicon Macs?
Yes. Homebrew's testdisk package, which includes PhotoRec, has native builds for Apple silicon Macs on current macOS versions. CGSecurity's own Mac download of version 7.2 is an Intel build, and its download page notes that M1 Macs can run the 7.3 beta.
Is PhotoRec really free?
Yes. PhotoRec is open-source software from CGSecurity, released under the GNU General Public License (version 2 or later). There's no paid tier and no limit on how much it recovers.
Does PhotoRec have a Mac app or a graphical version?
Not for the Mac. On a Mac you run PhotoRec in Terminal and move through its menus with the arrow keys and Return. There's a graphical version called QPhotoRec, but CGSecurity's download page doesn't list a Mac build of it.
Why do my recovered files have strange names?
PhotoRec reads the card's data directly, not the file system that held the original names. It names each file with an f and a number for where it was found on the card, like f1234567.jpg, in folders called recup_dir.1, recup_dir.2 and so on. Thumbnails start with t and broken files with b. You'll need to sort them by type and date yourself.
What's the difference between TestDisk and PhotoRec?
They come together in one download. TestDisk repairs partition tables and recovers lost partitions. PhotoRec ignores the file system and recovers individual files, like photos and videos, from the raw data. For deleted or formatted photos, PhotoRec is the one you want.