Duplicate Song Finder
Operator: Abdulla Al Fahad. How tools are built and checked
A music library merged from three old drives ends up with the same song under different names: Track 04.mp3, 04 - Night Drive.m4a and a FLAC rip in another folder. Comparing file names finds none of them, and comparing file sizes finds none either, because the encodes differ. This page compares the sound itself, together with the tags, over the first two minutes of each song, then groups the matches, suggests which copy to keep and writes a list of the others. It never deletes or renames anything.
Key features
- A folder, or a hand-picked set of up to 5,000 MP3, M4A, FLAC, WAV, OGG, OPUS or AAC files, each up to 300 MB and 45 minutes
- Matching by tag (artist and title) and by an acoustic fingerprint, switched on or off separately
- Groups with a similarity percentage, and format, bit rate, length and size for every file
- A suggested keeper in each group that you can change, and an A and B audition that continues from the same point in the other copy
- A CSV of the groups and a text list of the paths not chosen as keepers
How two files are judged to be the same recording
Tags are read from MP3 (ID3v2) and FLAC files. For other formats, and for files with no tags, the artist and title come from a file name in the form "Artist - Title", with a leading track number dropped. Two files match on tags when their artist and title agree after accents, case and punctuation are removed, a bracket containing feat, remaster, live, version, mix, edit or bonus is ignored, and their lengths are within 15% of each other.
A file over 300 MB, longer than 45 minutes, or that the browser cannot decode is listed as skipped with the reason, and the scan goes on. Files in folders are shown with their path inside the folder you chose, and the CSV and removal list use the same path.
The CSV has one row per file with the group number, keep or remove, path, format, bit rate, seconds, bytes, similarity to the keeper, what matched (audio, tags or both), artist and title. A title or path that starts with = + - or @ is written with a leading apostrophe, so opening the CSV in a spreadsheet cannot run it as a formula. The removal list has one path per line.
How it works
Each song is decoded, mixed to mono and resampled to 11,025 Hz, and the first 120 seconds are cut out. The length is read from the file before decoding, and a song over 45 minutes is skipped without being loaded.
The fingerprint is written for this page; it is in the style of Chromaprint but is not Chromaprint and does not match its fingerprints. The audio is cut into frames of 4,096 samples every 1,365 samples, about 8 per second, and each frame's energy is folded into 12 pitch classes between 65 and 2,000 Hz. One 32-bit number per frame records how the twelve values compare with their neighbours in time and in pitch class, which gives about 970 numbers for 120 seconds.
To find candidates without comparing every pair, each 32-bit number is split into two 16-bit halves and put into an index. Two encodes of one recording share many halves at the same time offset, and unrelated songs almost never do. A pair needs at least 8 matching votes at one time offset to be examined, and the offset is then checked a few frames either way.
A candidate is then compared over the overlap, at least 20 seconds or 60% of the shorter song, counting the differing bits. The similarity is 100 times one minus twice the bit-error rate, so identical prints give 100% and random ones give about 0%. Pairs at or above the slider's value, 60% by default, are joined, and a file linked to two others joins all three into one group.
Common use cases
- Two drives copied into one folder are scanned in a single pass, then the CSV is sorted by group in a spreadsheet and the removal list is checked against a backup.
- A listener finds a 128 kbps MP3 and a FLAC of one track in different folders, keeps the lossless file and removes the other.
- A DJ scans a crate of 400 files for the same track under two spellings of the title, with sound matching switched off and tag matching on.
- A family archive of 80 digitised tapes finds the same recording twice with an offset of a few seconds, because one copy started later.
- A 6,200-file collection is cut into two folders first, because the limit is 5,000 files per scan.
How to use this tool
- Choose a folder, or select files, and wait while each song is read; the bar shows an estimate.
- Raise or lower the similarity setting, and switch tag matching or sound matching off if one is too eager.
- Press Play B on a group to hear the second copy from where the first one was, and change the keeper if you disagree.
Example
Illustrative folder: musiclib holding Aurora - Night Drive.wav, sub/night drive (copy).wav (a copy at 70% volume with background hiss), Borealis - Glass.wav, a damaged .mp3 and readme.txt
Choose the folder, leave the similarity at 60%What the page would report
1 group, matched by sound, similarity 86%: keep Aurora - Night Drive.wav, remove sub/night drive (copy).wav (1.68 MB)
Borealis - Glass.wav matches nothing; the damaged .mp3 is listed as skipped; readme.txt is ignored as not audio
duplicate-songs.csv has two rows for the group: 1,keep,... and 1,remove,... with 86 in the similarity column
files-to-remove.txt contains one line: musiclib/sub/night drive (copy).wavCommon pitfalls
Only the first two minutes are compared. Two versions that share an intro but then differ, such as a radio edit and an extended mix, can be reported as the same song.
Fingerprints compare harmony over time, so a live take, a remix or a cover with different timing is expected to score low. The page does not claim to find them.
Tag matching trusts the tags. Two different songs with the same artist and title, such as covers titled alike, are grouped if their lengths are within 15%.
Tags in M4A, OGG and WAV files are not read. They are matched by file name and by sound.
- The scan keeps every pair down to 40% similarity, so moving the slider between 40% and 95% regroups the results at once, with no new scan. Try 45% when noisy transfers seem to be missing.
- Audition the group with the lowest similarity first. If those two are the same song, the groups above it are the same too.
Common errors and how to fix them
- None of the 41 files in the folder is MP3, M4A, FLAC, WAV, OGG, OPUS or AAC audio
- Choose the folder that holds the music, or select the files directly.
- 4 files are listed as skipped: longer than 45 minutes, over 300 MB or could not be decoded
- Audio books and DJ mixes are skipped by design. For a file that could not be decoded, convert it to MP3 or FLAC and scan again.
- 5,800 audio files were chosen; only the first 5,000 are scanned
- Run the rest as a second batch from a separate folder.
Best practices
- Scan a copy of the library or have a backup before deleting anything from the removal list, and open a few paths to check before removing them in bulk.
What the similarity percentage means
The percentage is a measure of how many bits of the two fingerprints agree, rescaled so that unrelated music is about 0%. On generated tones, a copy at 80% volume with a little noise and a 0.1 second offset scored 83%, a low-passed copy with more noise 79%, the same tone starting 5 seconds later 70%, and different tones between 3% and 7%.
Generated tones have clean harmonics and are not real MP3 encodes, so these figures show the shape of the scale and are not a promise about your files. The 60% default sits well above unrelated music and still accepts recordings that differ.
Speed and the worker pool
Decoding runs in the page, three songs at a time, and the fingerprint arithmetic runs in up to four workers, one fewer than the computer's processor cores. Larger libraries take longer in proportion; leave the tab open until the bar finishes.
Frequently asked questions
Will it find a duplicate of a photo or a document?
No, this page reads audio only. Photos are handled by Duplicate Photo Finder.
Why is a lower bit rate file sometimes suggested as the keeper?
The keeper score puts lossless files first, then the higher bit rate, then the file with more complete tags, then the longer one. A longer lower-rate file wins only when the others tie on format and rate, and you can change the choice in each group.
Does it fix the tags of the files it finds?
No. Audio Tag Editor edits tags; this page only reads them to help match.