ASCII Table

Control Characters (0-31)

Dec Hex Abbr Description

0

00

NUL

Null (string terminator in C)

7

07

BEL

Bell (terminal beep)

8

08

BS

Backspace

9

09

HT

Horizontal tab (\t)

10

0A

LF

Line feed (\n) — Unix newline

13

0D

CR

Carriage return (\r) — Windows uses CR+LF

27

1B

ESC

Escape (ANSI escape sequences start here)

32

20

SP

Space

Printable Characters (32-126)

Digits and Letters

Dec Char Dec Char Dec Char

48

0

65

A

97

a

49

1

66

B

98

b

50

2

67

C

99

c

51

3

68

D

100

d

52

4

69

E

101

e

53

5

70

F

102

f

54

6

71

G

103

g

55

7

72

H

104

h

56

8

73

I

105

i

57

9

74

J

106

j

Special Characters

Dec Char Name Dec Char Name

33

!

Exclamation/bang

47

/

Forward slash

34

"

Double quote

58

:

Colon

35

#

Hash/pound/octothorpe

59

;

Semicolon

36

$

Dollar

60

<

Less than

37

%

Percent

61

=

Equals

38

&

Ampersand

62

>

Greater than

39

'

Single quote/apostrophe

63

?

Question mark

40

(

Left paren

64

@

At sign

41

)

Right paren

91

[

Left bracket

42

*

Asterisk/star/glob

92

\

Backslash

43

+

Plus

93

]

Right bracket

44

,

Comma

94

^

Caret

45

-

Hyphen/dash/minus

95

_

Underscore

46

.

Period/dot

96

`

Backtick/grave

CLI Quick Lookups

View ASCII table
man ascii
Character to decimal
printf '%d\n' "'A"    # 65
Decimal to character
printf '\x41\n'        # A
printf "\\$(printf '%03o' 65)\n"  # A
Hex dump of file
xxd file.txt | head

Key Relationships

Pattern Rule

Upper to lower

Add 32: A(65) + 32 = a(97)

Lower to upper

Subtract 32: a(97) - 32 = A(65)

Digit char to value

Subtract 48: '5'(53) - 48 = 5

Printable range

32 (space) through 126 (~)

DEL character

127 (0x7F) — not printable