Skip to content

WebHID API

Published

WebHID API — The WebHID API lets a web app request access to non-standard Human Interface Devices via navigator.hid.requestDevice() and exchange input, output, and feature reports with them.

  • Legend
  • Yes
  • Partial
  • Flag
  • No
  • Unknown
Browser / PlatformSupportVersionsConfidenceSourceNotes
Chrome (Desktop)Yes89highsource—
Chrome (Android)No—highsource1
Edge (Desktop)Yes89highsource2
Firefox (Desktop)No—highsource3
Firefox (Android)No—highsource45
Safari (macOS)No—highsource6
Safari (iOS)No—highsource78
Samsung InternetNo—highsource910
WebView (Android)No—highsource1112
  1. No Chrome Android support is recorded in browser-compat-data.
  2. Derived by browser-compat-data mirroring from Chrome.
  3. No Firefox support is recorded in browser-compat-data.
  4. No Firefox for Android support is recorded in browser-compat-data.
  5. Derived by browser-compat-data mirroring from Firefox.
  6. No Safari support is recorded in browser-compat-data.
  7. No Safari on iOS support is recorded in browser-compat-data.
  8. Derived by browser-compat-data mirroring from Safari.
  9. No Samsung Internet support is recorded in browser-compat-data.
  10. Derived by browser-compat-data mirroring from Chrome Android.
  11. No WebView Android support is recorded in browser-compat-data.
  12. Derived by browser-compat-data mirroring from Chrome Android.

Source data: /compatibility/web-hid.json · Global usage: 37 % (StatCounter 2026-05)

Source: spec · MDN · Last verified 2026-10-03 · Confidence: high (computed from sources)

Requesting a device must happen inside a user gesture, and filters narrows the picker to devices matching a vendor ID. Once the user selects a device, open it before sending or receiving reports:

async function connectHidDevice() {
const [device] = await navigator.hid.requestDevice({
filters: [{ vendorId: 0x2341 }],
});
await device.open();
return device;
}

Check for navigator.hid before offering the feature, and give the reader a fallback path when it is absent:

if ('hid' in navigator) {
connectButton.hidden = false;
} else {
connectButton.hidden = true;
fallbackNotice.textContent = 'This browser cannot access HID devices from the page.';
}
  • Requires a secure context — plain HTTP origins other than potentially trustworthy ones like localhost cannot use it.
  • requestDevice() needs transient user activation (a click or keypress handler); without it, the returned promise rejects with a SecurityError DOMException.
  • requestDevice() resolves with an array (not a single device) of the HID interfaces exposed by the device the user picked — an empty array means the user closed the picker without choosing one.
  • Devices must be open()ed before reports can be sent; calling sendReport() on a device that is not open rejects with an InvalidStateError DOMException.
  • Per MDN browser-compat-data, Chrome for Android and Android WebView do not implement the API, so 'hid' in navigator is false there and any HID-dependent flow needs the fallback path above.

For the full reference (secure-context rules, connect/disconnect events, report handling), see WebHID API.

See also Web Serial API for the equivalent flow over a serial port.

← Back to the Compatibility explorer.