The basics
What is an M4A file?
An M4A file is an MP4 file with no video in it. The extension was introduced by Apple so that music libraries and players could tell audio-only files from videos at a glance; inside, the structure is the same as any .mp4. Songs bought from the iTunes Store, iPhone Voice Memos recordings, many podcast and audiobook files and exports from music apps are all M4A files.
Like MP4, M4A is a container: it doesn't decide how the sound is compressed. Almost every M4A holds one of two codecs:
- AAC (Advanced Audio Coding), a lossy codec designed as the successor to MP3. It sounds better than MP3 at the same bit rate, especially at low bit rates, and is what most M4A files contain.
- ALAC (Apple Lossless Audio Codec), which compresses without losing anything, like FLAC. Apple published it as open source under the Apache licence in 2011.
So an M4A can be either lossy or lossless, and the extension won't tell you which. The codec line in a player's info panel, or ffprobe, will: aac or alac.
Anatomy
What's inside an M4A file
An M4A file has the same structure as an MP4 video: a series of boxes (also called atoms), each starting with a 4-byte size and a 4-letter type, some nested inside others. Here is the box tree of sample-aac-tags.m4a, our 10-second sample, as read from the file. Offsets and sizes are in bytes; a few small boxes are left out to save space.
offset size box
0 32 ftyp file type
00 00 00 20 66 74 79 70 4D 34 41 20 00 00 00 00
4D 34 41 20 6D 70 34 32 69 73 6F 6D 00 00 00 00
32 13,054 moov the index
40 108 mvhd movie header: timescale, duration
148 2,260 trak the audio track
288 33 hdlr handler type "soun"
389 103 stsd sample entry "mp4a" with an esds box
AudioSpecificConfig 12 10: AAC-LC, 44.1 kHz, 2 ch
492 24 stts timing: 433 frames of 1,024 samples
556 1,752 stsz the size of every AAC frame
2,308 100 stco where each chunk of frames starts
2,408 10,678 udta
2,416 10,670 meta
2,461 9,432 ilst the tags
2,469 65 ©nam title
2,534 46 ©ART artist
2,580 51 ©alb album
2,665 32 trkn track 1 of 1
2,725 67 ©too encoder
2,792 188 ---- com.apple.iTunes: iTunSMPB
2,980 8,809 covr cover art: a 300×300 PNG
11,789 104 ©cmt comment
11,893 1,193 free room for the tags to grow
13,086 1,024 free spare space
14,110 8 free
14,118 160,876 mdat 433 AAC frames, about 371 bytes each- 1
66 74 79 70 4D 34 41 20The file type box and its brand
ftypat byte 4, then the major brandM4A(with a trailing space, because brands are always 4 characters). Compatible brandsmp42andisomtell other MP4 readers they can open it too. The brand is a hint, not a guarantee: plenty of M4A files sayisomormp42instead. - 2
moov at byte 32The index comes first
moovdescribes the track and says where every frame is. Here it sits before the audio, so a browser can start playing while the rest downloads. Recorders often write it at the end instead, as described on the MP4 page. - 3
stsd: mp4a + esdsWhich codec
The sample entry
mp4ameans MPEG-4 audio. The real detail is the 2-byte AudioSpecificConfig inside theesdsbox:12 10decodes to object type 2 (AAC-LC), sample rate index 4 (44,100 Hz) and 2 channels. An ALAC file has the sample entryalacinstead. - 4
stts, stsz, stcoThe sample tables
433 frames of 1,024 samples each, the size of every frame, and where each group of frames starts in the file. Seeking to a time is a lookup in these tables, which is why M4A seeks precisely and MP3 sometimes doesn't.
- 5
udta › meta › ilstThe tag list
Apple's iTunes-style metadata. Each tag is a box named after the field, often starting with the
©byte (A9in hex):©namtitle,©ARTartist,©albalbum,trkntrack number. Inside each one, adatabox holds the value and a type code (1 for UTF-8 text). - 6
---- iTunSMPBGapless playback information
A free-form tag (
----) in thecom.apple.iTunesnamespace. Its value00000800 00000158 …6BAA8says the encoder added 2,048 samples of delay at the start and 344 samples of padding at the end around exactly 441,000 real samples (10.000 seconds). - 7
covrCover art
The image file itself, inside a
databox with type 14 (PNG) or 13 (JPEG). At 8.8 KB it's the biggest tag in this file. - 8
freeSpare space
Boxes that every reader skips. Tag editors use them as room to grow, so changing a title doesn't mean rewriting the whole file and updating every offset in
stco. - 9
mdatThe audio
433 raw AAC frames, back to back, with no headers of their own: everything a decoder needs to know is in
moov. Compare this with a raw .aac file, where each frame carries a 7-byte header instead.
Under the hood
How an M4A file is put together
Two boxes do almost all the work. mdat holds the compressed audio frames, packed together with nothing in between. moov holds everything else: the duration, the codec settings, a table with the size and position of every frame, and the tags. A player reads moov first, then fetches frames from mdat as it needs them.
- Seeking is exact. Because the index lists every frame, a player can jump to 3:27 by calculation instead of guessing from the bit rate, which is how MP3 players handle files without a seek table.
- The order of the boxes matters online. If
moovis at the end, a browser has to fetch the end of the file before it can play anything. Moving it to the front (ffmpeg -i in.m4a -c copy -movflags +faststart out.m4a) fixes that without re-encoding. - Gapless playback is recorded. AAC encoders add a short silence at the start (the encoder delay) and pad the last frame. An M4A can store how much, in the
iTunSMPBtag or in an edit list, so gapless-aware players trim it and live albums play without gaps. A raw.aacfile has nowhere to store this.
Codecs
The codecs inside: AAC, HE-AAC and ALAC
| Codec | Sample entry | Compression | Used for |
|---|---|---|---|
| AAC-LC (Low Complexity) | mp4a | Lossy | Music and podcasts at about 96 to 256 kbps. The default almost everywhere. |
| HE-AAC (v1) | mp4a | Lossy | Low bit rates, about 32 to 64 kbps for stereo: internet radio and streaming. Adds spectral band replication (SBR). |
| HE-AAC v2 | mp4a | Lossy | Very low bit rates, around 32 kbps and below for stereo. Adds parametric stereo (PS) to SBR. |
| ALAC (Apple Lossless) | alac | Lossless | Archiving CDs and high-resolution music in Apple's ecosystem. Decodes to exactly the original samples. |
All three AAC flavours use the same sample entry, mp4a; the difference is in the AudioSpecificConfig. Our sample-he-aac-v2.m4a shows how HE-AAC stays backward-compatible: its config first describes plain AAC-LC at 22,050 Hz in mono, then adds an extension that switches on SBR (restoring 44,100 Hz and the high frequencies) and PS (restoring stereo). A decoder that only knows AAC-LC still plays something, just duller and in mono.
The MP4 container can carry other codecs too, such as MP3, FLAC and Opus, but files like that normally use the .mp4 extension, and some Apple software won't play them as .m4a.
Variants
M4A, M4B, M4R, M4P and MP4: what the extensions mean
| Extension | What it is |
|---|---|
.m4a | Audio-only MP4, AAC or ALAC. Music, recordings, podcasts. |
.m4b | The same format, named so Apple's apps treat it as an audiobook or podcast: they remember the playback position and show chapters. Renaming .m4b to .m4a or back doesn't change the file. |
.m4r | An iPhone ringtone: an M4A with AAC audio and a different extension. |
.m4p | AAC protected with Apple's FairPlay copy protection, from older iTunes Store purchases. Only plays in Apple software signed in with the buyer's account. |
.mp4 | The general MP4 extension. An audio-only .mp4 and an .m4a are the same thing; renaming between them is safe. |
.aac | Not a container: raw AAC frames with small ADTS headers. See the AAC explainer. |
Related formats
M4A vs MP3, AAC, FLAC and Ogg
| Format | Compression | Notes |
|---|---|---|
.m4a (AAC) | Lossy | Better than MP3 at the same bit rate, exact seeking, gapless information, rich tags. Plays in every current browser and phone. |
.m4a (ALAC) | Lossless | Apple's lossless option. Outside Apple's apps and Safari, support is patchier than for FLAC. |
.mp3 | Lossy | Plays on more old hardware, such as car stereos and early players. Slightly larger for the same quality. |
.aac | Lossy | The same AAC audio without a container: no index, no gapless information, no proper tags. |
.flac | Lossless | The open lossless standard, with wider support than ALAC outside Apple's software. |
.ogg, .opus | Lossy | Open, royalty-free codecs (Vorbis, Opus) in the Ogg container. Opus beats AAC at low bit rates. |
Converting AAC to MP3, or one AAC to another, stacks the losses of both encodings. Convert from a lossless original where you can. Converting ALAC to FLAC, or back, is lossless both ways.
Troubleshooting
Common M4A problems and their causes
- Plays on a Mac or iPhone but not elsewhere: it's probably ALAC. Check the codec with
ffprobeor VLC's codec information; convert to FLAC or AAC for wider support. - Won't play until it has fully downloaded:
moovis at the end of the file. Remux it with-movflags +faststart. - Sounds dull or narrow on one device and fine on another: an HE-AAC file played by a decoder without SBR support, which plays only the low-frequency core. HE-AAC v2 can also collapse to mono.
- A tiny gap between tracks of a live album: the player ignores the encoder delay and padding stored in the file, or a converter dropped the
iTunSMPBtag or edit list. - Won't play at all, and the file came from an old iTunes library: it may be an
.m4pwith FairPlay copy protection, renamed. Only Apple software authorised for that account plays those. - Tags or cover art missing after conversion: some converters copy only the audio. Check the converter's metadata options, or copy the tags across with a tag editor.
How to
How to open, edit and convert an M4A file
- Play it: double-click it. On Windows the Media Player app opens AAC M4A files; on a Mac, Music or QuickTime Player. Phones play AAC M4A in their file and music apps, and browsers play it when you drag it in or put it online. VLC plays both AAC and ALAC on every system.
- Edit the sound: Audacity (with its FFmpeg import option), GarageBand or any audio editor. Re-exporting AAC re-encodes it, so export once at the end.
- Trim without re-encoding:
ffmpeg -ss 10 -t 30 -i in.m4a -c copy out.m4acuts at AAC frame boundaries without losing quality. - Edit tags and cover art: Mp3tag (Windows, macOS), Kid3 (all platforms), MusicBrainz Picard, or the Get Info window in Apple's Music app.
- Convert: to MP3,
ffmpeg -i in.m4a -c:a libmp3lame -q:a 2 out.mp3. From WAV to AAC M4A,ffmpeg -i in.wav -c:a aac -b:a 192k out.m4a. Between ALAC and FLAC,ffmpeg -i in.m4a -c:a flac out.flac, which loses nothing.
Is an M4A file safe?
It can't run code. As with any media file, a deliberately malformed one could trigger a bug in a player, so keep software updated. Recordings from phones can carry the recording date and device model in their tags: check them with ffprobe before you publish one.
Free downloads
Sample M4A files to download
Free sample M4A files for testing players, tag readers, upload forms and audio pipelines. The sounds are generated chords, tones and sweeps, encoded with the Fraunhofer FDK AAC encoder, FFmpeg's AAC encoder and FFmpeg's ALAC encoder. Each file was checked with ffprobe and decoded in full without errors.
What's inside sample-aac-tags.m4a
A 10-second M4A with AAC-LC at 128 kbps, 44.1 kHz stereo, iTunes-style tags and cover art, and the index at the front. The box tree in the anatomy above is this file.
The music
Five two-second chords (C, A minor, F, G, C), the same as our MP3 sample. Bass notes lean left and upper notes right, so you can hear whether stereo survives.
The brand
ftypdeclares the major brandM4A, withmp42andisomas compatible brands.Faststart
moovsits at byte 32 and the audio at byte 14,118, so playback can start as soon as the first frames arrive.The codec
AAC-LC, constant 128 kbps: 433 frames of 1,024 samples, about 371 bytes each.
Tags
Title, artist, album, track 1 of 1, year, genre and a comment naming this page, in
ilst.Cover art
A 300×300 PNG in a
covrbox. Players that show artwork should display it.Gapless information
The
iTunSMPBtag marks 2,048 samples of encoder delay and 344 of padding. Players that use it play exactly 10.000 seconds;ffprobe, which counts every frame, reports 10.054.
All sample M4A files
AAC M4A with tags and cover art
sample-aac-tags.m4a · 170.9 KB (174,994 bytes)
10 seconds, AAC-LC 128 kbps CBR, 44.1 kHz stereo,
moovfirst. iTunes-style tags, PNG cover art and gapless information.- Checking a player, host or upload form handles standard M4A
- Testing tag readers and cover art display
Apple Lossless (ALAC) M4A
sample-alac.m4a · 151.4 KB (155,050 bytes)
The 4 seconds of CD-quality chords from our WAV sample, compressed losslessly: 155,050 bytes instead of 705,880. Sample entry
alac, 16-bit, 44.1 kHz stereo.- Checking whether a browser or device plays ALAC
- Lossless round-trip tests (decode and compare with the WAV)
HE-AAC v2 at 32 kbps
sample-he-aac-v2.m4a · 44.1 KB (45,123 bytes)
The featured chords at 32 kbps with SBR and parametric stereo. The core is AAC-LC at 22.05 kHz mono; a full decoder outputs 44.1 kHz stereo.
- Testing HE-AAC v2 decoding (a muffled or mono result means it isn't fully supported)
- Low-bit-rate streaming pipelines
M4A with three chapters
sample-chapters.m4a · 91.5 KB (93,734 bytes)
15 seconds of mono AAC in three 5-second chapters, each a chord followed by one, two or three beeps, so you can hear which chapter you're in. Chapters are stored both as a QuickTime chapter track and a Nero
chplbox.- Testing chapter support in audiobook and podcast players
- Checking that conversions keep chapters
1 MB M4A file (frequency sweep)
sample-1mb.m4a · 1 MB (1,048,576 bytes)
A 60-second sine sweep from 20 Hz to 20 kHz, AAC-LC at 128 kbps, padded with a trailing
freebox to exactly 1,048,576 bytes (1 MiB). Turn the volume down: it's a test tone.- Upload and size-limit tests
- Hearing or measuring an encoder's high-frequency cutoff
Ways to test with them
- Codec support: play
sample-aac-tags.m4aandsample-alac.m4ain the browser or device you care about. If only the first plays, it has no ALAC decoder. - HE-AAC:
sample-he-aac-v2.m4ashould sound like the featured file, a little less crisp. If it sounds muffled or comes out in mono, the decoder lacks SBR or parametric stereo. - Chapters: open
sample-chapters.m4ain a podcast or audiobook app; you should see three chapters at 0, 5 and 10 seconds.ffprobe -show_chapterslists them too. - Lossless round trip: decode
sample-alac.m4ato WAV and compare the samples with our 4-second WAV sample. They should be identical. - Upload limits:
sample-1mb.m4ais exactly 1 MiB, so you can test a limit at the boundary.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have an M4A file? Give it a link.
Drop an M4A on 99helpers and it gets its own address that plays straight in the browser, on any phone or computer, with nothing to install. Share a voice memo, demo or podcast episode as a link.
Questions
M4A files, frequently asked
What is an M4A file?
An audio file in the MP4 container, usually compressed with AAC, sometimes stored losslessly with Apple Lossless (ALAC). It's the format of iTunes purchases, iPhone voice memos and many podcasts.
Is M4A better than MP3?
With AAC inside, yes: it sounds better than MP3 at the same bit rate, seeks precisely and supports gapless playback. MP3 still wins on compatibility with very old devices.
Is M4A lossless?
It depends on the codec inside. Most M4A files use AAC, which is lossy. An M4A with ALAC (Apple Lossless) is lossless. A player's info panel or ffprobe tells you which.
What's the difference between M4A and MP4?
None in the format. M4A is an MP4 file with only audio; Apple introduced the extension so audio and video files could be told apart. Renaming one to the other doesn't change the file.
What's the difference between M4A and AAC?
AAC is the codec. An .aac file is raw AAC frames with small headers; an .m4a puts the same frames in an MP4 container, adding an index, tags, cover art and gapless information.
Can browsers play M4A files?
Yes, M4A files with AAC audio play in every current browser. ALAC M4A files play in Safari, but support in other browsers varies, so use AAC for the web.
What is an M4B file?
An audiobook in the same format as M4A. The different extension tells Apple's apps to remember your place and show chapters. You can rename it to .m4a and it still plays.
How do I convert M4A to MP3?
Use a converter app, Audacity, or FFmpeg: ffmpeg -i in.m4a -c:a libmp3lame -q:a 2 out.mp3. AAC to MP3 is a lossy-to-lossy conversion, so use a good bit rate.
Related formats
Other file types explained
Keep going
Related
Sources
- RFC 4337: MIME Type Registration for MPEG-4
- Library of Congress: MPEG-4 File Format, Version 2
- Library of Congress: AAC (MPEG-4)
- MDN: Media container formats (MPEG-4)
- LWN.net: Apple open-sources its lossless audio codec (2011)
Last reviewed 27 October 2026.