Controllers don’t agree on button numbering — browsers standardize it anyway
Different controllers report their buttons and axes to a computer in
different orders at the hardware level. To make cross-controller web apps
possible without controller-specific code, the W3C Gamepad specification
defines a normalized Standard Gamepad layout: when a browser recognizes
a connected controller and can map it to this layout, it reports
mapping: "standard" and guarantees every button and axis lands at the
same index regardless of brand
(W3C Gamepad specification, Remapping).
Crucially, the spec defines these positions physically — “bottom button in right cluster,” “top left front button” — not by whatever letter or symbol happens to be printed on it. That distinction explains a mapping quirk worth knowing about.
The standard button layout
| Index | Physical position | Xbox | PlayStation | Switch Pro Controller |
|---|---|---|---|---|
| 0 | Bottom, right cluster | A | ✕ (Cross) | B |
| 1 | Right, right cluster | B | ○ (Circle) | A |
| 2 | Left, right cluster | X | ▢ (Square) | Y |
| 3 | Top, right cluster | Y | △ (Triangle) | X |
| 4 | Top-left front | LB | L1 | L |
| 5 | Top-right front | RB | R1 | R |
| 6 | Bottom-left front | LT | L2 | ZL |
| 7 | Bottom-right front | RT | R2 | ZR |
| 8 | Left, center cluster | Back / View | Share / Create | Minus (−) |
| 9 | Right, center cluster | Start / Menu | Options | Plus (+) |
| 10 | Left stick press | L3 | L3 | Left stick press |
| 11 | Right stick press | R3 | R3 | Right stick press |
| 12–15 | D-pad up/down/left/right | D-pad | D-pad | D-pad |
| 16 | Center, center cluster | Guide | PS button | Home |
(Layout per the W3C Gamepad specification’s Standard Gamepad definition.)
Why the Switch Pro Controller’s face buttons look “swapped”
Nintendo’s face-button layout is a mirror image of Xbox’s: on an Xbox controller, A sits at the bottom and B on the right; on a Switch Pro Controller, B sits at the bottom and A on the right. Because the Standard Gamepad layout maps by physical position rather than label, index 0 is always the bottom face button — Xbox’s A, PlayStation’s ✕, and the Switch Pro Controller’s B all land there. That’s expected behavior, not a bug in the controller or the site reading it: if you’re testing a Switch controller and pressing B lights up the button in the “A” position of a generic on-screen diagram, this is why.
The Guide/PS/Home button is often invisible to the browser
Index 16 exists in the spec, but operating systems frequently intercept the Xbox Guide button, PlayStation button, or Switch Home button before it reaches the browser at all, since those buttons are reserved to open a system-level menu or launcher. Don’t be surprised if it never registers here — that’s an OS-level reservation, not a detection failure.
When a controller doesn’t use the standard layout
Not every controller — particularly generic, off-brand, or older
USB/Bluetooth pads — reports a layout the browser recognizes well enough to
normalize. When that happens, mapping comes back as an empty string
instead of "standard", and there’s no guarantee button 0 means anything
consistent across devices. The Gamepad Tester on this
site falls back to a raw numbered button grid in that case, rather than
guessing at a layout — every input is still testable, just without the
labeled diagram.
Test your own controller’s mapping
Open the Gamepad Tester, connect your controller, and press each button in turn. Standard controllers light up the matching position on the schematic instantly; if your controller shows the raw grid instead, it’s a good sign its firmware reports a non-standard layout worth knowing about before you configure key bindings in a game.