How Musical Key Is Stored in Your Music Files
When a DJ app shows "8A" next to a track, that value came from somewhere: either the app's own database or a tag embedded inside the audio file. Knowing which one — and how each file format stores it — is what decides whether your keys follow your music from laptop to USB stick to a different DJ app, or silently vanish along the way. This is a plain-English reference to ID3, Vorbis and MP4 key tags, and how the major DJ applications treat them.
Updated 29 September 2026 · ~9 minute read · Maintained by the OpenKeyScan team.
In one paragraph
Musical key lives in a text field inside each file's metadata. In MP3 and AIFF it is the ID3v2 TKEY ("Initial key") frame. In FLAC, OGG and Opus it is a Vorbis comment, usually named INITIALKEY or KEY. In M4A/AAC it is a freeform MP4 atom, conventionally ----:com.apple.iTunes:initialkey. Plain WAV has no reliable key field. The value is just text — "Am", "8A", "1m" or "A minor" — and each DJ app parses it on import, then caches it in its own database. Keys written into the file travel everywhere; keys that exist only in one app's database do not. That is why OpenKeyScan writes its results straight into the file tags.
Two places a key can live: the file or the database
Every DJ application keeps a library database: Rekordbox has its collection database, Serato has its _Serato_ folder, Traktor has collection.nml, Engine DJ has its Engine Library database and VirtualDJ has database.xml. When the app analyzes a track, the result lands in that database first. Whether it is also written into the audio file is a separate decision, and the apps disagree about it.
The distinction matters more than it sounds. A key that exists only in a database is tied to one app on one computer. Switch from Serato to Rekordbox, move to a new laptop, or hand a USB stick to a friend on a different setup, and that key is gone — the new app sees an empty field and re-analyzes with its own detector, often producing a different answer. A key stored in the file itself is read by every app that imports it.
Key in the file tag
- Travels with the file across apps, computers and backups.
- Readable by taggers such as Mp3tag, Kid3 and MusicBrainz Picard.
- One source of truth you can verify and fix once.
Key in an app database
- Fast to search and sort inside that app.
- Invisible to every other app and tool.
- Lost or re-detected when you migrate or rebuild the library.
MP3 and AIFF: the ID3 TKEY frame
ID3v2 is the tagging format used by MP3 files, and AIFF files carry the same ID3v2 tag inside an ID3 chunk. The ID3v2.3 and ID3v2.4 specifications define a text frame called TKEY, officially titled "Initial key" — the key the track starts in. The older ID3v2.2 format calls the same field TKE. The original ID3v1 tag, the fixed 128-byte block at the end of old MP3s, has no key field at all.
The specification is strict about the value: at most three characters, a note letter A–G, an optional b or #, and an optional m for minor — so "Am", "F#m", "Bb" or "C". A single "o" means the track is off-key (atonal). Reality ignored that rule long ago. Because harmonic mixing tools popularized wheel notations, you will find TKEY values like "8A", "1m", "A minor", "Abm", "G#m" and "08A" in the wild, and DJ software has learned to parse most of them.
Two related habits are worth knowing about. First, some tools — Mixed In Key is the best-known example — can also write the key into the Comment (COMM) field or prepend it to the title, such as "8A - Track Name". That was a workaround for apps and CDJs that did not display TKEY; it still works, but it clutters your titles and duplicates the key in a place nothing validates. Second, Serato stores its own analysis data in private GEOB frames inside the ID3 tag. Those frames are Serato-specific; other apps ignore them, which is why the standard TKEY frame is the one that matters for portability.
FLAC, OGG, M4A and WAV: every format at a glance
Outside ID3, there is no single official key field — only conventions that the DJ and tagging world converged on.
FLAC, OGG Vorbis and Opus use Vorbis comments: free-form NAME=value pairs. The Vorbis comment spec suggests common names like TITLE and ARTIST but nothing for key, so two names coexist. INITIALKEY mirrors the ID3 frame title and is widely used by DJ-oriented tools; KEY is what MusicBrainz Picard and several general-purpose taggers write. Well-behaved software reads both. If you tag by hand, writing the same value to both fields costs nothing and removes the guesswork.
M4A and AAC files use MP4 metadata atoms. Apple never defined a key atom, so the convention is a freeform atom named ----:com.apple.iTunes:initialkey. Apple Music and iTunes do not display it, which surprises people who build playlists there and export to DJ software — but DJ apps and taggers read it. WAV is the awkward one: its native INFO chunk has no key field, so tools embed an ID3 chunk, and whether a given DJ app reads that chunk depends on the app and version.
| Format | Tag system | Key field | Portability |
|---|---|---|---|
| MP3 | ID3v2.3 / v2.4 | TKEY ("Initial key") | Excellent — read everywhere |
| MP3 (legacy) | ID3v2.2 / ID3v1 | TKE / none | Poor — upgrade the tag to v2.3+ |
| AIFF | ID3v2 in an ID3 chunk | TKEY | Excellent for lossless |
| FLAC | Vorbis comments | INITIALKEY and/or KEY | Good — write both names |
| OGG / Opus | Vorbis comments | INITIALKEY and/or KEY | Good, but format support in DJ apps varies |
| M4A / AAC / ALAC | MP4 atoms | ----:com.apple.iTunes:initialkey | Good in DJ apps; hidden in Apple Music |
| WAV | RIFF INFO + optional ID3 chunk | TKEY in ID3 chunk, if present | Unreliable — prefer AIFF or FLAC |
What goes inside the tag: notation choices
The tag stores text, not a number, so the notation you choose is literally what gets written. All four styles below describe the same key, A minor. The Open Key vs Camelot guide covers which notation is easier to mix with; here the question is which one parses cleanly everywhere.
| Style | Tag value | Trade-off |
|---|---|---|
| Traditional (spec-compliant) | Am | Most universally parsed; every DJ app can convert it to its display notation. |
| Camelot | 8A | Readable at a glance in any tagger; recognized by most DJ apps, shown raw by media players. |
| Open Key | 1m | Traktor's native display notation; same caveats as Camelot elsewhere. |
| Long form | A minor | Unambiguous for humans; not spec-compliant and parsed less consistently. |
Watch out for three small inconsistencies that break sorting and filtering:
- Enharmonic spelling. G#m and Abm are the same key (Camelot 1A). If half your library says one and half says the other, a text sort splits them apart. Pick one convention and stick with it.
- Unicode symbols. "F♯m" with the real sharp sign (♯) is not the same string as "F#m" with a hash. Some parsers accept both; others fail silently and show a blank key.
- Zero padding. "08A" sorts correctly as text; "8A" sorts after "12A". Some tools pad to fix sorting, which in turn confuses parsers expecting "8A". Most DJ apps sort by musical key rather than raw text, so padding is rarely needed.
How each DJ app reads and writes key tags
All five major DJ applications read an existing key tag when a track is imported. Where they differ is what happens to their own detection results. Behavior can change between versions, so treat this as the general pattern and check your app's preferences.
Rekordbox
Reads TKEY on import and keeps its own analysis in its library database. By default it does not write the key it detects back into your files, so Rekordbox's keys stay inside Rekordbox and exported USB drives. Full details are in the Rekordbox key detection guide.
Serato DJ
Stores a lot of its data in the file itself: the key goes into the standard key tag, alongside Serato's private GEOB frames for beatgrids and cues. That makes Serato keys portable, but it also means Serato's detection can overwrite a key you wrote earlier if you re-analyze. See the Serato guide.
Traktor Pro
Keeps two columns: Key, from its own analysis, and Key Text, the text read from the file's tag. Traktor can write its detected key into the file when tag writing is enabled. The two columns disagreeing is the most common source of Traktor key confusion — more in the Traktor guide.
The practical upshot: the file tag is the only place all five apps agree to look. If you want one set of keys shown identically across Rekordbox, Serato, Traktor, Engine DJ and VirtualDJ, the key has to be written into the file by a tool you trust — then each app reads it rather than guessing.
Why a new key tag does not show up (and other gotchas)
- The app cached the old value. DJ software reads tags at import and then trusts its database. After re-tagging, use the app's "reload tags" or "read metadata from file" option, or remove and re-import the track. Re-running the app's own key analysis does the opposite of what you want — it replaces the tag value with its own guess.
- Two tools are fighting over the tag. If Serato re-analyzes a folder after another analyzer tagged it, the last writer wins. Decide which tool owns the key, and turn off automatic key analysis (or overwrite) in the others.
- The tag version is too old. Files still carrying only ID3v1 or ID3v2.2 tags may not show a key anywhere. Re-saving the tag as ID3v2.3 — the most compatible version — usually fixes it.
- Apple Music hides it. An M4A with a perfectly valid initialkey atom shows no key in Apple Music. The tag is there; the player simply has no column for it.
- The key is only in the comment. If an old workflow wrote "8A" into Comment instead of TKEY, apps that read TKEY see nothing. Moving the value into the proper key field is covered in how to verify and fix wrong key tags.
How OpenKeyScan writes key tags
OpenKeyScan is built around the file-first approach. It analyzes each track locally with a convolutional neural network (explained in how it works) and writes the result into the file's own metadata: the ID3v2 TKEY frame for MP3 and AIFF, Vorbis comments for FLAC and OGG, and MP4 atoms for M4A. You choose the notation — Open Key, Camelot (alphanumeric) or traditional — so the tag matches whatever your DJ app displays.
Because the key lives in the file, the analysis is done once. Rekordbox, Serato, Traktor, Engine DJ and VirtualDJ all pick it up on import, and a library migration between them no longer means re-detecting and reconciling thousands of keys. It is the same reason Mixed In Key writes to tags — OpenKeyScan just does it for free and offline, and you can download it for Windows and macOS. If you are tagging a large collection for the first time, the batch analysis guide walks through the setup, including backing up first.
Frequently asked questions
Where is the musical key stored in an MP3 file?
In an MP3 file the musical key is stored in the ID3v2 tag, in a text frame called TKEY, which the ID3 specification names 'Initial key'. The older ID3v2.2 format uses the three-letter frame TKE instead. ID3v1 has no key field at all. Rekordbox, Serato, Traktor, Engine DJ and VirtualDJ all look for TKEY when they import an MP3.
What format should the TKEY Initial Key value use?
The ID3v2 specification says TKEY holds up to three characters: a note letter A to G, an optional 'b' or '#', and an optional 'm' for minor, such as 'Am', 'F#m' or 'Bb', with 'o' meaning off-key. In practice DJ tools write longer values like '8A' (Camelot), '1m' (Open Key) or 'A minor', and most DJ software accepts them. Traditional short notation such as 'Am' is the most widely understood value.
How is the key stored in FLAC and OGG files?
FLAC, OGG Vorbis and Opus files store metadata as Vorbis comments, which are free-form NAME=value pairs with no official key field. Two field names are common: INITIALKEY, which mirrors the ID3 frame name and is used by many DJ tools, and KEY, which MusicBrainz Picard and several taggers use. Robust software reads both, and a careful tagger writes the same value to both.
How is the key stored in M4A and AAC files?
M4A and AAC files use MP4 metadata atoms, and Apple defines no standard atom for musical key. The widely used convention is a freeform atom named '----:com.apple.iTunes:initialkey'. Apple Music and iTunes ignore this atom, but DJ software and taggers such as Mixed In Key and MusicBrainz Picard read and write it.
Does Rekordbox write the key it detects back into my files?
Not by default. Rekordbox stores its analysis, including key, in its own library database and does not write the detected key back into the audio file's TKEY tag. It reads the key tag when a track is imported, so keys written into files by a dedicated analyzer such as OpenKeyScan are visible in Rekordbox, while keys detected by Rekordbox stay inside Rekordbox.
Why did I update a key tag but my DJ software still shows the old key?
Most DJ applications read file tags once, at import, and then keep their own copy in a library database. Changing the tag in the file does not change that cached copy. To see the new value you usually need to reload tags from the file, re-import the track, or use the application's 'read tags' or 'reload metadata' option rather than re-running its own key analysis.
Can WAV files store a key tag?
Only partially. The standard WAV INFO chunk has no key field, so tools that tag WAV files embed an ID3 chunk inside the file, and support for reading it varies between DJ applications. For a lossless library whose key tags travel reliably between Rekordbox, Serato, Traktor, Engine DJ and VirtualDJ, AIFF or FLAC is the safer choice.
Put the key where every app can find it
OpenKeyScan detects the key of every track in your library — fast, offline and free — and writes it into the standard tag for each format, in the notation you choose. Analyze once, and Rekordbox, Serato, Traktor, Engine DJ and VirtualDJ all read the same trusted value.