navigator.requestMIDIAccess() is the Web MIDI entry point for talking to MIDI keyboards and controllers in the browser. Learn the Promise result, inputs/outputs, sysex options, permissions, five examples, and try-it labs.
01
Kind
Method
02
Returns
Promise<MIDIAccess>
03
Status
Limited (not Baseline)
04
Context
Secure (HTTPS)
05
Options
sysex / software
06
Permission
midi
Fundamentals
Introduction
MIDI (Musical Instrument Digital Interface) connects keyboards, pads, and synths. The Web MIDI API lets a webpage listen for notes and send MIDI messages without a native plugin.
Call navigator.requestMIDIAccess() (optionally with options). If the user allows access, you get a MIDIAccess object and can enumerate inputs and outputs.
💡
No Dep / Exp / Non-standard banner
MDN marks Limited availability and a secure context, but not Deprecated, Experimental, or Non-standard. Always feature-detect and handle permission denial.
Concept
Understanding the requestMIDIAccess() Method
Optional options object — { sysex, software }.
Promise result — fulfills with MIDIAccess.
Inputs / outputs — Map-like collections of MIDI ports.
Permission — user prompt and/or midi Permissions Policy.
Secure context — HTTPS / localhost required where supported.
Hotplug — listen for statechange on MIDIAccess when devices connect/disconnect.
Four facts to remember about navigator.requestMIDIAccess().
Returns
Promise
MIDIAccess
Status
Limited
Not Baseline
Context
HTTPS
Secure required
Ports
in / out
MIDI maps
Compare
📋 Without vs With Sysex
Default (sysex: false)
With sysex: true
Typical messages
Notes, CC, program change
Plus System Exclusive dumps / device setup
Permission
Standard MIDI access
Often stricter / separate sysex consideration
Beginner apps
Start here
Only when you need manufacturer sysex
Hands-On
Examples Gallery
Try It Yourself may prompt for MIDI permission on HTTPS. Without a connected controller you still get a valid MIDIAccess with empty (or system) port lists.
📚 Getting Started
Detect Web MIDI and request access.
Example 1 — Feature Detection
Check the method and secure context before prompting.
navigator.requestMIDIAccess() is part of the Web MIDI API and is not Baseline. Support is strongest in Chromium-based browsers on HTTPS. Always feature-detect, request permission intentionally, and provide a virtual-keyboard fallback.
✓ Limited · Not Baseline
Navigator.requestMIDIAccess()
Promise → MIDIAccess for MIDI inputs and outputs.
LimitedNot Baseline
Google ChromeWeb MIDI on HTTPS with permission
Supported
Microsoft EdgeFollow Chromium Web MIDI support
Supported
OperaFollow Chromium where available
Supported
Mozilla FirefoxCheck current compatibility — feature-detect
Limited
Apple SafariTypically unavailable — feature-detect
Unavailable
Internet ExplorerNo Web MIDI requestMIDIAccess
Unavailable
requestMIDIAccess()Limited
Bottom line: Detect the method on a secure page, request access from a button click, list inputs/outputs, and catch SecurityError when permission is denied.
Wrap Up
Conclusion
navigator.requestMIDIAccess() opens the Web MIDI API. Request it on HTTPS, handle permission carefully, then enumerate inputs and outputs to build interactive music tools — with a non-MIDI fallback when the API is missing.
Limited Web MIDI entry point — request access, then use inputs and outputs.
5
Core concepts
🎹01
Returns
MIDIAccess
Promise
📊02
Support
Limited
Not Baseline
🔒03
Needs
HTTPS + permission
midi
🔀04
Ports
inputs / outputs
Maps
⚡05
Option
sysex
Opt-in
❓ Frequently Asked Questions
It asks the browser for access to MIDI devices (keyboards, controllers, synthesizers). If permission is granted, the Promise resolves to a MIDIAccess object with inputs and outputs maps.
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It is Limited availability (not Baseline) and requires a secure context. No status banner is required.
If MIDIOptions.sysex is true, the app may send and receive System Exclusive messages. The default is false. Sysex often needs extra permission scrutiny.
Usually yes on first use (or the browser reuses a previous choice). Access can also be blocked by the midi Permissions Policy.
After access resolves, iterate access.inputs.values() and access.outputs.values() to read MIDIInput / MIDIOutput ports (name, manufacturer, state, and more).
Often yes via navigator.permissions.query({ name: "midi", sysex: true|false }) when the Permissions API supports the midi permission in that browser.
Did you know?
MIDI messages are tiny binary packets (often three bytes for a note-on). Web MIDI delivers them as Uint8Array data on midimessage events — perfect for pairing with the Web Audio API.