Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

JavaScript Keycode Finder

Press a key: get its key, code and keyCode, plus listener code ready to paste.

Developer No upload Works offline Free, no sign-up

Keys pressed while this box has focus are shown below. With “Block browser shortcuts” on, Ctrl, ⌘, Alt and function-key combinations do nothing else here, except the few no page can block (such as Ctrl + W). Tab still moves on.

event.key Press any key
—event.code
—event.keyCode (legacy)
—event.location
  • Ctrl : off
  • Shift : off
  • Alt / Option : off
  • Meta (⌘ / Win) : off
  • Caps Lock : off
  • Num Lock : off
  • AltGr : off

A key value, a code value, a single character or a common name such as Esc or Cmd.

Key, code and keyCode reference

key valueTypical use
Special
Unidentified This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints. VK_UNDEFINED
Modifier keys
Alt The Alt (Alternative) key. This key enables the alternate modifier function for interpreting concurrent or subsequent keyboard input. This key value is also used for the Apple Option key.
AltGraph The Alternate Graphics (AltGr or AltGraph) key. This key is used enable the ISO Level 3 shift modifier (the standard Shift key is the level 2 modifier).
CapsLock The Caps Lock (Capital) key. Toggle capital character lock function for interpreting subsequent keyboard input event.
Control The Control or Ctrl key, to enable control modifier function for interpreting concurrent or subsequent keyboard input.
Fnoptional The Function switch Fn key. Activating this key simultaneously with another key changes that key’s value to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events.
FnLockoptional The Function-Lock (FnLock or F-Lock) key. Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events.
Meta The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input. This key value is used for the Windows Logo key and the Apple Command or ⌘ key.
NumLock The NumLock or Number Lock key, to toggle numpad mode function for interpreting subsequent keyboard input.
ScrollLock The Scroll Lock key, to toggle between scrolling and cursor movement modes.
Shift The Shift key, to enable shift modifier function for interpreting concurrent or subsequent keyboard input.
Symboloptional The Symbol modifier key (used on some virtual keyboards).
SymbolLockoptional The Symbol Lock key.
Hyperoptional The Hyper key.
Superoptional The Super key.
Whitespace keys
Enter The Enter or ↵ key, to activate current selection or accept current input. This key value is also used for the Return (Macintosh numpad) key. This key value is also used for the Android KEYCODE_DPAD_CENTER. VK_SELECT
Tab The Horizontal Tabulation Tab key.
Navigation keys
ArrowDown The down arrow key, to navigate or traverse downward. KEYCODE_DPAD_DOWN
ArrowLeft The left arrow key, to navigate or traverse leftward. KEYCODE_DPAD_LEFT
ArrowRight The right arrow key, to navigate or traverse rightward. KEYCODE_DPAD_RIGHT
ArrowUp The up arrow key, to navigate or traverse upward. KEYCODE_DPAD_UP
End The End key, used with keyboard entry to go to the end of content. KEYCODE_MOVE_END, VK_GO_TO_END
Home The Home key, used with keyboard entry, to go to start of content. For the mobile phone Home key (which goes to the phone’s main screen), use "GoHome". KEYCODE_MOVE_HOME, VK_GO_TO_START
PageDown The Page Down key, to scroll down or display next page of content.
PageUp The Page Up key, to scroll up or display previous page of content.
Editing keys
Backspace The Backspace key. This key value is also used for the key labeled Delete on MacOS keyboards.
Clearoptional Remove the currently selected input.
Copyoptional Copy the current selection. APPCOMMAND_COPY
CrSeloptional The Cursor Select (Crsel) key.
Cutoptional Cut the current selection. APPCOMMAND_CUT
Delete The Delete (Del) Key. This key value is also used for the key labeled Delete on MacOS keyboards when modified by the Fn key.
EraseEofoptional The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the current field.
ExSeloptional The Extend Selection (Exsel) key.
Insert The Insert (Ins) key, to toggle between text modes for insertion or overtyping. KEYCODE_INSERT
Pasteoptional The Paste key. APPCOMMAND_PASTE
Redooptional Redo the last action. APPCOMMAND_REDO
Undooptional Undo the last action. APPCOMMAND_UNDO
UI keys
Acceptoptional The Accept (Commit, OK) key. Accept current option or input method sequence conversion.
Againoptional The Again key, to redo or repeat an action.
Attnoptional The Attention (Attn) key.
Canceloptional The Cancel key.
ContextMenu Show the application’s context menu. This key is commonly found between the right Meta key and the right Control key. VK_MENU
Escape The Esc key. This key was originally used to initiate an escape sequence, but is now more generally used to exit or "escape" the current context, such as closing a dialog or exiting full screen mode.
Executeoptional The Execute key.
Findoptional Open the Find dialog. APPCOMMAND_FIND
Help Open a help dialog or toggle display of help information. APPCOMMAND_HELP, KEYCODE_HELP
Pause Pause the current state or application (as appropriate). Do not use this value for the Pause button on media controllers. Use "MediaPause" instead.
Playoptional Play or resume the current state or application (as appropriate). Do not use this value for the Play button on media controllers. Use "MediaPlay" instead.
Propsoptional The properties (Props) key.
Selectoptional The Select key.
ZoomInoptional The ZoomIn key. KEYCODE_ZOOM_IN
ZoomOutoptional The ZoomOut key. KEYCODE_ZOOM_OUT
Device keys
BrightnessDownoptional The Brightness Down key. Typically controls the display brightness. KEYCODE_BRIGHTNESS_DOWN
BrightnessUpoptional The Brightness Up key. Typically controls the display brightness. KEYCODE_BRIGHTNESS_UP
Ejectoptional Toggle removable media to eject (open) and insert (close) state. KEYCODE_MEDIA_EJECT, VK_EJECT_TOGGLE
LogOffoptional The LogOff key.
Poweroptional Toggle power state. Note: Some devices might not expose this key to the operating environment. KEYCODE_POWER, VK_POWER
PowerOffoptional The PowerOff key. Sometime called PowerDown.
PrintScreen The Print Screen or SnapShot key, to initiate print-screen function.
Hibernateoptional The Hibernate key. This key saves the current state of the computer to disk so that it can be restored. The computer will then shutdown.
Standbyoptional The Standby key. This key turns off the display and places the computer into a low-power mode without completely shutting down. It is sometimes labelled Suspend or Sleep key. KEYCODE_SLEEP
WakeUpoptional The WakeUp key. KEYCODE_WAKEUP
IME and composition keys
AllCandidatesoptional The All Candidates key, to initiate the multi-candidate mode.
Alphanumericoptional The Alphanumeric key.
CodeInputoptional The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points.
Composeoptional The Compose key, also known as Multi_key on the X Window System. This key acts in a manner similar to a dead key, triggering a mode where subsequent key presses are combined to produce a different character.
Convertoptional The Convert key, to convert the current input method sequence.
Deadoptional A dead key combining key. It may be any combining key from any keyboard layout. For example, on a PC/AT French keyboard, using a French mapping and without any modifier activated, this is the key value U+0302 COMBINING CIRCUMFLEX ACCENT. In another layout this might be a different unicode combining key. For applications that need to differentiate between specific combining characters, the associated compositionupdate event’s data attribute provides the specific key value.
FinalModeoptional The Final Mode Final key used on some Asian keyboards, to enable the final mode for IMEs.
GroupFirstoptional Switch to the first character group. (ISO/IEC 9995)
GroupLastoptional Switch to the last character group. (ISO/IEC 9995)
GroupNextoptional Switch to the next character group. (ISO/IEC 9995)
GroupPreviousoptional Switch to the previous character group. (ISO/IEC 9995)
ModeChangeoptional The Mode Change key, to toggle between or cycle through input modes of IMEs.
NextCandidateoptional The Next Candidate function key.
NonConvertoptional The NonConvert ("Don’t Convert") key, to accept current input method sequence without conversion in IMEs.
PreviousCandidateoptional The Previous Candidate function key.
Processoptional The Process key.
SingleCandidateoptional The Single Candidate function key.
HangulModeoptional The Hangul (Korean characters) Mode key, to toggle between Hangul and English modes.
HanjaModeoptional The Hanja (Korean characters) Mode key.
JunjaModeoptional The Junja (Korean characters) Mode key.
Eisuoptional The Eisu key. This key may close the IME, but its purpose is defined by the current IME. KEYCODE_EISU
Hankakuoptional The (Half-Width) Characters key.
Hiraganaoptional The Hiragana (Japanese Kana characters) key.
HiraganaKatakanaoptional The Hiragana/Katakana toggle key. KEYCODE_KATAKANA_HIRAGANA
KanaModeoptional The Kana Mode (Kana Lock) key. This key is used to enter hiragana mode (typically from romaji mode).
KanjiModeoptional The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key. This key is typically used to switch to a hiragana keyboard for the purpose of converting input into kanji. KEYCODE_KANA
Katakanaoptional The Katakana (Japanese Kana characters) key.
Romajioptional The Roman characters function key.
Zenkakuoptional The Zenkaku (Full-Width) Characters key.
ZenkakuHankakuoptional The Zenkaku/Hankaku (full-width/half-width) toggle key. KEYCODE_ZENKAKU_HANKAKU
Function keys
F1 The F1 key, a general purpose function key, as index 1.
F2 The F2 key, a general purpose function key, as index 2.
F3 The F3 key, a general purpose function key, as index 3.
F4 The F4 key, a general purpose function key, as index 4.
F5 The F5 key, a general purpose function key, as index 5.
F6 The F6 key, a general purpose function key, as index 6.
F7 The F7 key, a general purpose function key, as index 7.
F8 The F8 key, a general purpose function key, as index 8.
F9 The F9 key, a general purpose function key, as index 9.
F10 The F10 key, a general purpose function key, as index 10.
F11 The F11 key, a general purpose function key, as index 11.
F12 The F12 key, a general purpose function key, as index 12.
Soft1optional General purpose virtual function key, as index 1.
Soft2optional General purpose virtual function key, as index 2.
Soft3optional General purpose virtual function key, as index 3.
Soft4optional General purpose virtual function key, as index 4.
Multimedia keys
ChannelDownoptional Select next (numerically or logically) lower channel. APPCOMMAND_MEDIA_CHANNEL_DOWN, KEYCODE_CHANNEL_DOWN, VK_CHANNEL_DOWN
ChannelUpoptional Select next (numerically or logically) higher channel. APPCOMMAND_MEDIA_CHANNEL_UP, KEYCODE_CHANNEL_UP, VK_CHANNEL_UP
Closeoptional Close the current document or message (Note: This doesn’t close the application). APPCOMMAND_CLOSE
MailForwardoptional Open an editor to forward the current message. APPCOMMAND_FORWARD_MAIL
MailReplyoptional Open an editor to reply to the current message. APPCOMMAND_REPLY_TO_MAIL
MailSendoptional Send the current message. APPCOMMAND_SEND_MAIL
MediaCloseoptional Close the current media, for example to close a CD or DVD tray. KEYCODE_MEDIA_CLOSE
MediaFastForwardoptional Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. APPCOMMAND_MEDIA_FAST_FORWARD, KEYCODE_MEDIA_FAST_FORWARD, VK_FAST_FWD
MediaPauseoptional Pause the currently playing media. Media controller devices should use this value rather than "Pause" for their pause keys. APPCOMMAND_MEDIA_PAUSE, KEYCODE_MEDIA_PAUSE, VK_PAUSE
MediaPlayoptional Initiate or continue media playback at normal speed, if not currently playing at normal speed. APPCOMMAND_MEDIA_PLAY, KEYCODE_MEDIA_PLAY, VK_PLAY
MediaPlayPauseoptional Toggle media between play and pause states. APPCOMMAND_MEDIA_PLAY_PAUSE, KEYCODE_MEDIA_PLAY_PAUSE, VK_PLAY_PAUSE
MediaRecordoptional Initiate or resume recording of currently selected media. APPCOMMAND_MEDIA_RECORD, KEYCODE_MEDIA_RECORD, VK_RECORD
MediaRewindoptional Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. APPCOMMAND_MEDIA_REWIND, KEYCODE_MEDIA_REWIND, VK_REWIND
MediaStopoptional Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. APPCOMMAND_MEDIA_STOP, KEYCODE_MEDIA_STOP, VK_STOP
MediaTrackNextoptional Seek to next media or program track. APPCOMMAND_MEDIA_NEXTTRACK, KEYCODE_MEDIA_NEXT, VK_TRACK_NEXT
MediaTrackPreviousoptional Seek to previous media or program track. APPCOMMAND_MEDIA_PREVIOUSTRACK, KEYCODE_MEDIA_PREVIOUS, VK_TRACK_PREV
Newoptional Open a new document or message. APPCOMMAND_NEW
Openoptional Open an existing document or message. APPCOMMAND_OPEN
Printoptional Print the current document or message. APPCOMMAND_PRINT
Saveoptional Save the current document or message. APPCOMMAND_SAVE
SpellCheckoptional Spellcheck the current document or selection. APPCOMMAND_SPELL_CHECK
Multimedia numpad keys
Key11optional The 11 key found on media numpads that have buttons from 1.. 12.
Key12optional The 12 key found on media numpads that have buttons from 1.. 12.
Audio keys
AudioBalanceLeftoptional Adjust audio balance leftward. VK_AUDIO_BALANCE_LEFT
AudioBalanceRightoptional Adjust audio balance rightward. VK_AUDIO_BALANCE_RIGHT
AudioBassBoostDownoptional Decrease audio bass boost or cycle down through bass boost states. APPCOMMAND_BASS_DOWN, VK_BASS_BOOST_DOWN
AudioBassBoostToggleoptional Toggle bass boost on/off. APPCOMMAND_BASS_BOOST
AudioBassBoostUpoptional Increase audio bass boost or cycle up through bass boost states. APPCOMMAND_BASS_UP, VK_BASS_BOOST_UP
AudioFaderFrontoptional Adjust audio fader towards front. VK_FADER_FRONT
AudioFaderRearoptional Adjust audio fader towards rear. VK_FADER_REAR
AudioSurroundModeNextoptional Advance surround audio mode to next available mode. VK_SURROUND_MODE_NEXT
AudioTrebleDownoptional Decrease treble. APPCOMMAND_TREBLE_DOWN
AudioTrebleUpoptional Increase treble. APPCOMMAND_TREBLE_UP
AudioVolumeDownoptional Decrease audio volume. APPCOMMAND_VOLUME_DOWN, KEYCODE_VOLUME_DOWN, VK_VOLUME_DOWN
AudioVolumeUpoptional Increase audio volume. APPCOMMAND_VOLUME_UP, KEYCODE_VOLUME_UP, VK_VOLUME_UP
AudioVolumeMuteoptional Toggle between muted state and prior volume level. APPCOMMAND_VOLUME_MUTE, KEYCODE_VOLUME_MUTE, VK_VOLUME_MUTE
MicrophoneToggleoptional Toggle the microphone on/off. APPCOMMAND_MIC_ON_OFF_TOGGLE
MicrophoneVolumeDownoptional Decrease microphone volume. APPCOMMAND_MICROPHONE_VOLUME_DOWN
MicrophoneVolumeUpoptional Increase microphone volume. APPCOMMAND_MICROPHONE_VOLUME_UP
MicrophoneVolumeMuteoptional Mute the microphone. APPCOMMAND_MICROPHONE_VOLUME_MUTE, KEYCODE_MUTE
Speech keys
SpeechCorrectionListoptional Show correction list when a word is incorrectly identified. APPCOMMAND_CORRECTION_LIST
SpeechInputToggleoptional Toggle between dictation mode and command/control mode. APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE
Application keys
LaunchApplication1optional The first generic "LaunchApplication" key. This is commonly associated with launching "My Computer", and may have a computer symbol on the key. APPCOMMAND_LAUNCH_APP1
LaunchApplication2optional The second generic "LaunchApplication" key. This is commonly associated with launching "Calculator", and may have a calculator symbol on the key. APPCOMMAND_LAUNCH_APP2, KEYCODE_CALCULATOR
LaunchCalendaroptional The "Calendar" key. KEYCODE_CALENDAR
LaunchContactsoptional The "Contacts" key. KEYCODE_CONTACTS
LaunchMailoptional The "Mail" key. APPCOMMAND_LAUNCH_MAIL
LaunchMediaPlayeroptional The "Media Player" key. APPCOMMAND_LAUNCH_MEDIA_SELECT
LaunchMusicPlayeroptional The "Music Player" key.
LaunchPhoneoptional The "Phone" key.
LaunchScreenSaveroptional The "Screen Saver" key.
LaunchSpreadsheetoptional The "Spreadsheet" key.
LaunchWebBrowseroptional The "Web Browser" key.
LaunchWebCamoptional The "WebCam" key.
LaunchWordProcessoroptional The "Word Processor" key.
Browser keys
BrowserBackoptional Navigate to previous content or page in current history. APPCOMMAND_BROWSER_BACKWARD, VK_BACK
BrowserFavoritesoptional Open the list of browser favorites. APPCOMMAND_BROWSER_FAVORITES
BrowserForwardoptional Navigate to next content or page in current history. APPCOMMAND_BROWSER_FORWARD, VK_FORWARD
BrowserHomeoptional Go to the user’s preferred home page. APPCOMMAND_BROWSER_HOME
BrowserRefreshoptional Refresh the current page or content. APPCOMMAND_BROWSER_REFRESH
BrowserSearchoptional Call up the user’s preferred search page. APPCOMMAND_BROWSER_SEARCH
BrowserStopoptional Stop loading the current page or content. APPCOMMAND_BROWSER_STOP
Mobile phone keys
AppSwitchoptional The Application switch key, which provides a list of recent apps to switch between. KEYCODE_APP_SWITCH
Calloptional The Call key. KEYCODE_CALL
Cameraoptional The Camera key. KEYCODE_CAMERA
CameraFocusoptional The Camera focus key. KEYCODE_FOCUS
EndCalloptional The End Call key. KEYCODE_ENDCALL
GoBackoptional The Back key. KEYCODE_BACK
GoHomeoptional The Home key, which goes to the phone’s main screen. KEYCODE_HOME
HeadsetHookoptional The Headset Hook key. KEYCODE_HEADSETHOOK
LastNumberRedialoptional The Last Number Redial key.
Notificationoptional The Notification key. KEYCODE_NOTIFICATION
MannerModeoptional Toggle between manner mode state: silent, vibrate, ring,.. KEYCODE_MANNER_MODE
VoiceDialoptional The Voice Dial key.
TV keys
TVoptional Switch to viewing TV. KEYCODE_TV
TV3DModeoptional TV 3D Mode. KEYCODE_3D_MODE
TVAntennaCableoptional Toggle between antenna and cable input. KEYCODE_TV_ANTENNA_CABLE
TVAudioDescriptionoptional Audio description. KEYCODE_TV_AUDIO_DESCRIPTION
TVAudioDescriptionMixDownoptional Audio description mixing volume down. KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN
TVAudioDescriptionMixUpoptional Audio description mixing volume up. KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP
TVContentsMenuoptional Contents menu. KEYCODE_TV_CONTENTS_MENU
TVDataServiceoptional Contents menu. KEYCODE_TV_DATA_SERVICE
TVInputoptional Switch the input mode on an external TV. KEYCODE_TV_INPUT
TVInputComponent1optional Switch to component input #1. KEYCODE_TV_INPUT_COMPONENT_1
TVInputComponent2optional Switch to component input #2. KEYCODE_TV_INPUT_COMPONENT_2
TVInputComposite1optional Switch to composite input #1. KEYCODE_TV_INPUT_COMPOSITE_1
TVInputComposite2optional Switch to composite input #2. KEYCODE_TV_INPUT_COMPOSITE_2
TVInputHDMI1optional Switch to HDMI input #1. KEYCODE_TV_INPUT_HDMI_1
TVInputHDMI2optional Switch to HDMI input #2. KEYCODE_TV_INPUT_HDMI_2
TVInputHDMI3optional Switch to HDMI input #3. KEYCODE_TV_INPUT_HDMI_3
TVInputHDMI4optional Switch to HDMI input #4. KEYCODE_TV_INPUT_HDMI_4
TVInputVGA1optional Switch to VGA input #1. KEYCODE_TV_INPUT_VGA_1
TVMediaContextoptional Media context menu. KEYCODE_TV_MEDIA_CONTEXT_MENU
TVNetworkoptional Toggle network. KEYCODE_TV_NETWORK
TVNumberEntryoptional Number entry. KEYCODE_TV_NUMBER_ENTRY
TVPoweroptional Toggle the power on an external TV. KEYCODE_TV_POWER
TVRadioServiceoptional Radio. KEYCODE_TV_RADIO_SERVICE
TVSatelliteoptional Satellite. KEYCODE_TV_SATELLITE
TVSatelliteBSoptional Broadcast Satellite. KEYCODE_TV_SATELLITE_BS
TVSatelliteCSoptional Communication Satellite. KEYCODE_TV_SATELLITE_CS
TVSatelliteToggleoptional Toggle between available satellites. KEYCODE_TV_SATELLITE_SERVICE
TVTerrestrialAnalogoptional Analog Terrestrial. KEYCODE_TV_TERRESTRIAL_ANALOG
TVTerrestrialDigitaloptional Digital Terrestrial. KEYCODE_TV_TERRESTRIAL_DIGITAL
TVTimeroptional Timer programming. KEYCODE_TV_TIMER_PROGRAMMING
Media controller keys
AVRInputoptional Switch the input mode on an external AVR (audio/video receiver). KEYCODE_AVR_INPUT
AVRPoweroptional Toggle the power on an external AVR (audio/video receiver). KEYCODE_AVR_POWER
ColorF0Redoptional General purpose color-coded media function key, as index 0 (red). VK_COLORED_KEY_0, KEYCODE_PROG_RED
ColorF1Greenoptional General purpose color-coded media function key, as index 1 (green). VK_COLORED_KEY_1, KEYCODE_PROG_GREEN
ColorF2Yellowoptional General purpose color-coded media function key, as index 2 (yellow). VK_COLORED_KEY_2, KEYCODE_PROG_YELLOW
ColorF3Blueoptional General purpose color-coded media function key, as index 3 (blue). VK_COLORED_KEY_3, KEYCODE_PROG_BLUE
ColorF4Greyoptional General purpose color-coded media function key, as index 4 (grey). VK_COLORED_KEY_4
ColorF5Brownoptional General purpose color-coded media function key, as index 5 (brown). VK_COLORED_KEY_5
ClosedCaptionToggleoptional Toggle the display of Closed Captions. VK_CC, KEYCODE_CAPTIONS
Dimmeroptional Adjust brightness of device, by toggling between or cycling through states. VK_DIMMER
DisplaySwapoptional Swap video sources. VK_DISPLAY_SWAP
DVRoptional Select Digital Video Rrecorder. KEYCODE_DVR
Exitoptional Exit the current application. VK_EXIT
FavoriteClear0optional Clear program or content stored as favorite 0. VK_CLEAR_FAVORITE_0
FavoriteClear1optional Clear program or content stored as favorite 1. VK_CLEAR_FAVORITE_1
FavoriteClear2optional Clear program or content stored as favorite 2. VK_CLEAR_FAVORITE_2
FavoriteClear3optional Clear program or content stored as favorite 3. VK_CLEAR_FAVORITE_3
FavoriteRecall0optional Select (recall) program or content stored as favorite 0. VK_RECALL_FAVORITE_0
FavoriteRecall1optional Select (recall) program or content stored as favorite 1. VK_RECALL_FAVORITE_1
FavoriteRecall2optional Select (recall) program or content stored as favorite 2. VK_RECALL_FAVORITE_2
FavoriteRecall3optional Select (recall) program or content stored as favorite 3. VK_RECALL_FAVORITE_3
FavoriteStore0optional Store current program or content as favorite 0. VK_STORE_FAVORITE_0
FavoriteStore1optional Store current program or content as favorite 1. VK_STORE_FAVORITE_1
FavoriteStore2optional Store current program or content as favorite 2. VK_STORE_FAVORITE_2
FavoriteStore3optional Store current program or content as favorite 3. VK_STORE_FAVORITE_3
Guideoptional Toggle display of program or content guide. VK_GUIDE, KEYCODE_GUIDE
GuideNextDayoptional If guide is active and displayed, then display next day’s content. VK_NEXT_DAY
GuidePreviousDayoptional If guide is active and displayed, then display previous day’s content. VK_PREV_DAY
Infooptional Toggle display of information about currently selected context or media. VK_INFO, KEYCODE_INFO
InstantReplayoptional Toggle instant replay. VK_INSTANT_REPLAY
Linkoptional Launch linked content, if available and appropriate. VK_LINK
ListProgramoptional List the current program. VK_LIST
LiveContentoptional Toggle display listing of currently available live content or programs. VK_LIVE
Lockoptional Lock or unlock current content or program. VK_LOCK
MediaAppsoptional Show a list of media applications: audio/video players and image viewers. Do not confuse this key value with the Windows' VK_APPS / VK_CONTEXT_MENU key, which is encoded as "ContextMenu". VK_APPS
MediaAudioTrackoptional Audio track key. KEYCODE_MEDIA_AUDIO_TRACK
MediaLastoptional Select previously selected channel or media. VK_LAST, KEYCODE_LAST_CHANNEL
MediaSkipBackwardoptional Skip backward to next content or program. KEYCODE_MEDIA_SKIP_BACKWARD
MediaSkipForwardoptional Skip forward to next content or program. VK_SKIP, KEYCODE_MEDIA_SKIP_FORWARD
MediaStepBackwardoptional Step backward to next content or program. KEYCODE_MEDIA_STEP_BACKWARD
MediaStepForwardoptional Step forward to next content or program. KEYCODE_MEDIA_STEP_FORWARD
MediaTopMenuoptional Media top menu. KEYCODE_MEDIA_TOP_MENU
NavigateInoptional Navigate in. KEYCODE_NAVIGATE_IN
NavigateNextoptional Navigate to next key. KEYCODE_NAVIGATE_NEXT
NavigateOutoptional Navigate out. KEYCODE_NAVIGATE_OUT
NavigatePreviousoptional Navigate to previous key. KEYCODE_NAVIGATE_PREVIOUS
NextFavoriteChanneloptional Cycle to next favorite channel (in favorites list). VK_NEXT_FAVORITE_CHANNEL
NextUserProfileoptional Cycle to next user profile (if there are multiple user profiles). VK_USER
OnDemandoptional Access on-demand content or programs. VK_ON_DEMAND
Pairingoptional Pairing key to pair devices. KEYCODE_PAIRING
PinPDownoptional Move picture-in-picture window down. VK_PINP_DOWN
PinPMoveoptional Move picture-in-picture window. VK_PINP_MOVE
PinPToggleoptional Toggle display of picture-in-picture window. VK_PINP_TOGGLE
PinPUpoptional Move picture-in-picture window up. VK_PINP_UP
PlaySpeedDownoptional Decrease media playback speed. VK_PLAY_SPEED_DOWN
PlaySpeedResetoptional Reset playback to normal speed. VK_PLAY_SPEED_RESET
PlaySpeedUpoptional Increase media playback speed. VK_PLAY_SPEED_UP
RandomToggleoptional Toggle random media or content shuffle mode. VK_RANDOM_TOGGLE
RcLowBatteryoptional Not a physical key, but this key code is sent when the remote control battery is low. VK_RC_LOW_BATTERY
RecordSpeedNextoptional Toggle or cycle between media recording speeds. VK_RECORD_SPEED_NEXT
RfBypassoptional Toggle RF (radio frequency) input bypass mode (pass RF input directly to the RF output). VK_RF_BYPASS
ScanChannelsToggleoptional Toggle scan channels mode. VK_SCAN_CHANNELS_TOGGLE
ScreenModeNextoptional Advance display screen mode to next available mode. VK_SCREEN_MODE_NEXT
Settingsoptional Toggle display of device settings screen. VK_SETTINGS, KEYCODE_SETTINGS
SplitScreenToggleoptional Toggle split screen mode. VK_SPLIT_SCREEN_TOGGLE
STBInputoptional Switch the input mode on an external STB (set top box). KEYCODE_STB_INPUT
STBPoweroptional Toggle the power on an external STB (set top box). KEYCODE_STB_POWER
Subtitleoptional Toggle display of subtitles, if available. VK_SUBTITLE
Teletextoptional Toggle display of teletext, if available. VK_TELETEXT, KEYCODE_TV_TELETEXT
VideoModeNextoptional Advance video mode to next available mode. VK_VIDEO_MODE_NEXT
Winkoptional Cause device to identify itself in some manner, e.g., audibly or visibly. VK_WINK
ZoomToggleoptional Toggle between full-screen and scaled content, or alter magnification level. VK_ZOOM, KEYCODE_TV_ZOOM_MODE

* keyCode: the number Chrome, Edge and Safari report on a US layout (Windows virtual-key codes); Firefox reports 59, 61 and 173 for the ; = and - keys. “optional” marks values the specification does not require browsers to support. The key and code tables are taken from the W3C Recommendations UI Events KeyboardEvent key Values and UI Events KeyboardEvent code Values (notes shortened). Copyright © 2025 World Wide Web Consortium, under the W3C Software and Document License.

Next steps

About the JavaScript Keycode Finder

Press any key and see exactly what the browser’s keydown event reports: event.key (the character or key name your layout produces), event.code (the physical key), the legacy keyCode and which, location (left, right or numpad), the modifier and lock keys, repeat and isComposing. Every press also gives you listener code to paste — JavaScript, TypeScript or a React hook — with the right modifier checks, and the matching aria-keyshortcuts value.

Below the tester are searchable tables of every key and code value in the W3C specifications and of the legacy keyCode numbers, so you can look up keys you cannot press: media keys, F13–F24, Japanese and Korean keys. Notes explain what is unusual about each event — input methods and keyCode 229, dead keys, layouts such as AZERTY, the numpad, AltGr and Option.

How to use it

  1. Click the Press a key box (or Tab to it) and press a key or a combination such as Ctrl + S.
  2. Read event.key, event.code and keyCode at the top and every property in the table below; Notes explain anything surprising about that key.
  3. Choose how the listener code should match the key (by key, code or the legacy keyCode), the event, where to listen and the language, then press Copy.
  4. For a key you cannot press, type its name (Enter, F13, MediaPlayPause, KeyQ…) under Look up a key, or search the reference tables.

Examples

Enter
Input
Press Enter
Result
key "Enter" · code "Enter" · keyCode 13 · location 0

The Enter key on the numeric keypad gives the same key and keyCode, but code "NumpadEnter" and location 3.

A on a French (AZERTY) keyboard
Input
Press the key labelled A
Result
key "a" · code "KeyQ" · keyCode 65

code names the position the key has on a US keyboard; key is what your layout types.

Ctrl + S
Input
Press Ctrl + S
Result
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') {
  event.preventDefault();
  // Ctrl + S or ⌘ + S was pressed
}

Testing Ctrl or ⌘ covers Windows, Linux and Mac; toLowerCase() keeps the shortcut working with Caps Lock on.

Typing with an input method
Input
Type with a Japanese IME, or on an Android phone keyboard
Result
key "Process" or "Unidentified" · keyCode 229 · isComposing true

Skip such keydown events in shortcuts and read the text from the input or compositionend event.

Common uses

  • Finding the key or code value to test in a keyboard shortcut, a game control or a custom input.
  • Debugging a shortcut that works on your keyboard but not on a colleague’s (layouts, Caps Lock, Option, AltGr).
  • Porting old code that compares keyCode numbers to event.key and event.code.
  • Checking what an IME or a phone keyboard sends before handling text input yourself.
  • Writing the aria-keyshortcuts value for a button that has a shortcut.

key, code or keyCode — which to use

  • **event.key** is what the key produces with the current layout and modifiers: a character ("a", "A", "é", " ") or a key name from the W3C list ("Enter", "ArrowUp", "Escape"). Use it for text and for shortcuts that should follow the letter printed on the key.
  • **event.code** names the physical key after its place on a US keyboard ("KeyA", "Digit1", "ShiftRight", "NumpadEnter"), whatever the layout. Use it for controls that depend on position, such as WASD in games.
  • **keyCode, which and charCode** are deprecated numbers kept for old scripts. The UI Events specification fixes only some of them (Enter 13, Escape 27, Space 32, the arrows 37–40, letters and digits by their ASCII codes); the rest follow Windows virtual-key codes, and a few differ between browsers — Firefox reports 59, 61 and 173 for ; = - where Chrome, Edge and Safari report 186, 187 and 189. Avoid them in new code.

Input methods, phone keyboards and keyCode 229

While an input method editor (IME) composes text — Japanese, Chinese or Korean input, and most phone keyboards — keydown events have key "Process" (or "Unidentified" on Android) and keyCode 229, and isComposing is true while a composition is open. Shortcuts should ignore those events: if (event.isComposing || event.keyCode === 229) return;. The text itself arrives in input events (event.data, event.inputType) and in compositionupdate and compositionend; the event log on this page shows that sequence when you type with an IME.

Keyboard layouts, AltGr and Option

code stays with the key’s position, so the key that types a on a French keyboard reports "KeyQ". key follows the layout, and Shift, AltGr and — on a Mac — Option change it: Shift + 1 types "!" on a US layout but "1" on a French one, and Option + S types "ß". On Windows, AltGr also sets both ctrlKey and altKey, so check event.getModifierState('AltGraph') before treating Ctrl + Alt as a shortcut. In Chrome and Edge the page also asks the Keyboard Map API (navigator.keyboard.getLayoutMap()) which character each key types on your layout.

aria-keyshortcuts

If a button or link has a keyboard shortcut, aria-keyshortcuts lets screen readers announce it. WAI-ARIA 1.2 asks for the modifier names of the key values specification (Control, Alt, Shift, Meta), modifiers first, and the key rather than the character Shift makes: Shift+5, not %. Use Plus for + and Space for the space bar. The tester writes the value for every combination you press.

Sources

Key and code values: the W3C Recommendations UI Events KeyboardEvent key Values and UI Events KeyboardEvent code Values; the tables on this page are taken from them under the W3C Software and Document License. Legacy keyCode rules and fixed values: W3C UI Events, §7.3 “Legacy key models”; the other numbers are Microsoft’s Windows virtual-key codes, and Firefox’s own values come from MDN’s keyCode reference. aria-keyshortcuts: WAI-ARIA 1.2.

Limitations

  • The page only sees keys that the operating system and the browser pass on: system shortcuts (Alt + Tab, ⌘ + Tab, Ctrl + Alt + Del), Fn and some media keys never arrive, and browsers keep Ctrl/⌘ + W, T and N for themselves.
  • Values come from your browser, keyboard and layout; another browser or system can report a different keyCode for the same key.
  • Phone and tablet keyboards often report key "Unidentified" and keyCode 229 for every key; the typed text is shown from the input event instead.
  • Keys chosen under Look up a key show the values a US keyboard typically sends, not a measurement.
  • Tab is never captured, so keyboard users can always leave the box; its values are shown before the focus moves on.

Privacy

Everything happens in your browser. Key presses are shown on this page only and kept in memory while it is open; nothing is sent or stored. Only your snippet options are remembered on this device.

Frequently asked questions

What is the keyCode for Enter?

13, for both Enter keys. In new code test event.key === 'Enter'; to tell the numpad Enter apart, check event.code === 'NumpadEnter' (or event.location === 3).

What is the difference between event.key and event.code?

key is what the key types with the current layout and modifiers ("a", "A", "Enter"). code is the physical key, named after its position on a US keyboard ("KeyA"); it does not change with the layout, Shift or Caps Lock.

Why is keyCode deprecated?

Its numbers were never standardised for most keys: browsers took them from Windows virtual-key codes, some differ (Firefox uses 59 for the semicolon key where others use 186), and they cannot describe other layouts. key and code are defined by W3C specifications and supported by all current browsers.

Why does my keydown event say keyCode 229 or key "Unidentified"?

An input method or an on-screen keyboard is handling the key — for example Japanese or Chinese input, or Gboard on Android. Ignore those keydown events in shortcuts and read the typed text from the input event.

How do I detect Ctrl + S (or ⌘ + S on a Mac)?

In a keydown listener: if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') { event.preventDefault(); … }. Press Ctrl + S in the tester to get the complete listener with the options you need.

How do I tell the left and right Shift keys apart?

event.code is "ShiftLeft" or "ShiftRight", and event.location is 1 (left) or 2 (right). The same works for Ctrl, Alt and Meta.

Is anything I type recorded?

No. Key presses are shown on this page and kept in memory only while it is open; nothing is uploaded or saved.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.