Use an Xbox or PlayStation controller in your browser

Xbox, DualShock 4 and DualSense controllers work in Chrome, Edge, Firefox and Safari on Windows and Mac, over a cable or Bluetooth. Connect yours, then press a button: the tester below shows what your browser sees.

Controller tester

Press any button on your controller
Browser id
–
USB ID
–
Layout
–
Game sees
–
Left stick: steer
Right stick
LT0%
RT0%

Connect an Xbox controller

Windows

Cable: plug it in with a USB cable. Nothing else to set up.

  1. Bluetooth (Xbox One S and newer): turn the controller on, then hold the small pair button on top until the Xbox button flashes fast.

  2. Open Settings → Bluetooth & devices → Add device → Bluetooth.

  3. Pick Xbox Wireless Controller.

Xbox Wireless Adapter: plug it in, press its button, then the pair button on the controller.

Mac

  1. Hold the pair button on top until the Xbox button flashes fast.

  2. Open System Settings → Bluetooth.

  3. Press Connect next to Xbox Wireless Controller.

Only Bluetooth models pair with a Mac (Xbox One S, Elite Series 2, Series X|S). Over a USB cable, Chrome reads Xbox One and Series controllers by itself; Safari and Firefox need Bluetooth.

Connect a PlayStation controller

Cable: a USB cable works on Windows and Mac with no setup. For Bluetooth, put the controller in pairing mode first:

DualSense (PS5)

Hold Create and PS together until the lights around the touchpad flash.

DualShock 4 (PS4)

Hold Share and PS together until the light bar flashes.

  1. Windows: Settings → Bluetooth & devices → Add device → Bluetooth. Mac: System Settings → Bluetooth.

  2. Pick the controller. Windows lists both as Wireless Controller; a Mac shows DUALSHOCK 4 Wireless Controller or DualSense Wireless Controller.

  3. The light stops flashing and stays on. Press a button on this page to check it.

Rumble on PlayStation controllers. A DualShock 4 rumbles in Chrome and Edge. A DualSense may not rumble in the browser; driving still works.

Button layout

Browsers give these controllers one standard layout, so the same physical button does the same thing on every pad.

In the gameXboxPlayStationStandard button
ThrottleRTR27
BrakeLTL26
SteerLeft stickLeft stickaxis 0
Handbrake, confirmACross0
PauseMenuOptions9

Controller not detected

Go down the list and test after each step.

  1. Press a button with this page open. Browsers hide controllers from a page until you press something, so nothing shows before that.
  2. Close Steam, then reload the page. When Steam is open it can take over the controller.
  3. DS4Windows shows two controllers. It adds a virtual Xbox pad next to the real one, so every press counts twice. Turn on HidHide in DS4Windows, or quit DS4Windows. The browser reads PlayStation controllers directly.
  4. Swap Bluetooth for a cable to tell a pairing problem from a controller problem.
  5. Unplug other controllers. A wheel, flight stick or second pad can take the controller slot the game reads.

Still stuck? Press Copy report in the tester and send it to us. It holds the exact IDs we need, and no personal data.

Controller IDs

Every controller reports a USB vendor and product ID, written as vendor:product in hex. Microsoft is 045e, Sony is 054c. The tester reads it from the browser's id string.

ControllerUSB IDConnection
Xbox 360045e:028eUSB cable
Xbox 360 Wireless Receiver045e:0719USB receiver
Xbox One045e:02d1, 045e:02ddUSB
Xbox One S045e:02eaUSB
Xbox One S045e:02e0, 045e:02fd, 045e:0b20Bluetooth
Xbox Elite Series 2045e:0b00USB
Xbox Elite Series 2045e:0b05Bluetooth
Xbox Series X|S045e:0b12USB
Xbox Series X|S045e:0b13Bluetooth
Xbox Wireless Adapter045e:02feUSB adapter
DualShock 4, first model (CUH-ZCT1)054c:05c4USB, Bluetooth
DualShock 4, second model (CUH-ZCT2)054c:09ccUSB, Bluetooth
DualShock 4 USB Wireless Adapter054c:0ba0USB adapter
DualSense (PS5)054c:0ce6USB, Bluetooth
DualSense Edge054c:0df2USB, Bluetooth

How each browser names a controller

Browserid string, example
Chrome, Edge on Windows (Xbox)Xbox 360 Controller (XInput STANDARD GAMEPAD)
Chrome, Edge on Mac, and PlayStation pads on WindowsDualSense Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 0ce6)
Firefox054c-0ce6-DualSense Wireless Controller
Firefox on Windows (Xbox)xinput
Safari… Extended Gamepad
For developers: what a Godot web game sees, and SDL GUIDs

A Godot 4 web build doesn't use SDL GUIDs. When the browser gives a controller the standard layout, Godot's controller GUID is the literal string standard; otherwise it is the OS plus vendor and product, for example Windows054c05c4. That is the “Game sees” line in the tester, and the only key Input.add_joy_mapping() can match on the web.

Desktop builds use SDL GUIDs from SDL_GameControllerDB. Layout: bus (03 USB, 05 Bluetooth), name CRC, vendor and product little-endian, version.

ControllerWindows SDL GUID
Xbox 360030000005e0400008e02000000000000
Xbox One030000005e040000d102000000000000
Xbox One S, Bluetooth030000005e040000fd02000000000000
Xbox Series, Bluetooth030000005e040000130b000000000000
DualShock 4, first model030000004c050000c405000000000000
DualShock 4, second model030000004c050000cc09000000000000
DualSense030000004c050000e60c000000000000

Questions

Why doesn't my browser see my controller?

Browsers hide controllers until you press a button while the page is open. Press any button. If it still doesn't appear, close Steam and DS4Windows, reconnect the controller and reload the page.

Does a PS5 DualSense controller work in Chrome?

Yes. Chrome, Edge and Firefox map the DualSense to the standard layout over USB and Bluetooth on Windows and Mac.

Why doesn't my controller vibrate in Firefox?

Firefox has no vibration support for web pages. Chrome, Edge and Safari do.

Can I use a Nintendo Switch Pro Controller?

Yes. Chrome and Firefox map it to the standard layout (USB ID 057e:2009). The buttons are labelled differently: the game's handbrake is the button where Xbox has A, which is B on a Switch controller.