Printable ASCII characters list

This blog post explains the printable characters with their ASCII (American Standard Code for Information Interchange) value in decimal and hex format. You will also learn to find a printable character in a given list of characters.

Table of printable ASCII characters:

The following table contains the printable characters with their ASCII value in decimal and hex format.

Printable Characters
DEC HEX
CHARACTER
DEC HEX CHARACTER DEC HEX CHARACTER
32 0x20 <SPACE> 64 0x40 @ 96 0x60 `
33 0x21 ! 65 0x41 A 97 0x61 a
34 0x22 66 0x42 B 98 0x62 b
35 0x23 # 67 0x43 C 99 0x63 c
36 0x24 $ 68 0x44 D 100 0x64 d
37 0x25 % 69 0x45 E 101 0x65 e
38 0x26 & 70 0x46 F 102 0x66 f
39 0x27 71 0x47 G 103 0x67 g
40 0x28 ( 72 0x48 H 104 0x68 h
41 0x29 ) 73 0x49 I 105 0x69 i
42 0x2A * 74 0x4A J 106 0x6A j
43 0x2B + 75 0x4B K 107 0x6B k
44 0x2C , 76 0x4C L 108 0x6C l
45  0x2D 77 0x4D M 109 0x6D m
46 0x2E . 78 0x4E N 110 0x6E n
47 0x2F / 79 0x4F O 111 0x6F o
48 0x30 0 80 0x50 P 112 0x70 p
49 0x31 1 81 0x51 Q 113 0x71 q
50 0x32 2 82 0x52 R 114 0x72 r
51 0x33 3 83 0x53 S 115 0x73 s
52 0x34 4 84 0x54 T 116 0x74 t
53 0x35 5 85 0x55 U 117 0x75 u
54 0x36 6 86 0x56 V 118 0x76 v
55 0x37 7 87 0x57 W 119 0x77 w
56 0x38 8 88 0x58 X 120 0x78 x
57 0x39 9 89 0x59 Y 121 0x79 y
58 0x3A : 90 0x5A Z 122 0x7A z
59 0x3B ; 91 0x5B [ 123 0x7B {
60 0x3C < 92 0x5C \ 124 0x7C |
61 0x3D = 93 0x5D ] 125 0x7D }
62 0x3E > 94 0x5E ^ 126 0x7E ~
63 0x3F ? 95 0x5F _

 

Now let’s see a C program, to validate the above-mentioned characters are printable characters or not.

Here we will use the isprint function to check each character. The isprint is a library function that returns a non-zero value if the argument is a printable character.

In the following code, I will iterate a for loop from 0 to 127 and print the ASCII value of a character in dec which can be printed.

#include <stdio.h>
#include <ctype.h>

int main()
{
    unsigned int i;
    printf("All printable char in C: \n\n");

    // looping through all ASCII characters
    for (i = 0; i < 127; ++i)
    {
        if(isprint(i)!= 0)
        {
            printf("%d ", i);
        }
    }

    printf("\n\n");

    return 0;
}

Output:

Printable ASCII characters in C

 

Recommended Post: