Joel Verhagen

a computer programming blog

How iTunes Uses ID3 Tags

A little terminology before you read:

  • ID3 - the most commonly used way to add meta information to MP3 files (i.e. song title, artist name, album artwork, etc.)
  • frame - a specific "box" of information in ID3

Also note that the version of iTunes I am currently running is 10.1.0.56 on Windows. This information might change slightly as iTunes matures, a.k.a. it's size and speed becomes more and more akin to a humpback whale.

I've always wondered how iTunes writes song information to the file... so I took a MP3 file with no tag information (I created it in Audacity. It was a recording of me sneezing) and opened it up in iTunes and added every possible field. Then I ran the MP3 file through a little program which is part of the TagLib source code (it's the test program called framelist). I've learned a few interesting things.

First, iTunes writes tags to MP3 files using ID3v2.2 tags. After a bit of research, it looks like ID3v2.2 tags are considered deprecated. See this link on id3.org for more information.

Second, iTunes completely blows the ID3v2.2 standard out of the water. By that I mean it doesn't follow the rules AT ALL. For example, it uses the TPE1 to hold the Artist information. ID3v2.2 doesn't even have that frame! This frame was introduced in ID3v2.3!

Third, they use some made up tags that aren't outlined in any official ID3 document, such as the TCP frame (used to say whether the file is in a compilation album).

Here are all the discoveries I have made concerning which ID3v2 tags go with which form field in iTunes' tag editor.

iTunes Tag SectioniTunes Tag FieldID3v2 Tag FieldNotesID3 Compliance
Info / SortingNameTIT2ID3v2.3 ID3v2.4
Info / SortingArtistTPE1ID3v2.3 ID3v2.4
Info / SortingAlbum ArtistTPE2ID3v2.3 ID3v2.4
Info / SortingAlbumTALBID3v2.3 ID3v2.4
Info / SortingGroupingTIT1ID3v2.3 ID3v2.4
Info / SortingComposerTCOMID3v2.3 ID3v2.4
InfoCommentsCOMMID3v2.3 ID3v2.4
InfoGenreTCONID3v2.3 ID3v2.4
InfoYearTDRC1ID3v2.3 ID3v2.4
InfoTrack NumberTRCK2ID3v2.3 ID3v2.4
InfoDisc NumberTPOS3ID3v2.3 ID3v2.4
InfoBPMTBPMID3v2.3 ID3v2.4
InfoPart of a compilationTCP or TCMP4none
VideoDescriptionTIT3ID3v2.3 ID3v2.4
SortingSort NameTST or TSOTnone
SortingSort ArtistTSA or TSOAnone
SortingSort Album ArtistTSP or TSOPnone
SortingSort AlbumTS2 or TSO2none
SortingSort ComposerTSC or TSOCnone
OptionsPart of a gapless albumCOMM5ID3v2.3 ID3v2.4
LyricsUSLTID3v2.3 ID3v2.4
ArtworkAPIC6ID3v2.3 ID3v2.4
(hidden)COMM7ID3v2.3 ID3v2.4
(hidden)COMM8ID3v2.3 ID3v2.4
(hidden)COMM9ID3v2.3 ID3v2.4
(hidden)TENC10ID3v2.3 ID3v2.4
(hidden)UFID11ID3v2.3 ID3v2.4
  1. In the official ID3 documents, this field is described as a timestamp, but in MP3 you find floating around, you'll rarely find anything more specific than the year of publication.
  2. This can include just the track number, or the track number with the total number of track on the album. If both are present they are separated by "/".
  3. See the previous note.
  4. It seems this tag is completely made up by iTunes.
  5. Comment description: "iTunSMPB". This value is either a 0 or 1, determining whether or not the track is part of a gapless album.
  6. Multiple APIC entries are made as you more artwork is added. They are all set to type 0 (other).
  7. Comment description: "iTunNORM". I believe this is automatically generated by iTunes to normalize track volume.
  8. Comment description: "iTunSMPB". I don't know what this field means.
  9. Comment description: "iTunes_CDDB_IDs". I am also not sure what this field is for. See this link for some details.
  10. When you rip a CD directly to MP3 in iTunes, the TENC field is filled with the version of iTunes that encoded the MP3, i.e. "iTunes 10.1.0.56"
  11. Also when you rip a CD directly to MP3 in iTunes, the UFID has the URL "http://www.cddb.com/id3/taginfo1.html" set as the owner and a alphanumeric hash as the identifier (most likely the Gracenote ID).

The following fields that you can apply to a track in iTunes are not stored in the file and are not maintained if you move the MP3 file in question to another iTunes library: Show, Season Number, Episode ID, Episode Number, Sort Show, Volume Adjustment, Equilizer Preset, Media Kind, Rating, Start Time, Stop Time, Remember playback position, and Skip when shuffling.

If you have any questions or have any of your own discoveries, feel free to comment back!