charCode
--
Free · Instant · No signup
Show charCode, hex, and a Key* guess from a typed character.
Page updated 2026-09-04.
charCode
--
Typing 'A' returns a charCode of 65, hex value 0x41, and a code guess of 'KeyA' -- the standard mapping between the uppercase letter A, its ASCII/Unicode code point, and the physical key it's commonly typed from on a QWERTY layout.
charCode (65) and the KeyboardEvent.code property ('KeyA') answer genuinely different questions: charCode reflects the character's Unicode value, while .code identifies the physical key position on the keyboard regardless of what character it produces -- which matters because .code stays 'KeyA' even on a non-QWERTY layout where that physical key produces a different letter.
0x41 is simply 65 expressed in hexadecimal (4 x 16 + 1 = 65) -- the same numeric value in a different base, useful when working with code that expects or displays character codes in hex rather than decimal.
Without a real keydown event this is limited to the character you type. This tool infers a plausible KeyboardEvent.code value from the character you typed, but the actual .code value in a real browser keydown event depends on the physical keyboard layout and hardware, which this text-input-based tool has no access to -- it's a reasonable guess for a standard QWERTY layout, not a guaranteed match to what a real keydown event would report.
In a real browser environment, capturing an actual keydown event (rather than inferring from typed text) would give you the definitive charCode, key, code, and keyCode values exactly as that specific browser and keyboard layout produce them -- useful context if this tool's guess needs to be verified against real event data.
Modifier keys, function keys, and non-printable keys (Escape, Tab, arrow keys) don't correspond to a typed character at all, so this text-based inspector can't represent them the way it represents printable characters like 'A'.
For building real keyboard-shortcut handling in an application, testing against actual KeyboardEvent objects in your target browsers is more reliable than inferring codes from typed characters the way this quick-reference tool does.
If ASCII/Unicode character codes more broadly (not tied to keyboard input specifically) are what you need, a general character-code reference table covers that without the keyboard-layout ambiguity this tool has.
charCode (65) is the Unicode/ASCII numeric value of the character itself. The .code property ('KeyA') identifies the physical key position on a standard keyboard, independent of what character that key actually produces -- on a different keyboard layout, the same physical key could produce a different letter while still reporting code 'KeyA'.
Without a real keydown event this is limited to the character you type. No, it's an inference based on a standard QWERTY layout assumption. The actual .code value from a real keydown event depends on the physical keyboard and layout in use, which this text-based tool can't detect.
They're the same number in different bases -- 0x41 is hexadecimal notation for the decimal value 65 (4 x 16 + 1 = 65), commonly used interchangeably in code that works with character codes.
Not directly, since those don't correspond to a typed printable character the way 'A' does. This tool is built around inferring codes from typed text, which doesn't extend to non-printable or modifier keys.
Not without verification. Without a real keydown event this is limited to the character you type. For reliable keyboard-shortcut handling, test against actual KeyboardEvent data in your target browsers rather than relying solely on this tool's inferred guess.
Basic Markdown to HTML Converter Tiny Markdown subset: headings, bold, emphasis, inline code, and line breaks.
Line Set Comparison Inspector Count added and removed lines and list lines that appear in only one side. Not an ordered diff.
CSS Flexbox Layout Code Generator Build flex-direction, justify-content, align-items, and gap CSS.
HTML Table Code Generator from Text/CSV Turn CSV rows into a <table> with a header row of th cells.