Java ASCII Table

ASCII stands for American Standard Code for Information Interchange. ASCII is a standard data-transmission code that is used by the computer for representing both the textual data and control characters.

ASCII is a 7-bit character set having 128 characters, i.e., from 0 to 127. ASCII represents a numeric value for each character, such as 65 is a value of A. In our Java program, we need to manipulate characters that are stored in ASCII.

In Java, an ASCII table is a table that defines ASCII values for each character. It is also a small subset of Unicode because it contains 2 bytes while ASCII requires only one byte.

ASCII ValueDecimal ValueHex value
Control00
Control11
Control22
Control33
Control44
Control55
Control66
Control77
Control88
\t99
\n10A
Whitespace11B
\f12C
\r13D
Control14E
Control14F
Control1610
Control1711
Control1812
Control1913
Control2014
Control2115
Control2216
Control2317
Control2418
Control2519
Control261a
Control271b
Whitespace281c
Whitespace291d
Whitespace301e
Whitespace311f
space3220
!3321
"3422
#3523
$3624
%3725
&3826
'3927
(4028
)4129
*422a
+432b
,442c
-452d
.462e
/472f
04830
14931
25032
35133
45234
55335
65436
75537
85638
95739
:583a
;593b
<603c
=613d
>623e
?633f
@6440
A6541
B6642
C6743
D6844
E6945
F7046
G7147
H7248
I7349
J744a
K754b
L764c
M774d
N784e
O794f
P8050
Q8151
R8252
S8353
T8454
U8555
V8656
W8757
X8858
Y8959
Z905a
[915b
\925c
]935d
^945e
_955f
`9660
a9761
b9862
c9963
d10064
e10165
f10266
g10367
h10468
i10569
j1066a
k1076b
l1086c
m1096d
n1106e
o1116f
p11270
q11371
r11472
s11573
t11674
u11775
v11876
w11977
x12078
y12179
z1227a
{1237b
|1247c
}1257d
~1267e
control1277f

Let's create a Java program for constructing the above ASCII table. In the Java program, we use the isWhitespace() method of the character for determining whether a character is a whitespace or not. We also use the built-in method IsISOControl() method for detecting characters that are not letters, digits and punctuation.

ASCIITable.java

Output:

Java ASCII Table
Next TopicSpark Java




Latest Courses