ASCII Values of Alphabets – An A-Z Guide

Updated on October 18, 2024

Article Outline

ASCII means the American Standard Code for Information Exchange and this term defines, encodes, and correlates English letters, symbols, control codes, and numbers in one set. In many of the computing systems today, ASCII especially remains primary in programming and processing data. Various Letters, Numbers, Punctuation, Control Characters, etc., are assigned with ASCII values. Here, in this article, we are going to talk about the uppercase alphabet A-Z & lowercase a-z ASCII code. We’ll also discuss the ASCII values before 33 and after 127 values.

 

According to the fundamental ASCII table, letters are represented by values between 0 and 127, with uppercase letters 65–90 and lowercase letters 97–122. In this article, we will go through a thorough A-Z guide on ASCII values for alphabets, complete with thorough explanations, use cases, code examples, and much more.

What is ASCII?

ASCII refers to the American Standard Code for Information Interchange and is a character encoding standard that relates characters, symbols, or control codes to a set of numerical values. ASCII was created and utilised in the 1960s as a telecommunication protocol and a computer text encoding system.

 

Also Read: Python Tutorial for Beginners

 

Structure of the ASCII Table

The ASCII table contains 128 characters, which are split into several groups. But of it only 95 are printable characters.

 

  1. Control Characters (0-31): Control characters are the non-printable characters used for device control, such as carriage return (CR), line feed (LF), tab (HT), etc.
  2. Printable Characters (32-126): These are the printable characters that can be displayed on a screen, including letters, digits, punctuation marks, and symbols.
  3. Extended ASCII Characters (128-255): They are not part of the original ASCII table, these include characters like accented letters and additional symbols.

 

Why is ASCII Important?

In real-life situations, suppose you wrote a message on paper and passed it on to your friend for reading the written text. However, when considering information exchange through the use of technology like computers, it is safe to say that machines view alphabets and/or symbols differently than how people do. They rather look at information in the form of a binary code, which contains only two digits (0 and 1).

 

This is where ASCII (American Standard Code for Information Interchange) values come into play. ASCII acts as a bridge between human-readable characters and the binary language that computers understand. It assigns a unique numerical code to each character (letters, digits, punctuation marks, control characters, etc.), making it possible for computers to process text data.

 

The American Standard Code for Information Interchange, commonly referred to as ASCII, has been widely used from the early ages of computers and up to now because of many factors, particularly in encoding text and interaction of information:

 

  • Standardisation: ASCII provides a standardised way for computers to represent characters, enabling cross-system communication.
  • Saving Space: The encoding scheme typically assigns 7 bits to ASCII and this is also enough space to represent one character, therefore it saves memory space and quickens the transmission speed.
  • Global Standard: ASCII is found in almost all operating systems, programming languages, and text-processing software providing inter-platform dependency.

 

How Does ASCII Work?

ASCII translates characters into numerical values (binary equivalents) so computers can interpret and manipulate them. Each character is assigned a specific 7-bit binary code. For example:

 

  • The letter ‘A’ is represented by the binary value 1000001, which corresponds to the decimal value 65 in ASCII.
  • The letter ‘a’ is represented by the binary value 1100001, corresponding to the decimal value 97 in ASCII.

 

When a computer reads or transmits text, it doesn’t “see” the letter ‘A’ the way a human does. Instead, it processes the corresponding ASCII value (65 in this case) in binary form.

 

Also Read:  Key Features of Python

*Image
Get curriculum highlights, career paths, industry insights and accelerate your technology journey.
Download brochure

ASCII Values of Uppercase Alphabets (A-Z)

First, let’s see the uppercase alphabet’s ASCII values. Uppercase letters have ASCII values between 65 and 90. The ASCII value for each uppercase letter is displayed in the table below:

 

Letter ASCII Value
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

 

Example 1: Converting an Uppercase Alphabet to ASCII in Python

letter = 'A' ascii_value = ord(letter) print(f'The ASCII value of {letter} is {ascii_value}.')

Output:

The ASCII value of A is 65. In this example, we are printing the converted uppercase alphabet ‘A’ to its ASCII value in Python.

Example 2: Displaying ASCII Values for Uppercase Alphabets

for letter in range(65, 91): print(f'The ASCII value of {chr(letter)} is {letter}.')

Output:

The ASCII value of A is 65. The ASCII value of B is 66. The ASCII value of C is 67. The ASCII value of D is 68. The ASCII value of E is 69. The ASCII value of F is 70. The ASCII value of G is 71. The ASCII value of H is 72. The ASCII value of I is 73. The ASCII value of J is 74. The ASCII value of K is 75. The ASCII value of L is 76. The ASCII value of M is 77. The ASCII value of N is 78. The ASCII value of O is 79. The ASCII value of P is 80. The ASCII value of Q is 81. The ASCII value of R is 82. The ASCII value of S is 83. The ASCII value of T is 84. The ASCII value of U is 85. The ASCII value of V is 86. The ASCII value of W is 87. The ASCII value of X is 88. The ASCII value of Y is 89. The ASCII value of Z is 90.

In this example, we are printing all uppercase alphabet with their ASCII values by looping through the range in Python.

ASCII Values of Lowercase Alphabets (a-z)

Let’s see the lowercase alphabet’s ASCII values. Lowercase letters have ASCII values between 97 and 122. The ASCII value for each lowercase letter is displayed in the table below:

 

Letter ASCII Value
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

 

Example 1: Converting a Lowercase Alphabet to ASCII in Python

letter = 'a' ascii_value = ord(letter) print(f'The ASCII value of {letter} is {ascii_value}.')

Output:

The ASCII value of a is 97.

In this example, we are printing the converted lowercase alphabet ‘a’ to its ASCII value in Python.

 

Example 2: Displaying ASCII Values for Lowercase Alphabets

for letter in range(97, 123): print(f'The ASCII value of {chr(letter)} is {letter}.')

Output:

The ASCII value of a is 97. The ASCII value of b is 98. The ASCII value of c is 99. The ASCII value of d is 100. The ASCII value of e is 101. The ASCII value of f is 102. The ASCII value of g is 103. The ASCII value of h is 104. The ASCII value of i is 105. The ASCII value of j is 106. The ASCII value of k is 107. The ASCII value of l is 108. The ASCII value of m is 109. The ASCII value of n is 110. The ASCII value of o is 111. The ASCII value of p is 112. The ASCII value of q is 113. The ASCII value of r is 114. The ASCII value of s is 115. The ASCII value of t is 116. The ASCII value of u is 117. The ASCII value of v is 118. The ASCII value of w is 119. The ASCII value of x is 120. The ASCII value of y is 121. The ASCII value of z is 122.

In this example, we are printing all lowercase alphabet with their ASCII values by looping through the range in Python.

 

Check Out: Free Python Courses

ASCII Values Before 33 (0–32)

Before 33 in the ASCII table, these values are known as the control characters that cannot be printed. Originally, they were meant to handle text formats or operate hardware like printers. These control characters are used specifically for formatting, text flow control, and data transmission.

 

ASCII Character Description
0 NUL The null character (marks end)
1 SOH Start of Header
2 STX Start of Text
3 ETX End of Text
4 EOT End of Transmission
5 ENQ Enquiry (request for info)
6 ACK Acknowledgment
7 BEL Bell (causes an alert sound)
8 BS Backspace
9 TAB Horizontal Tab
10 LF Line Feed
11 VT Vertical Tab
12 FF Form Feed (new page)
13 CR Carriage Return
14 SO Shift Out
15 SI Shift In
16 DLE Data Link Escape
17 DC1 Device Control 1 (XON)
18 DC2 Device Control 2
19 DC3 Device Control 3 (XOFF)
20 DC4 Device Control 4
21 NAK Negative Acknowledgment
22 SYN Synchronous Idle
23 ETB End of Transmission Block
24 CAN Cancel
25 EM End of Medium
26 SUB Substitute
27 ESC Escape
28 FS File Separator
29 GS Group Separator
30 RS Record Separator
31 US Unit Separator
32 SP Space (blank space character)

ASCII Values Beyond 126 (127–255)

Values in ASCII between 127 and 255 are classified as Extended ASCII. These characters contain control characters, graphical symbols, foreign language symbols, and extra symbols. With Extended ASCII, 8 bits are used, expanding the character set to 256 values. The conventional ASCII table only defines values from 0 to 127 (7 bits).

 

Here are some important characters around the 127–255 range:

 

  • 127 (DEL): This is another control character known as Delete.
  • 128–159: These are often non-printable control characters used in extended sets for various systems and applications.
  • 160–255: This range includes printable characters like accented letters (é, ö, ç), currency symbols (£, ¥), and additional punctuation.

Relationship Between Uppercase and Lowercase ASCII Values

The link between capital and lowercase characters is one of the ASCII table’s greatest properties. A lowercase letter’s ASCII value is always 32 units greater than that of its matching uppercase character. Let’s see an example how uppercase and lowercase letters are related:

 

  • The ASCII value of ‘A’ is 65, while the ASCII value of ‘a’ is 97. The difference here is 32.
  • The ASCII value of ‘B’ is 66, while the ASCII value of ‘b’ is 98. Again, the difference here is 32.

This consistent difference allows programmers to easily convert between uppercase and lowercase letters by adding or subtracting 32. We will now see the implementation of this relationship between uppercase and lowercase ASCII values with the help of some examples in Python.

 

Also read:  Python Interview Questions and Answers

 

Example 1: Converting Between Uppercase and Lowercase in Python

# Convert uppercase to lowercase uppercase_letter1 = 'B' uppercase_letter2 = 'C' uppercase_letter3 = 'G' lowercase_letter1 = chr(ord(uppercase_letter1) + 32) lowercase_letter2 = chr(ord(uppercase_letter2) + 32) lowercase_letter3 = chr(ord(uppercase_letter3) + 32)   print(f'The lowercase of {uppercase_letter1} is {lowercase_letter1}.') print(f'The lowercase of {uppercase_letter2} is {lowercase_letter2}.') print(f'The lowercase of {uppercase_letter3} is {lowercase_letter3}.')

Output:

The lowercase of B is b. The lowercase of C is c. The lowercase of G is g.

Example 2: Converting Between Lowercase and Uppercase in Python

# Convert lowercase to uppercase lowercase_letter1 = 'b' lowercase_letter2 = 'c' lowercase_letter3 = 'z' uppercase_letter1 = chr(ord(lowercase_letter1) - 32) uppercase_letter2 = chr(ord(lowercase_letter2) - 32) uppercase_letter3 = chr(ord(lowercase_letter3) - 32) print(f'The uppercase of {lowercase_letter1} is {uppercase_letter1}.') print(f'The uppercase of {lowercase_letter2} is {uppercase_letter2}.') print(f'The uppercase of {lowercase_letter3} is {uppercase_letter3}.')

Output:

The uppercase of b is B. The uppercase of c is C. The uppercase of z is Z.

Practical Applications of ASCII Values

Programming, data processing, encryption, and communication protocols all make extensive use of ASCII values. Let’s see some of the common use cases for ASCII in real life.

 

  • Data Transmission and Communication: ASCII codes were very often used for data transmission in computing’s first age. When a message was sent over a network, each letter in the message was first changed to an ASCII number. Since everyone used ASCII encoding, the information was correctly presented and understood by different users of different platforms.
  • Encryption and Cryptography: ASCII values are extremely significant in the implementation of various encryption methods. In the process of encryption, such as with several methods, a message (or other source of information) is converted into ASCII standard, then mathematical figures are placed on the figures in its ASCII form, to obtain a code.
  • Character Manipulation in Programming: Furthermore, when faced with string operations such as changing the letter case, determining if a certain character is a number or a letter or any of its combinations a programmer does manipulation with ASCII values and other similar techniques. Many algorithms especially for competitive programming ones are rather conversion of loops and strings back and forth using ASCII manipulation.
  • String sorting based on ASCII values: So in languages like C, C++, Python, and Java when sorting the strings one of the methodologies employed involves the use of ASCII orders. One order arranges the characters according to their respective ASCII values. For example, in Python, we can sort the list of items as:

 

Example:

words = ['apple', 'banana', 'cherry', 'date'] sorted_words = sorted(words) print(f'Sorted words: {sorted_words}')

Output:

Sorted words: ['apple', 'banana', 'cherry', 'date']
  • Compression Techniques: Compression incorporates the use of ASCII values within its algorithms to encode the text to reduce the size of its content. Storing and transmitting information can also be made more efficient by utilising codecs to convert OS-compliant systems into a system that utilises ASCII, in which repetitions of identical characters are abbreviated into a single character.

Difference Between ASCII and Unicode

Here are the key differences between ASCII and Unicode:

 

Criteria ASCII Unicode
Character Set Size 128 characters (7-bit code) Over 1.1 million characters (up to 32 bits)
Supported Characters ASCII has primarily English letters, digits, and symbols. Unicode supports almost all characters and scripts from all languages globally.
Character Encoding ASCII uses 7 bits (values from 0 to 127) Unicode uses 8, 16, or 32 bits (UTF-8, UTF-16, UTF-32)
Primary Use Simple text encoding for early communication systems and computers. Global text representation that incorporates multiple language scripts, emoticons, and symbols.
Internationalisation Limited internationalisation is there and not suitable for non-English languages. Fully internationalised and supports all modern and ancient languages.
File Size Efficiency Efficient for small text with basic characters. It can result in larger file sizes, but UTF-8 minimises this for texts with Latin characters.
Backward Compatibility ASCII is a subset of Unicode (UTF-8). Unicode is backward compatible with ASCII in UTF-8 encoding.

Conclusion

ASCII codes have served as a key mediating link between people’s characters and computers’ binary code in the age of information and computer technologies. As a simple and commonly used coding scheme, ASCII has allowed computers to handle and transmit textual information making it possible to build an impressive variety of programs from the first computing machines down to contemporary ones.

 

Despite the advent of more comprehensive encoding schemes like Unicode, ASCII remains relevant for its simplicity and efficiency, especially for English text and basic symbols. Even today, when more complex encodings have been devised, the need to complete such tasks with basic systems, in particular ASCII encodings, remains – this is how all encoding standards were shaped. It is very important for people who plan to work in computer science and software development because of its relevance and application in manipulating text.

FAQs
ASCII values are mainly used by programmers to encode and manipulate characters. Every character - letters, numbers, and punctuation has been assigned an individual ASCII value. Based on these codes, developers can perform actions such as character comparisons, text formation and downloading, etc. For instance, in the C programming language Python and even JavaScript, you can compare characters according to the ASCII values as well as apply them when changing the case for letters.
For uppercase alphabets, the range of ASCII values is 65 to 90 (A to Z), and for lowercase alphabets, it is 97 to 122 (a to z). These numbers fall inside the standard ASCII table's printable character range.
No, ASCII was created to store and retrieve only the English language and not any other international languages like Chinese, Arabic, or Hindi. For international languages, other encoding systems like Unicode are used that have a wider scope of symbols and characters than what the letters can provide.
The ASCII values of 'A' and 'a' are 65 and 97, respectively. Programming can easily convert between capital and lowercase letters just by subtracting the difference of 32 from each character.
The ASCII values for 'a' to 'z' (lowercase letters) range from 97 to 122.

Updated on October 18, 2024

Link
left dot patternright dot pattern

Programs tailored for your success

Popular

Management

Data Science

Finance

Technology

Future Tech

Upskill with expert articles

View all
Hero Vired logo
Hero Vired is a leading LearnTech company dedicated to offering cutting-edge programs in collaboration with top-tier global institutions. As part of the esteemed Hero Group, we are committed to revolutionizing the skill development landscape in India. Our programs, delivered by industry experts, are designed to empower professionals and students with the skills they need to thrive in today’s competitive job market.
Blogs
Reviews
Events
In the News
About Us
Contact us
Learning Hub
18003093939     ·     hello@herovired.com     ·    Whatsapp
Privacy policy and Terms of use

|

Sitemap

© 2024 Hero Vired. All rights reserved