What is the MIME type of .mp3 files?
The MIME type (media type) for MP3 audio files with the .mp3 extension is audio/mpeg. The type is audio/mpeg; audio/mp3 is unofficial but widely accepted.
Content-Type header
Content-Type: audio/mpeg
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | audio/mpeg mp3; |
Apache (.htaccess) | AddType audio/mpeg .mp3 |
IIS (web.config) | <mimeMap fileExtension=".mp3" mimeType="audio/mpeg" /> |
| Node.js / Express | res.type('mp3') or res.setHeader('Content-Type', 'audio/mpeg') |
| Amazon S3 | Set Content-Type: audio/mpeg on the object (metadata), or pass --content-type audio/mpeg to aws s3 cp |
Should .mp3 files be compressed?
No. MP3 audio files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave audio/mpeg 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 .mp3?
audio/mpeg.How do I set the Content-Type for .mp3 in Nginx?
audio/mpeg mp3; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.