Tool

Mac keyboard tester

Press any key on a MacBook or a Magic Keyboard and it lights up on the Mac layout below, with command, option, control and shift on both sides. It shows each key's code and the number InputConfig uses for it, and it marks the keys macOS keeps for itself, so a key that stays dark is not mistaken for a broken one.

Test a Mac keyboard in this order

  1. Click the page once, so it receives the keyboard.
  2. Press each row from left to right, from the number row down to the arrows.
  3. Hold fn and press F1 to F12. Without fn they run brightness, volume and media, which never reach a page.
  4. Press left and right command, option, control and shift one at a time. Each side is its own key.
  5. On a Magic Keyboard with a numeric keypad, turn on Keys of a full-size Mac keyboard for F13 to F19, the keypad, home, end and the page keys.

The keys macOS keeps

  • The top row. Brightness, Mission Control, Spotlight, dictation, media and volume act before a page sees anything. Hold fn to send F1 to F12 instead.
  • fn and Globe. No browser reports this key, so it is drawn dashed and left out of the count.
  • Caps Lock. Browsers on a Mac report it in different ways, some only when the light turns on and off, so the tester flashes it on each press instead of keeping it lit.
  • Command shortcuts. Command Q, Command W, Command Tab and Command Space belong to macOS and the browser. Press command on its own.
  • Keys released while command is held. A Mac sends a page no release for them, so the tester lets go of them when command comes up.
  • Touch ID and the power button. Not keys a page can read.

None of these is a fault. On a Mac, a dark key in this list means macOS answered first, not that the key is dead.

If a key really does nothing

Climb this ladder, smallest step first:

  1. Click the page and press it again. The page only hears the keyboard while it is the front window.
  2. Try it in TextEdit. If the key types there, the keyboard is fine and the page or the browser is the limit.
  3. Use the Keyboard Viewer. In System Settings, Keyboard, Text Input, click Edit and turn on Show Input menu in menu bar, then choose Show Keyboard Viewer from that menu. The on-screen keyboard lights each key macOS receives.
  4. Reconnect a Magic Keyboard. Plug it in with its cable, which pairs it again and charges it.
  5. Plug in a second keyboard. If the same key works on it, the key on the first keyboard has failed.

What a web page cannot test

Some presses never reach a web page, on any keyboard. On a Mac that is the fn or Globe key, the brightness, volume and media keys on the top row unless fn is held, and the shortcuts macOS and the browser keep, such as Command Q, Command W and Command Tab. On a PC it is the Windows key in many browsers, Alt F4 and Ctrl Alt Delete. The page also cannot measure how far a key travels or how hard it was pressed. A key that stays gray only in this list is not broken: test it on its own, or in a second app.

Give a spare key a job

F13 to F19 on a full-size Magic Keyboard, the keypad, or keys you never use can do real work. InputConfig, the free Mac app I make, can have one open an app, run a macro, start dictation or type a phrase, and it can read the fn key, which no web page sees. It listens to the keyboard and does not block or remap the key itself, so the cleanest keys to use are the ones that type nothing. Test it here, then give it a job there.

Questions

How do I test my MacBook keyboard?

Open this page, click it once and press every key. Each key turns green once it registers. The top row needs fn held down, because macOS keeps brightness, volume and media for itself.

Why does the fn key not light up?

No browser reports the fn or Globe key to a web page, on any Mac. InputConfig can read it as an input, which is one way to check that it works.

How do I test the left and right command keys?

Press each one on its own. The tester draws both, and each side lights by itself because the browser reports them as two different keys.

Can I test Touch ID or the power button?

No. A web page sees key presses only, and Touch ID and the power button are handled by macOS.

Related

Download InputConfig on the Mac App StoreFree. macOS 14 or later. No account, nothing leaves your Mac. Open source on GitHub.