ASCII reference at a glance
The ASCII (American Standard Code for Information Interchange) table maps the integers 0 through 127 to characters: control codes, digits, uppercase and lowercase letters, and punctuation. This tool renders all 128 standard code points plus the extended 128-255 range, with each value shown in decimal, hexadecimal, octal and binary so you can convert between bases at a glance.
How it works
Every code point n is converted with the standard base routines:
n.toString(16) for hex, n.toString(8) for octal and n.toString(2) for
binary, then zero-padded to a fixed width. The printable glyph comes from
String.fromCharCode(n). For control characters (0-31 and 127) there is no
visible glyph, so the table substitutes the conventional three-letter
abbreviation such as LF, CR or ESC. The search box matches a row when your
query equals its decimal value, equals its two-digit hex code, or appears in the
character name.
The structure of the standard 128-character set
ASCII’s 128 characters divide into three logical groups:
Control characters (0–31 and 127): Non-printing codes inherited from teletype machines. They control data flow and device behaviour rather than displaying a glyph. Examples: NUL (0) terminates C strings; LF (10) is the Unix newline; CR (13) is the Windows half of CR LF line endings; ESC (27) introduces ANSI terminal escape sequences; DEL (127) was originally used to erase a character on paper tape.
Printable ASCII (32–126): Space (32) is the first printable character. Then come punctuation and symbol characters, the digits 0–9 (48–57), more punctuation, uppercase A–Z (65–90), more punctuation, and lowercase a–z (97–122), finishing with tilde (126). This ordering was chosen to make comparisons and sorting numerically predictable.
Extended ASCII (128–255): Not part of the original ASCII standard. Values above 127 vary by code page — Latin-1 (ISO-8859-1), Windows-1252, and others assign different characters to these positions. They are not universally portable; Unicode (and specifically UTF-8) provides the modern replacement.
Hidden patterns worth knowing
Case conversion is bit flipping. Uppercase and lowercase letters differ by
exactly 32 — or equivalently, by bit 5. Uppercase A is 65 (0100 0001);
lowercase a is 97 (0110 0001). Setting bit 5 lowercases a letter; clearing it
uppercases it. This is why old C code can case-convert with a single bitwise OR
or AND.
Digit encoding is offset by 48. The character '0' is decimal 48, '1' is 49,
and so on through '9' at 57. To get the numeric value of a digit character,
subtract 48 (or in hex, subtract 0x30). This relationship is exploited in
virtually every parser ever written in C or C++.
Hex digits are contiguous in two blocks. Decimal digits occupy 48–57, then uppercase A–F for hex are 65–70, and lowercase a–f are 97–102. Knowing the offsets makes hand-decoding hex values fast.
Tips and examples
- Letter
Ais decimal 65, hex0x41, octal101, binary01000001. - Lowercase letters are exactly 32 greater than their uppercase counterparts, so
ais 97 — that constant 32 gap is why flipping bit 5 toggles case. - The digits
0–9occupy 48–57, which is why subtracting 48 from a digit character gives its numeric value. - Use the Range selector set to “Control characters” to study the C0 control set used by terminals and serial protocols.