How to Find and Remove Duplicate Files Safely (Without Losing Originals)
Why duplicate files pile up, how content hashing finds copies with different names, and a careful way to clean them up without deleting the wrong file.
&c=%230e7490&k=developer)
Most computers carry gigabytes of files they do not need: the same holiday photos imported twice, a downloads folder with five copies of one installer, a project duplicated as "project backup" and "project final". Disk cleanup tools find temporary files, but they rarely touch your own documents and photos, because deleting the wrong one would be a disaster. This guide explains how duplicates are found reliably and how to clean them up in a way you can undo.
Why names and dates are not enough
Two files called report.pdf may be completely different, and IMG_2041.jpg and IMG_2041 (1).jpg are often the same picture. Dates are no better: copying a file can reset its modified time, and syncing services rewrite them. The only dependable test is the content itself, byte for byte.
Reading every byte of every file twice to compare them would be slow. Instead, a duplicate finder uses a fingerprint called a hash. SHA-256 turns any file into a 64-character code. If two files produce the same SHA-256 code, they contain the same bytes; no two different files have ever been found to share one.
Size first, hash second
There is a faster shortcut before hashing: two files of different sizes cannot be identical. Grouping by exact size usually rules out more than 85 percent of files without opening them. Only the files that share a size need a hash, and even then a quick hash of a few samples from the start, middle and end of each file weeds out most of the rest. The full hash is computed only where the samples match.
Finding duplicates step by step
The Duplicate File Finder runs in your browser and does this for you.
- Add the folders. Pick a folder such as Pictures. To find copies across places, add a second folder, for example a phone backup or an external drive.
- Narrow the scan. Ignore files under a certain size, skip hidden system files, or limit the search to extensions like jpg, heic and mp4.
- Decide which copy to keep. The oldest copy is usually the original. You can also keep the shortest path, or type a folder name that should always win.
- Run the scan. Watch the counter. Files with a unique size are skipped, so the scan reads far less than the total.
- Review each group. Every group shows the copies, their dates and a preview for images. Change the keeper or untick a copy you want to leave alone.
- Export. Download a CSV report, and a script for Windows (PowerShell) or macOS and Linux (Bash).
Why it moves instead of deleting
A web page is not allowed to delete files on your disk, and that is a good thing here. The script the tool writes moves each extra copy into a folder called _duplicates inside the scanned folder, keeping the sub-folder structure. Nothing is deleted. Open your photo app and documents for a week. If everything you need is still where you expect it, delete the _duplicates folder yourself. If something is missing, the full path inside _duplicates shows where it came from.
Before running any script, open it in a text editor. Each line is a plain move command with the old and new path, so you can check what will happen.
Special cases
Very large files. Videos over 512 MB are compared by size and three 1 MB samples, not a full hash, to keep memory use down. They are marked "sampled". Such matches are almost always real, but play both files before removing one.
Cloud folders. If a folder syncs with OneDrive, iCloud or Google Drive, moving files is synced too. That is usually fine, but make sure the service has finished syncing before you start, so you are not comparing placeholders.
Similar but not identical photos. An edited, resized or re-saved photo has different bytes and will not be matched. That is deliberate: exact duplicates are safe to remove without looking, near-duplicates are not.
Program and system folders. Keep the scan to your own documents, photos, music and downloads. Applications sometimes keep identical files in several places on purpose, and moving them can break the program.
How much space to expect
Photo libraries that were imported from a phone more than once commonly hold 10 to 20 percent duplicates. Downloads folders often do better, because the same installer or PDF was fetched again instead of looked for. The summary shows the space you can free before you change anything, so you can decide whether the cleanup is worth it.
A simple routine
Run a scan after each phone backup or before buying a bigger drive. Keep one master photo folder and import into it only, and let the keeper rule protect it. With the move-not-delete script, cleaning up becomes a five-minute job you can always reverse.


&c=%23c2410c&k=education)
