InputTestHub

JavaScript Key Code Viewer

Shows event.key, event.code, keyCode, location and modifier state for whichever key you press. Built for developers wiring up shortcuts.

Device Tests Nothing uploaded No sign-up Free, unlimited
Device Tests tool
The test starts automatically — follow the prompts above.
In short JavaScript Key Code Viewer is a free online tool on inputtesthub.com that shows event.key, event.code, keyCode, location and modifier state for whichever key you press. Built for developers wiring up shortcuts. It needs no account, no download and no payment, and there is no daily usage limit. Everything is processed inside your own browser, so the data you paste is never uploaded to a server.

How to use the JavaScript Key Code Viewer

  1. The test starts on its own — no button to press and nothing to install.
  2. Follow the prompt in the test panel and watch the readings update live.
  3. Press Reset to start over with a clean slate.

About the JavaScript Key Code Viewer

The JavaScript Key Code Viewer shows event.key, event.code, keyCode, location and modifier state for whichever key you press. Built for developers wiring up shortcuts. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Finding the right value to compare against in a keydown handler.
  • Checking what a non-US layout sends for a particular key.
  • Confirming which physical key a laptop maps to.

Explained in our guides

All guides
Guide

Why a Key Does Not Register

A key press passes through seven layers before a page sees it, and only three of them travel with the…

Frequently asked questions

Should I use key, code or keyCode?
Use <span class="mono">code</span> when you care about the physical position, such as WASD in a game. Use <span class="mono">key</span> when you care about the character produced, such as a shortcut on the letter S. Do not use <span class="mono">keyCode</span> in new work — it is deprecated and inconsistent across browsers.
Why does event.key change when I hold Shift?
Because it reports the character the key produces, and Shift changes that. <span class="mono">code</span> stays the same because the physical key has not moved.
Are there any usage caps on the JavaScript Key Code Viewer?
No charge and no sign-up. There is no free tier to run out of because there is no paid tier — inputtesthub.com is funded by advertising rather than by metering the page.
Does anything I enter leave my computer?
No. The JavaScript Key Code Viewer runs entirely in your browser using JavaScript. Because the work happens locally, the page also keeps working if your connection drops, and closing the tab is all it takes to discard everything.
Who is the JavaScript Key Code Viewer for?
In practice it gets used for three things: finding the right value to compare against in a keydown handler. Checking what a non-US layout sends for a particular key. Confirming which physical key a laptop maps to. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Does the JavaScript Key Code Viewer need an app or a driver?
No installation, no extension and no driver. The JavaScript Key Code Viewer uses the browser's own device APIs and begins as soon as the page loads, so there is nothing to press first. Press Reset at any point to start over with a clean slate.

Related device tests tools

All 53
01

Keyboard Test

Test keyboard keys, inspect repeated inputs and review a local test summary. Get clear…

02

Online Keyboard Tester

A full-size keyboard tester that runs in the browser with nothing to install. Every key you…

03

TKL Keyboard Test

Tests a tenkeyless keyboard — the full layout minus the number pad — including the function…

04

60% Keyboard Test

Tests a compact 60% or 65% keyboard: the alphanumeric block, modifiers and arrows, without the…

05

Numpad Test

Tests every key on the number pad, including Num Lock, the operators and the separate Enter…

06

Arrow Key Test

Tests the four arrow keys on their own. Useful when only the direction keys have stopped…

07

Function Key Test

Tests the F1 to F12 row and shows which keys your browser intercepts before the page can see…

08

Modifier Key Test

Tests Shift, Ctrl, Alt, Meta, Caps Lock, Tab and Escape, telling the left and right versions…

09

Key Rollover Test (NKRO)

Measures how many keys your keyboard can register at once. Membrane boards usually stop at…

10

Keyboard Ghosting Test

Hold real gaming and typing combinations together and see whether every key arrives — or one…