.mid MIME type
MIDI fileaudio
audio/midiStandard MIDI files: note and controller events, not recorded sound. Unregistered, but universal.
| MIME type | audio/midi |
|---|---|
| Extensions | .mid, .midi |
| Also seen as | audio/x-midi |
| Content-Type | audio/midi |
| Compress in transit? | Yes — enable gzip or Brotli |
| File signature | 4D 54 68 64 (MThd) |
Good to know
<audio>can't play MIDI because there's no audio in the file. Render it with a synthesizer and a SoundFont (for example on the Web Audio API), or convert it to MP3 on the server.- The Web MIDI API talks to MIDI hardware; it doesn't play
.midfiles.
Serve .mid files with the right type
The response header to send:
Content-Type: audio/midi
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
audio/midi mid midi;
AddType audio/midi .mid .midi
res.set("Content-Type", "audio/midi");import mimetypes
mimetypes.add_type("audio/midi", ".mid")
mimetypes.add_type("audio/midi", ".midi")<input type="file" accept=".mid,.midi,audio/midi">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.mid | grep -i '^content-type:' file --mime-type file.mid
Frequently asked questions
What is the MIME type for .mid files?
audio/midi. You may also see audio/x-midi, but audio/midi is the one to send. The same type covers .midi.
What Content-Type header should a .mid file be served with?
Content-Type: audio/midi. It compresses well, so let the server apply gzip or Brotli.
How can I tell if a file is really a .mid?
Check its bytes rather than the extension: MID files start with 4D 54 68 64 (MThd). On the command line, file --mime-type name.mid does this for you.
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options