Reference:ASCII Table
From CoderGuide
ASCII Table
Where you see a '\x' sequence, that is the C escape sequence for that character. It also happens to be used a lot in other languages, including Perl, and the Unix shells (in certain places). Codes 0-31 are special control characters. Characters beyond 127 are not defined by the ASCII standard, and are used to represent different characters depending on the character set. Where you see ^X is the control sequence for that character, in other words, holding down CTRL-X would be ^X. You'll see these sequences if trying to edit a binary file with something like Vim, and in other places.
| Value | Symbol | ^n | Value | Symbol | Value | Symbol | Value | Symbol |
|---|---|---|---|---|---|---|---|---|
| 0 | NUL '\0' | ^@ | 32 | SPACE | 64 | @ | 96 | ` |
| 1 | SOH | ^A | 33 | ! | 65 | A | 97 | a |
| 2 | STX | ^B | 34 | " | 66 | B | 98 | b |
| 3 | ETX | ^C | 35 | # | 67 | C | 99 | c |
| 4 | EOT | ^D | 36 | $ | 68 | D | 100 | d |
| 5 | ENQ | ^E | 37 | % | 69 | E | 101 | e |
| 6 | ACK | ^F | 38 | & | 70 | F | 102 | f |
| 7 | BEL '\a' | ^G | 39 | ' | 71 | G | 103 | g |
| 8 | BS '\b' | ^H | 40 | ( | 72 | H | 104 | h |
| 9 | HT '\t' | ^I | 41 | ) | 73 | I | 105 | i |
| 10 | LF,NL '\n' | ^J | 42 | * | 74 | J | 106 | j |
| 11 | VT '\v' | ^K | 43 | + | 75 | K | 107 | k |
| 12 | FF,NP '\f' | ^L | 44 | , | 76 | L | 108 | l |
| 13 | CR '\r' | ^M | 45 | - | 77 | M | 109 | m |
| 14 | SO | ^N | 46 | . | 78 | N | 110 | n |
| 15 | SI | ^O | 47 | / | 79 | O | 111 | o |
| 16 | DLE | ^P | 48 | 0 | 80 | P | 112 | p |
| 17 | DC1 | ^Q | 49 | 1 | 81 | Q | 113 | q |
| 18 | DC2 | ^R | 50 | 2 | 82 | R | 114 | r |
| 19 | DC3 | ^S | 51 | 3 | 83 | S | 115 | s |
| 20 | DC4 | ^T | 52 | 4 | 84 | T | 116 | t |
| 21 | NAK | ^U | 53 | 5 | 85 | U | 117 | u |
| 22 | SYN | ^V | 54 | 6 | 86 | V | 118 | v |
| 23 | ETB | ^W | 55 | 7 | 87 | W | 119 | w |
| 24 | CAN | ^X | 56 | 8 | 88 | X | 120 | x |
| 25 | EM | ^Y | 57 | 9 | 89 | Y | 121 | y |
| 26 | SUB | ^Z | 58 | : | 90 | Z | 122 | z |
| 27 | ESC | ^[ | 59 | ; | 91 | [ | 123 | { |
| 28 | FS | ^\ | 60 | < | 92 | \ | 124 | | |
| 29 | GS | ^] | 61 | = | 93 | ] | 125 | } |
| 30 | RS | ^^ | 62 | > | 94 | ^ | 126 | ~ |
| 31 | US | ^- | 63 | ? | 95 | _ | 127 | DEL |
Special Codes
These codes had a significant meaning at one point in type, but aren't used too much anymore, except for the obvious BS, NL,CR, FF (less important now), ESC, NUL, and TAB. BEL also has it's uses, and will still ring a bell on most systems when displayed under a terminal emulator or command promt (even Windows/DOS COMMAND.COM/CMD.EXE)
| Code | Explanation |
|---|---|
| NUL | Null character, or zero, normally doesn't display. Used as the terminator for C strings (aka null-terminated strings). In the past, null characters were sometimes used to delay a terminal while sending a continous string of characters, for instance, when displaying ANSI animation sequences |
| SOH | Start of Heading |
| STX | Start of Text |
| ETX | End of Text |
| EOT | End of Transmission |
| ENQ | Enquiry |
| ACK | Acknowledge |
| BEL | Bell, ring the terminal's bell |
| BS | Backspace, move cursor back one space. Sometimes sent when the backspace, or delete key is pressed (depending on terminal's settings). Will move the cursor head back on printers (when printing ASCII files) and often used to make bold text on printers that otherwise don't have that ability. When sent to a terminal, will move the cursor back, and may or may not destroy the text underneath. |
| HT | Horizontal tab. Same as if you hit the tab key on your keyboard. Moves cursor to the next tab stop on a terminal (typically set at every 8 character intervals) |
| LF,NL | Line feed/New line, used to terminate lines in Unix text files (and on Mac OS X, which is Unix based). MS-DOS and Windows programs, like Notepad, expect the line to be terminated with a CR/LF pair. LF moves the cursor down one line, but does not return the cursor to the first column on printers and terminals. |
| VT | Vertical tab (usually not on a keyboard) |
| FF,NP | Form feed/New Page. Tells the printer to spit out a page. Used to mark the end of pages for printing. Some terminals will clear the screen when it is sent to the display. |
| CR | Carriage return. This is often the code that is sent when the Return/Enter key is pressed. Used to terminate Mac (not OS X) and older Apple text files. MS-DOS and windows expects CR/LF pairs. Returns the cursor to the first column, does not move cursor down one line. |
| SO | Shift Out |
| SI | Shift In |
| DLE | Data Link Escape |
| DC1 | Device Control 1 |
| DC2 | Device Control 2 |
| DC3 | Device Control 3 |
| DC4 | Device Control 4 |
| NAK | Negative Acknowledge |
| SYN | Sync |
| ETB | end of transfer block |
| CAN | Cancel transmission |
| EM | end of medium |
| SUB | substitute |
| ESC | Escape (starts escape codes, sent when pressing the Esc key) |
| FS | file separator |
| GS | group separator |
| RS | record separator |
| US | unit separator |
| DEL | Delete, sent sometimes in place of the backspace key on terminal keyboards. |

