What is an ASCII Character?
ASCII (American Standard Code for Information Interchange) is a character encoding standard that represents characters (such as letters, numbers, and symbols) as numbers between 0 and 127. ASCII codes are used to represent text in computers and other devices.
It is a 7-bit character code where each individual bit represents a unique character. So a maximum of 128 characters are represented in ASCII Standard which first 32 are control characters which were designed to control computer hardware. These are the standard characters used for most computer systems.
List of all ASCII Characters with description
ASCII Character | Numeric Code | Description |
0 – 31 | Control characters | |
32 | Space character | |
! | 33 | exclamation mark |
“ | 34 | quotation mark |
# | 35 | number sign |
$ | 36 | dollar currency sign |
% | 37 | percent sign |
& | 38 | Ampersand (also used as and) |
‘ | 39 | Apostrophe (also known as single quote) |
( | 40 | left parenthesis |
) | 41 | right parenthesis |
* | 42 | asterisk |
+ | 43 | plus sign |
, | 44 | comma |
– | 45 | hyphen |
. | 46 | period |
/ | 47 | slash |
0 | 48 | number 0 |
1 | 49 | number 1 |
2 | 50 | number 2 |
3 | 51 | number 3 |
4 | 52 | number 4 |
5 | 53 | number 5 |
6 | 54 | number 6 |
7 | 55 | number 7 |
8 | 56 | number 8 |
9 | 57 | number 9 |
: | 58 | colon |
; | 59 | semicolon |
< | 60 | less-than |
= | 61 | equals-to |
> | 62 | greater-than |
? | 63 | question mark |
@ | 64 | at sign |
A | 65 | uppercase letter A |
B | 66 | uppercase letter B |
C | 67 | uppercase letter C |
D | 68 | uppercase letter D |
E | 69 | uppercase letter E |
F | 70 | uppercase letter F |
G | 71 | uppercase letter G |
H | 72 | uppercase letter H |
I | 73 | uppercase letter I |
J | 74 | uppercase letter J |
K | 75 | uppercase letter K |
L | 76 | uppercase letter L |
M | 77 | uppercase letter M |
N | 78 | uppercase letter N |
O | 79 | uppercase letter O |
P | 80 | uppercase letter P |
Q | 81 | uppercase letter Q |
R | 82 | uppercase letter R |
S | 83 | uppercase letter S |
T | 84 | uppercase letter T |
U | 85 | uppercase letter U |
V | 86 | uppercase letter V |
W | 87 | uppercase letter W |
X | 88 | uppercase letter X |
Y | 89 | uppercase letter Y |
Z | 90 | uppercase letter Z |
[ | 91 | left square bracket |
\ | 92 | backslash |
] | 93 | right square bracket |
^ | 94 | caret |
_ | 95 | underscore |
` | 96 | grave accent |
a | 97 | lowercase letter a |
b | 98 | lowercase letter b |
c | 99 | lowercase letter c |
d | 100 | lowercase letter d |
e | 101 | lowercase letter e |
f | 102 | lowercase letter f |
g | 103 | lowercase letter g |
h | 104 | lowercase letter h |
i | 105 | lowercase letter i |
j | 106 | lowercase letter j |
k | 107 | lowercase letter k |
l | 108 | lowercase letter l |
m | 109 | lowercase letter m |
n | 110 | lowercase letter n |
o | 111 | lowercase letter o |
p | 112 | lowercase letter p |
q | 113 | lowercase letter q |
r | 114 | lowercase letter r |
s | 115 | lowercase letter s |
t | 116 | lowercase letter t |
u | 117 | lowercase letter u |
v | 118 | lowercase letter v |
w | 119 | lowercase letter w |
x | 120 | lowercase letter x |
y | 121 | lowercase letter y |
z | 122 | lowercase letter z |
{ | 123 | left curly brace |
| | 124 | vertical bar (also known as pipe sign) |
} | 125 | right curly brace |
~ | 126 | Tilde sign |
C Program to print ASCII Characters
The following program prints out the numerical codes of the printable or visible ASCII characters. This C program prints ASCII values of all the alphabets and special characters. This is very handy C function for many programmers.
#include <stdio.h> int main(){ int c; printf("\tCharacter\tCode\n\t---------\t----\n"); for (c=32; c<127; c++){ printf("\t %c \t\t%4d\n", c, c); } }
Output of the C Program:
Character Code --------- ---- 32 ! 33 " 34 # 35 $ 36 % 37 & 38 ' 39 ( 40 ) 41 * 42 + 43 , 44 - 45 . 46 / 47 0 48 1 49 2 50 3 51 4 52 5 53 6 54 7 55 8 56 9 57 : 58 ; 59 < 60 = 61 > 62 ? 63 @ 64 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 [ 91 \ 92 ] 93 ^ 94 _ 95 ` 96 a 97 b 98 c 99 d 100 e 101 f 102 g 103 h 104 i 105 j 106 k 107 l 108 m 109 n 110 o 111 p 112 q 113 r 114 s 115 t 116 u 117 v 118 w 119 x 120 y 121 z 122 { 123 | 124 } 125 ~ 126