Music metadata tags explained: ID3, Vorbis comments and MP4 atoms

Three tagging systems, one per container family, with a field-by-field mapping and an honest account of where the three disagree — which is why your tags look different in two applications.

A wall of pale wooden card-catalogue drawers in an archive, one drawer pulled open to show it packed tight with index cards.
Photo: Tima Miroshnichenko / Pexels

Every music file carries two kinds of information: the audio, and everything you know about the audio. The second kind is metadata, and it is stored inside the file in one of three systems, chosen by the container rather than by you.

  • MP3 files use ID3 tags, in frames identified by four-character codes: TIT2 for the title, TPE1 for the artist, TALB for the album.
  • FLAC and Ogg files use Vorbis comments, which are plain NAME=value text pairs: TITLE, ARTIST, ALBUM.
  • M4A and MP4 files use MP4 atoms, the iTunes vocabulary, with names like ©nam, ©ART and ©alb.

The three describe the same concepts and disagree about the details, and almost every tagging problem anyone has ever had lives in that disagreement. This is the reference for what maps to what, and where it breaks.

One album, three files, three tagging systems

track.mp3MP3 stream · ID3v2 tag

Shape Named frames in a block prepended to the audio, so a player reading a stream gets the tags first.

Names Fixed four-character codes from a published list. Anything else needs a TXXX frame with its own description.

Text Four possible encodings, including ISO-8859-1 and UTF-8. Multiple values are a null-separated list.

track.flacFLAC stream · Vorbis comments

Shape A metadata block of free-text pairs, alongside other blocks such as STREAMINFO and PICTURE.

Names Any printable name you like, case-insensitive. A short list is suggested; the rest is convention.

Text UTF-8, always. A field may simply appear more than once to hold several values.

track.m4aALAC or AAC · MP4 atoms

Shape Atoms inside the MP4 container's metadata box, alongside everything else the container holds.

Names Four characters, many with a leading ©. Extensions use a freeform atom, ----:com.apple.iTunes:Name.

Text Typed values — some atoms are text, some are numeric pairs, and cpil is a boolean.

The differences look cosmetic and are not. A system with typed numeric pairs stores "track 3 of 12" as two integers; a system with text frames stores it as the string 3/12; a system with free-text pairs stores it as whatever convention the writing application preferred. All three round-trip fine on their own and disagree the moment a file is converted.

Embedded tags versus filenames and folders

Two places hold information about a track, and only one of them survives contact with other software.

A vinyl record shot from directly above, its centre label a blank disc of teal paper with nothing printed on it.
On a record the label is where artist, title and year live, attached to the object itself. This one is blank — which is what an untagged file is, and why the folder it happens to sit in ends up doing the work instead. Photo: Dan Cristian Pădureț / Pexels.

Embedded metadata is inside the audio file. It travels with the file when it is moved, renamed, copied to a phone or handed to a different player, and it is what every modern player actually reads.

Filenames and folder structure are outside the file. They are useful — a sane Artist/Album (Year)/01 - Track.flac layout is worth having, and worth being consistent about — but they are a human convenience and a fallback, not a source of truth. Renaming a file changes nothing inside it. Which questions a folder tree answers that tags cannot is the other half of this distinction, and it is not the half most people expect.

There is a third place, and it is the one that costs people their work: a player’s own database. Star ratings, play counts and smart playlists that exist only in an application’s library file disappear with that application. If information matters over years, it belongs in the file.

The field mapping

The table below is the practical core of this article. Every row is one concept and how the three systems name it, following the mapping MusicBrainz Picard publishes and implements — which is as close to a lingua franca as this area has, because Picard has to write all three correctly.

ConceptID3v2.4Vorbis commentMP4 atomCaveat
TitleTIT2TITLE©namThe one field everybody agrees on
ArtistTPE1ARTIST©ARTMulti-value handling differs — see below
AlbumTALBALBUM©albMust match exactly across the record, punctuation included
Album artistTPE2ALBUMARTISTaARTThe field that holds a compilation together
Track numberTRCKTRACKNUMBERtrknID3 packs the total as 3/12; MP4 stores a numeric pair; Vorbis needs a second field
Disc numberTPOSDISCNUMBERdiskSame three-way split as track number
DateTDRCDATE©dayID3v2.3 used TYER plus TDAT; converters lose precision here
GenreTCONGENRE©genFree text everywhere in practice, despite ID3v1’s numeric list
ComposerTCOMCOMPOSER©wrtEssential for classical, ignored by most pop workflows
Compilation flagTCMPCOMPILATIONcpilTCMP is a non-standard but universally implemented frame
ArtworkAPICMETADATA_BLOCK_PICTUREcovrNative FLAC uses a PICTURE block instead — see below
MusicBrainz recordingUFID:http://musicbrainz.orgMUSICBRAINZ_TRACKID----:com.apple.iTunes:MusicBrainz Track IdThe only stable identity a track has
MusicBrainz releaseTXXX:MusicBrainz Album IdMUSICBRAINZ_ALBUMID----:com.apple.iTunes:MusicBrainz Album IdIdentifies the pressing, not just the album
ReplayGain track gainTXXX:REPLAYGAIN_TRACK_GAINREPLAYGAIN_TRACK_GAIN----:com.apple.iTunes:REPLAYGAIN_TRACK_GAINA convention rather than a standard; widely implemented

Two patterns are worth noticing in that table.

Where a concept has no native home, every system escapes into a generic mechanism. ID3 uses TXXX with a description, MP4 uses a freeform ----:com.apple.iTunes: atom, and Vorbis just invents a field name. This is why MusicBrainz identifiers and ReplayGain values look so different in each format: they are all extensions, expressed in three different extension mechanisms. The ReplayGain row is the clearest example of a tag written by software for software — a loudness measurement a player reads and applies at playback rather than anything a person types.

The numeric fields are the awkward ones. Track and disc numbers are the only common concepts where the three systems genuinely store different kinds of thing, which is exactly why they survive conversion badly.

The three systems, individually

ID3 — the MP3 one, with the longest history

An ID3v2 tag is a block of frames, and “the default location of an ID3v2 tag is prepended to the audio so that players can benefit from the information when the data is streamed”. Each frame has a four-character identifier and a payload.

Three details cause most real-world trouble:

Version. ID3v1 was 128 bytes at the end of the file with fixed-length fields, and truncated anything longer. ID3v2.3 and ID3v2.4 are the ones in use. They differ in ways that matter — date handling, multi-value support, the encodings they allow — and a tagger writing v2.3 for compatibility will represent some things differently from one writing v2.4.

Text encoding. ID3v2.4 permits four: ISO-8859-1, UTF-16 with a byte-order mark, UTF-16BE without one, and UTF-8. A tag written in ISO-8859-1 cannot represent most of the world’s names, and mojibake in an old library is almost always this.

Multiple values. In ID3v2.4, “all text information frames supports multiple strings, stored as a null separated list”. Earlier versions had no such mechanism, so applications invented separators — a slash, a semicolon, a comma — and disagreed. A track credited to two artists is the single most common place tags stop round-tripping cleanly.

For anything without a frame of its own there is TXXX, a user-defined text frame; multiple TXXX frames may exist provided each has a unique description. That is where ReplayGain values and most MusicBrainz identifiers live.

Vorbis comments — the FLAC and Ogg one, and the most permissive

A Vorbis comment is a list of NAME=value pairs, and the specification is unusually short because it specifies very little.

  • Always UTF-8. “Field contents … use the UTF-8 character encoding to allow easy representation of any language.” There is no encoding to get wrong.
  • Names are case-insensitiveARTIST, Artist and artist are the same field — and may contain any printable ASCII character except =.
  • A field may repeat. “Field names are not required to be unique (occur once) within a comment header”, so two artists are simply two ARTIST lines. This is the cleanest multi-value model of the three by a distance.
  • Almost nothing is mandatory. The specification proposes a short list — TITLE, VERSION, ALBUM, TRACKNUMBER, ARTIST, PERFORMER, COPYRIGHT, LICENSE, ORGANIZATION, DESCRIPTION, GENRE, DATE, LOCATION, CONTACT and ISRC — and then says that “no single or group of field names is mandatory”.

That permissiveness is the format’s strength and its one real weakness. Xiph’s own wiki puts the weakness plainly: “Although the syntax of VorbisComment is well-specified, various conventions exist for the field names in use.” Note what is missing from the proposed list above: ALBUMARTIST and DISCNUMBER, two of the most important fields in any library, are conventions rather than specification. So is the choice between TRACKTOTAL and TOTALTRACKS.

In practice the conventions have converged, and Picard’s mapping is the version almost everything implements. But “almost everything” is doing real work in that sentence, and it is why a field you can see in one tagger occasionally vanishes in another.

MP4 atoms — the M4A one, typed and Apple-shaped

.m4a, .m4b and .mp4 are all the MP4 container, and their metadata lives in atoms: four-character names, many prefixed with ©, inside the container’s metadata box.

The distinctive property is that values are typed. trkn and disk are numeric pairs rather than text, cpil is a boolean, covr holds image data. This makes MP4 metadata cleaner to parse and less forgiving to convert into: there is no way to write 3/12 into trkn as a string and hope for the best.

Extension works through freeform atoms of the form ----:com.apple.iTunes:Something, which is where MusicBrainz identifiers and ReplayGain values go, exactly as TXXX serves that role in ID3.

The vocabulary is narrower than ID3’s and much narrower than “anything you like”, which is one of the practical arguments in the FLAC versus ALAC decision for anyone who expects to script over their library.

Artwork is stored differently again

FormatWhere the image goes
MP3An APIC frame inside the ID3v2 tag
FLACA PICTURE metadata block, type 6 — a native block, not a comment
Ogg VorbisA METADATA_BLOCK_PICTURE comment holding a base64-encoded FLAC picture structure
MP4 / M4AA covr atom
Any of themA cover.jpg or folder.jpg beside the tracks, read as a fallback

Which of those two to use, what each costs in bytes, and why the same album shows different art in different applications is the artwork storage question in full.

The Ogg case is the odd one and worth understanding, because it explains an error people meet. Xiph’s own documentation describes the mechanism directly: “The binary FLAC picture structure is base64 encoded and placed within a VorbisComment with the tag name METADATA_BLOCK_PICTURE.” Base64 is valid UTF-8, so it obeys the rules for comment data. In a native FLAC file, though, the right place is the PICTURE block — and a FLAC file carrying artwork as a base64 comment instead has been known to upset implementations that were not expecting it.

Whichever convention you choose, choose one. A library where half the albums have embedded art and half have a sidecar will show you gaps that are not really gaps, depending on which player you opened.

Where the three systems actually disagree

This is the section to come back to when something looks wrong.

ProblemWhat is happening
Two artists became one stringID3v2.4 uses null separators, Vorbis repeats the field, MP4 has its own handling. Converting flattens the structure into whatever separator the writer chose
The track total vanishedTRCK carries 3/12 as text, trkn carries a numeric pair, Vorbis needs a separate TRACKTOTAL or TOTALTRACKS field — and the two names are both in use
A compilation exploded into forty albumsAlbum artist is empty, so players fell back to the track artist. TPE2 / ALBUMARTIST / aART is the field that prevents it
The release date lost its monthID3v2.3 split date across TYER and TDAT; ID3v2.4 unified it in TDRC. Converting downwards discards precision
Accented characters turned into symbolsAn ID3 tag written in ISO-8859-1 and read as something else. Vorbis comments cannot have this problem, because they are always UTF-8
A field is visible in one tagger and not anotherAlmost always a Vorbis field name that is convention rather than specification, or a TXXX / freeform atom the other application does not map
FLAC tags that half the software cannot seeAn ID3 block attached to a FLAC file. Move the values into Vorbis comments and remove it

The pattern behind all seven: the systems are equally capable and unequally opinionated. Anything that has to survive a conversion should be one of the plain, universally implemented fields, and anything clever should be somewhere you are willing to lose.

What a player does with all this

A library application reads whichever system the container uses and reconciles the three into one model — which is where the disagreements above stop being trivia and start being your album list.

Digr reads tags locally with lofty: title, artist, album, year, genre, disc and track number and duration, from all seven containers it indexes, with no lookup service contacted and nothing about your library leaving the machine. Album identity is keyed on album artist, which is the decision that keeps a compilation as one record rather than forty. Artwork comes from inside the file or from a sidecar image beside it, whichever exists, handled per directory rather than per track.

A detail of the Digr library view: a watched folder marked Drive connected, above four tiles reading Recently Added, Missing Artwork, Unknown Artist and Unknown Album, each with a count.
Two of these tiles are metadata failures with a count on them. Unknown Artist and Unknown Album are what an empty TPE1 or TALB looks like once it reaches a library — which is the argument for fixing tags at import rather than discovering them by browsing.

One thing Digr does not do today: write. Scanning opens your audio files to read tags and artwork and never modifies them, so nothing above can be corrected from inside the application. Explicit, reviewable, undoable tag editing — with a MusicBrainz lookup that proposes rather than imposes — is a 3–6 month roadmap item, planned as part of Digr Free. Until then the fixing happens in a tagger, and MusicBrainz Picard is the one that writes all three systems correctly — in the order that lets you find out which of seven things is wrong first, because a display that disagrees with a file is not always a file that is wrong.

The short version

Three systems, one per container family, describing the same concepts with different names, different type systems and different ideas about how much should be specified. ID3 is the oldest and the most versioned. Vorbis comments are the simplest and the least standardised. MP4 atoms are the most typed and the narrowest.

Fill in the plain fields, get album artist right, keep everything in the file rather than in a player, and expect the clever fields to be the ones that do not survive a conversion.

Sources

Common questions

What metadata is stored in an MP3?

ID3 tags, almost always ID3v2, held in frames identified by four-character codes at the start of the file. TIT2 is the title, TPE1 the artist, TPE2 the album artist, TALB the album, TRCK the track number, TPOS the disc, TDRC the recording date, TCON the genre and APIC the embedded artwork. Anything without a defined frame goes into a TXXX user-defined frame with a unique description.

What is the difference between artist and album artist?

The artist field names who performed a track; the album artist field names who the record is filed under. On a compilation, every track has a different artist and one album artist, usually Various Artists. It is stored as TPE2 in ID3, ALBUMARTIST in Vorbis comments and the aART atom in MP4 — and when it is empty, most players fall back to the track artist, which is how one compilation becomes forty one-track albums.

Can FLAC use ID3 tags?

Some software will physically attach an ID3 tag to a FLAC file, but it is not part of the format and support for it is poor. FLAC uses Vorbis comments, which the FLAC documentation describes as the only tagging system required and guaranteed to be supported. A FLAC file carrying ID3 tags is a file whose metadata half your tools will not see, so the right fix is to move the values into Vorbis comments and remove the ID3 block.

Where is album artwork stored in a music file?

In a dedicated place per format. ID3 uses an APIC frame, MP4 uses the covr atom, and native FLAC uses a PICTURE metadata block. In Ogg Vorbis the convention is a base64-encoded FLAC picture structure placed in a Vorbis comment named METADATA_BLOCK_PICTURE. Artwork can also sit beside the tracks as a cover.jpg, which most players read as a fallback — pick one convention and apply it everywhere.

What metadata format does an M4A file use?

MP4 atoms, the iTunes-style metadata vocabulary, because .m4a is an MP4 container. Field names are four characters, many prefixed with a copyright sign: ©nam for title, ©ART for artist, aART for album artist, ©alb for album, trkn for track number, disk for disc number. Anything outside the defined set goes in a freeform atom named ----:com.apple.iTunes:Something.

Does renaming a music file change its embedded metadata?

No. Embedded tags live inside the file and are unaffected by its name or its folder. That is exactly why tags are the durable place to keep this information: renaming, moving or reorganising cannot touch them. The reverse is also true — correcting a tag does not rename the file, unless you asked a tagger to rename it from the corrected tags.

  • metadata
  • ID3
  • Vorbis comments
  • MP4 atoms
  • album artist
  • MusicBrainz
  • ReplayGain