Let’s go! 👇
📚 How it All Started...
Today during an exam, a question appeared that seemed simple at first:
char ch = 65;
System.out.println(ch);
The options were:
- a) 65
- b) A
- c) a
- d) Error
Surprisingly, some of us chose the wrong answer (like 65
), thinking the output would just be the number. But after checking it post-exam, I realized — the output is A
.
This mistake triggered my curiosity:
❓ Why is 65 printing 'A'? What does it mean? Where do these values come from?
So I decided to dig deeper — and that's how I fell into the fascinating world of ASCII.
💡 What is ASCII?
ASCII stands for:
American Standard Code for Information Interchange
🔍 Why was ASCII created?
Before ASCII, different computers used different encodings, which made it hard to communicate or exchange data. ASCII was created to standardize the way text is stored, read, and transferred between devices and systems.
👨🔧 Who invented ASCII?
Robert W. Bemer,(often called "The Father of ASCII.") a computer scientist who worked with IBM and the ANSI (American National Standards Institute), played a major role in designing ASCII. He even introduced characters like the backslash \
and curly braces {}
.
📅 When and how was ASCII developed?
- Started: Around 1960
- First Version Published: 1963
- Lowercase letters added: 1967
- Official US Federal Standard: 1968
It was originally developed for telecommunication devices and early computers to talk in a common language.
🖥️ Where is ASCII used today?
- Programming languages (C, Java, Python, etc.)
- Text files (.txt)
- HTML and web pages
- Network protocols like HTTP, SMTP (emails)
- Keyboard input recognition
🔠 ASCII Table Snapshot
Here are some popular values you might see often:
Character | ASCII Value |
---|---|
A | 65 |
B | 66 |
Z | 90 |
a | 97 |
z | 122 |
0 | 48 |
9 | 57 |
Space | 32 |
Enter (LF) | 10 |
So in my exam case:
char ch = 65;
65
represents 'A'
in the ASCII table — that’s why it printed 'A'
.
🤯 Mind-Blowing Realization
Even more shocking — ASCII doesn't just represent letters, it includes control characters from 0 to 31, like:
-
8
→ Backspace -
10
→ Line Feed (\n
) -
13
→ Carriage Return (\r
)
🌐 ASCII's Legacy
Though ASCII only supports English letters and symbols (0–127), it laid the foundation for:
-
Extended ASCII (128–255): Added more characters like
ç
,é
, etc. - Unicode (U+0000 to U+10FFFF): Supports all world languages + emojis 😎
💭 Final Thoughts
This small mistake in the exam turned out to be a big learning win for me. I now understand what ASCII is, why it matters, and how it still powers the text we see in programming today.
So next time I see something like:
char ch = 97;
I’ll confidently say: “That prints 'a'
!”
🧠 Lesson Learned:
Sometimes a wrong answer teaches more than a right one.