Skip to content
TechToolsHQ
NewsReviewsGuidesTech 101Tech SeriesToolsNewsletter
TechToolsHQ

Independent, research-driven tech coverage — breaking news, in-depth reviews, buying guides, and technical tutorials to help you understand and choose with confidence.

Explore
NewsReviewsGuidesTech 101Tech SeriesFree Tools
Legal
About UsOur AuthorsContact UsPrivacy PolicyTerms of ServiceCopyright & DMCAAffiliate DisclosureEditorial PolicyAdvertise With Us

© 2026 TechToolsHQ. All rights reserved.

Tools / JavaScript keycode & event inspector

JavaScript keycode & event inspector

Test physical keyboard events in real time. Inspects modern event.key and event.code properties, legacy numeric keyCode values, modifier states, and generates copy-paste event handling code.

Runs entirely in your browser

Loading tool…

About this tool

When handling keyboard input in JavaScript, you need to know exactly what a key press produces — and the properties involved have changed over the years. This inspector shows, in real time, the modern event.key and event.code values, the legacy numeric keyCode and which, and the state of modifier keys, for whatever key you press.

That removes the guesswork of building keyboard shortcuts and handlers. event.key gives the character, event.code gives the physical key regardless of layout, and the legacy values still matter for older code — seeing all of them at once tells you which to test against. It can also generate copy-paste event-handling code based on the key you pressed.

It runs entirely in your browser and does not send your keystrokes anywhere. Use it to build shortcuts, debug why a handler is not firing, or understand the difference between the various key properties.

Frequently asked questions

What does the keycode inspector show?
For each key press, the modern event.key and event.code, the legacy keyCode and which values, and the state of modifier keys — all in real time.
What is the difference between event.key and event.code?
event.key is the character produced (affected by layout and modifiers), while event.code identifies the physical key regardless of layout. Which to use depends on whether you care about the character or the physical position.
Should I still use keyCode?
keyCode is deprecated in favour of key and code, but you may encounter it in older code. The tool shows it so you can work with legacy handlers.
Are my keystrokes logged?
No. It runs in your browser and does not send your key presses anywhere.

Enjoying JavaScript keycode & event inspector?

TechToolsHQ is an independent, reader-supported tech platform. If this free tool saved you time, solved a problem, or helped your workflow, consider supporting our work. Your support helps us keep our utilities 100% free, private, and ad-free for everyone.

100% optional · Reader supported · Independent researchSupport our work

Related tools

  • .gitignore generatorCombine curated .gitignore rules for Node, Python, Rust, Go, macOS, and IDEs.
  • Conventional commits & git message builderBuild standardized Conventional Commits 1.0.0 messages with scopes, breaking changes, and CLI commands.
  • Open-source license generatorGenerate MIT, Apache 2.0, GPL, and BSD open-source license files for your GitHub repositories.
  • Changelog generator & markdown formatterFormat standard CHANGELOG.md files following the Keep A Changelog and SemVer standards.
  • GitHub Actions workflow generatorVisual builder for GitHub Actions CI/CD workflows, runners, matrices, and caches.
  • GitHub issue & PR template builderCreate standardized YAML issue forms and Pull Request templates for repositories.

Browse all tools