Making Track Numbers permanent (or any other unique ID)

I need a way to create a permanent and unique identifier for every track I have. This would allow me to edit/update tags and then re-upload them into a third party program that will merge the changes with the existing data it holds.

I've looked at the auto numbering feature as it currently seems to be, and it is great, but it is very vulnerable to accidentally being overwritten, and if I've added/deleted/changed tracks in the meantime, a new numbering will not match the old one and would destroy the data in my music selection program.

I know there are ways to carefully append new numbers to new tracks, but I also know that sooner or later I'll make a mistake and end up accidentally overwriting the numbers.

Can anyone suggest a way to create permanent and unique IDs for each track. They don't need to be numbers, they can be anything at all, but they absolutely must be unique and must be permanent.

Many thanks for any thoughts and suggestions (and happy 2023!)


I do not think that you can create any tag field that is permanent - as you can edit and change it.
The track numbering assistant allows you to create numbered sequences by more or less any field. But as you wrote: you would have to take care to choose the correct starting value.

What about the creation time raw value which is a decimal number?
That should be fairly unique.

Hi, many thanks for your idea.

To clarify, as regards "permanent", I simply mean a field that wouldn't be easily programmatically overwritten en masse for all values. You're right, just about all fields seem to be editable!

Your suggestion about creation time seemed excellent, but alas, it only resolves to the second, and I've many times got files that were both created on the same second (I guess this is due to multiprocessing of the ripping). See screenshot.

This assumes I'm using the correct tag field, of course. I found two in the information settings, one for a formatted date/time, the other for a raw, but neither has fine enough resolution.


I also checked the acoustic fingerprints and IDs, but I don't seem to have many values in those fields.

If you've any other ideas, that would be very much appreciated, of course!

I thought that you would copy that value to a user-defined field and then perhaps append the field with a random number - like that it is still sortable and I doubt that 2 files that have been created at the same time then also get the same random number.
But this field - just like any other, could easily be overwritten or get deleted. There is no safeguard for that.
I could think of an action like Format Vlaue for ID_FIELD
Format string: %_file_create_datetime_raw%_$rand()

Using the current field information, you could append the disc and track number info onto the end of the creation time raw value. This would solve the problem you mention of several created on the same second when processed. You can create a custom field for this to try and avoid having other software from changing it, but the trade off is that this value will only be useful to you in a program like mp3tag.

But as @ohrenkino has already mentioned, any field that can be created can also be overwritten with new data. There is no way to lock this. So care must be taken when making any changes to this field.

I think you two gentlemen between you have created a great concept. A field with both the datetime created and the length of the track. That seems like an almost certain to be unique value, and I can further test it to confirm, of course.

I'm not exactly sure how to do this, though! :sleepy:

So I create a new field into which I make a computed value adding datetime and length? Could you tell me what the format string should be? That would be much appreciated, thank you.


I think the general procedure is already outlined here:

probably with the modification
Format string: %_file_create_datetime_raw%_%_length_seconds%

Just a note to other users reading this topic:

The creation date of a file will be changed on a copy of the file too, because Windows does not preserve the "Created date" in the copied file.
If you backup your files, the files in the target have no more the same %_file_create_datetime_raw%.
You would have to adjust this date manually from the original file with specialized tools (or maybe an option in the backup/synchronization software).

Another idea for a unique identifier could be:

this would also show if the audio part of two songs would be identical.

Actually, I would have thought that the ID-field would only be filled once in a lifetime of a file and from then on it would not matter what the real property looks like.
I only suggested the creation date as this would be fairly unique (with only very few exceptions as we found out) and also show an incremented ID (as time marches on) so that you could even sort by that ID.

I still wonder which program should do something with this ID ... I hardly know any player or media center that handles user-defined fields.

any player or media center that handles user-defined fields.

Foobar2000 can use any custom fields for scripting purpose, no? I'm using MusicBee which can do the same, and suppose there are others as well.

As a secret desire I always want to see Mp3tag implementing $md5() hash, as it can reveal invisible characters in tags which is problematic to clean up, as well as for track grouping purpose when a concatenation of multiple fields can be noisy.

MP3tag allows to create an md5 hash in export.
See the documentation:

I know.
I still think that the purpose of this thread is to find a solution for the unique number and that also requires (IMHO) to find out the target system's features so that the best place for the ID can be found.

MP3tag allows to create an md5 hash in export

Sorry I didn't make it very clear, what I mean is a script function that can take in any content (such as tag value), instead of audio/file hash.

But you are right about keeping on topic. I'll open a new one when needed.

Hi, concatenating works, I'd also been thinking of adding the one value to the other. :grinning: That would make it easier to test the uniqueness, with a single value to then compare.

Yes to the filling it in once, but would the definition string for the new field re-evaluate every time the file was opened?

The program I'm planning to use this with is Power Gold. It suffers from a huge weakness - a disconnect between the files and their tags and its internal logic for what it does with them, so either needs a locked down unchanging set of files or unique identifiers for each track.

That's an interesting idea thank you; alas I use FLAC files so it doesn't work so well.