What is the MIME type of .m4a files?
The MIME type (media type) for MPEG-4 audio (AAC) files with the .m4a extension is audio/mp4. AAC audio in an MP4 container, used by Apple Music and many podcasts.
Content-Type header
Content-Type: audio/mp4
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | audio/mp4 m4a; |
Apache (.htaccess) | AddType audio/mp4 .m4a |
IIS (web.config) | <mimeMap fileExtension=".m4a" mimeType="audio/mp4" /> |
| Node.js / Express | res.type('m4a') or res.setHeader('Content-Type', 'audio/mp4') |
| Amazon S3 | Set Content-Type: audio/mp4 on the object (metadata), or pass --content-type audio/mp4 to aws s3 cp |
Should .m4a files be compressed?
No. MPEG-4 audio (AAC) files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave audio/mp4 out of your compression configuration.
Why the MIME type matters
Browsers decide what to do with a response — render, run, play or download — from the Content-Type header, not the file extension. With X-Content-Type-Options: nosniff, a wrong type causes stylesheets and scripts to be blocked outright. For uploads, never trust the type sent by the client; check the file’s content (its magic bytes) on the server.
Frequently asked questions
What is the MIME type for .m4a?
audio/mp4.How do I set the Content-Type for .m4a in Nginx?
audio/mp4 m4a; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.