Decode an ASCII character
ASCII code
4 × 16 + 11 = 75.
How a code identifies a character
Standard ASCII assigns one of 128 positions to each character. In the RFC 20 chart, the high three bits give the column and the low four bits give the row. Four bits have 24 = 16 possible values, so the decimal code is 16 × column + row. For K, column 4 and row 11 give 16 × 4 + 11 = 75. Hexadecimal writes 11 as B, so the same position is 4B.
Read an instrument response byte by byte
A serial monitor might display the four hex bytes 4F 4B 0D 0A. The first two are the letters O and K. The last two are carriage return and line feed. If a device manual specifies that pair as its terminator, the response contains two letters followed by the end of the line. Choose hexadecimal and enter one pair at a time to inspect each position.
Find a character in the chart
Use the first hex digit to select a column. Use the second digit to select a row. For 3C, read down column 3x to row C to find the less-than sign. Its decimal code is 3 × 16 + 12 = 60. SP marks a space. The short labels in columns 0x and 1x name control characters.
| Low hex | 0x | 1x | 2x | 3x | 4x | 5x | 6x | 7x |
|---|---|---|---|---|---|---|---|---|
| 0 | NUL | DLE | SP | 0 | @ | P | ` | p |
| 1 | SOH | DC1 | ! | 1 | A | Q | a | q |
| 2 | STX | DC2 | " | 2 | B | R | b | r |
| 3 | ETX | DC3 | # | 3 | C | S | c | s |
| 4 | EOT | DC4 | $ | 4 | D | T | d | t |
| 5 | ENQ | NAK | % | 5 | E | U | e | u |
| 6 | ACK | SYN | & | 6 | F | V | f | v |
| 7 | BEL | ETB | ' | 7 | G | W | g | w |
| 8 | BS | CAN | ( | 8 | H | X | h | x |
| 9 | HT | EM | ) | 9 | I | Y | i | y |
| A | LF | SUB | * | : | J | Z | j | z |
| B | VT | ESC | + | ; | K | [ | k | { |
| C | FF | FS | , | < | L | \ | l | | |
| D | CR | GS | - | = | M | ] | m | } |
| E | SO | RS | . | > | N | ^ | n | ~ |
| F | SI | US | / | ? | O | _ | o | DEL |
Download the ASCII code chart table (PDF)
Questions about ASCII codes
Why does typing 0 give decimal 48?
In character mode, the glyph 0 has code 48 (hex 30). In decimal mode, the number zero selects NUL, which has no printed glyph. This distinction matters when equipment expects the text of a number over a serial connection.
How should I enter a hex value from a manual?
Choose hexadecimal and enter just the digits. For example, enter 1B for the value often written 0x1B. The result is ESC, decimal 27. Both uppercase and lowercase hex letters work.
Why does my byte viewer show eight binary digits?
ASCII uses seven bits. A byte viewer can add a leading zero to show an eight-bit byte. Both 01001011 and 1001011 represent K. A leading one in an eight-bit byte puts the value above 127.
What is the difference between CR and LF?
Carriage return is decimal 13, hex 0D. Line feed is decimal 10, hex 0A. A device protocol can specify one, the other or the two-byte sequence CR LF. Use the terminator named in the device manual.
How do I look up a blank space?
Enter a single space in character mode, or enter 20 in hexadecimal mode. Both select decimal 32. In contrast, the tab control is decimal 9 and appears as HT in the chart.
Why is an accented letter outside the range?
The seven-bit code has 128 positions. Characters such as é require another encoding. For bytes above 127, identify the encoding used by the sender before assigning a character.
Reference: RFC 20, ASCII Format for Network Interchange, sections 2–4.
Related Engineering Calculators
Continue exploring engineering
Find another tool, explore an animated mechanism, or browse resources by subject.