What Is ASCII? Character Encoding Explained for Beginners

SP
Sreehari Pradeep
July 7, 20268 min read

Quick Answer: ASCII (American Standard Code for Information Interchange) is a character encoding system developed in the 1960s that assigns numbers from 0 to 127 to English letters, digits, punctuation, and control characters. It became the foundation for modern text encoding and is still fully supported by Unicode and UTF-8 today.

What Is ASCII? ASCII is a character encoding standard that acts as a universal codebook for computers, allowing them to store, process, and display text. Because computers operate entirely in binary (using electric currents representing 0s and 1s), they cannot read or write human letters directly. ASCII solves this problem by mapping human-readable characters to specific numbers that a computer can store.

Think of it as a translator: when you type a letter on your keyboard, your computer converts that action into an ASCII number. When the computer displays the text back to you, it translates that number back into the letter, digit, or symbol you originally typed.

What Does ASCII Stand For?

ASCII stands for American Standard Code for Information Interchange. During the early days of the computing revolution, manufacturers needed a universal way to share data. The name reflects this exact goal: it is an American standard designed to let different computer systems interchange (share) text information without compatibility issues. It quickly became the first widely adopted text standard in history, establishing the foundation for modern global networking and the internet.

Why Was ASCII Created?

Before ASCII was standardized in 1963, early computers were extremely fragmented. Because machines could not understand human language, every computer manufacturer designed their own proprietary character set. For example, the letter 'A' might be represented by the decimal number 12 on an IBM machine, but represented by 45 on a computer built by DEC or Unix-precursor systems.

Without a common standard, sharing files between different computers was nearly impossible. If you sent a text file from one system to another, the receiving system would interpret the numbers using its own rulebook, rendering the message as a scrambled mess of random characters (a problem known as mojibake). ASCII was created by a committee led by Bob Bemer under the American Standards Association (now ANSI) to solve this fragmentation, providing a single universal rulebook for text representation.

How ASCII Works

ASCII works by assigning a unique decimal number to 128 different characters. Whenever a character is typed, saved, or sent, it is processed as its corresponding ASCII value.

How Pressing a Key Becomes Text

Many users wonder: How does pressing a physical key on a keyboard translate into a letter on the screen? The process involves several layers of hardware and software translation, mapping physical actions to binary data, and then to visual fonts. Here is how that process flows:

The Typing Process Flow
1. Keyboard Press User presses key "A"
2. Operating System OS registers Scan Code
3. ASCII Decimal Value Mapped to Code 65
4. Binary Conversion 01000001 (8-bit Byte)
5. Memory & Storage Saved in RAM or Text File
6. Screen Rendering Font engine displays "A"

When you press a key on your keyboard, a tiny microcontroller inside the keyboard detects the electrical connection and sends a raw identifier called a scan code to the computer's motherboard. The operating system (such as Windows, macOS, or Linux) receives this code, detects the keyboard layout, and maps the scan code to the corresponding standard ASCII character code (for example, code 65 for uppercase 'A'). The OS then converts 65 into its binary representation (01000001) and passes it to the active application, which saves it in memory. Finally, the text editor sends the binary value to the screen's graphics engine. The graphics engine reads the value, looks up the corresponding visual font outline (glyph) in the system's font file, and paints the pixels on your screen so you see 'A'.

Binary Representation: How Computers Store Bits

Under the hood, a computer cannot directly understand the decimal number 65. It can only understand physical states of electricity: on or off (represented mathematically as 1 and 0). Each 1 or 0 is called a bit (binary digit).

Because a single bit can only store two values (0 or 1), computers group bits together to represent larger numbers. A group of 8 bits is called a byte. A single byte can represent any integer value from 0 to 255 (28 = 256 combinations).

The ASCII standard was originally designed as a 7-bit encoding system. This means it only uses 7 bits to map characters, allowing for 128 unique codes (27 = 128). The 8th bit in early telecommunications was reserved as a "parity bit" for error-checking, helping detect if data was corrupted during transmission over noisy phone lines.

Here is a breakdown of how the letter A is represented across different numerical bases:

Character: A
ASCII Decimal: 65
Hexadecimal: 41
Binary representation (8-bit Byte): 01000001

To convert the binary value 01000001 back to decimal, we add up the powers of 2 for each position where a "1" is present, counting from right to left (starting at 0):

  • Position 0 (value 20 = 1): 1
  • Position 6 (value 26 = 64): 1
  • All other positions are 0.
  • Total = 64 + 1 = 65.

Later on, as computer systems became more reliable, manufacturers began using the 8th bit to define characters from 128 to 255. This expansion is called Extended ASCII. However, because there was no single standard for Extended ASCII, different manufacturers created different mappings (known as code pages or character sets). For instance, MS-DOS used Code Page 437, which added box-drawing characters and mathematical symbols, while European systems used ISO-8859-1 (Latin-1) to add accented letters like é and ü. This fragmentation eventually led to the creation of Unicode.

ASCII Examples in Daily Life

To understand character encoding, it helps to look at a concrete example of how files are saved. When you open a text editor (like Notepad or TextEdit) and save a file containing the word "hello" as hello.txt, the computer does not store pictures or drawings of those letters. Instead, it writes a sequence of bytes containing the ASCII values of those letters to your storage drive.

Here is exactly how the word hello is represented:

Letter ASCII Decimal Value Hexadecimal Value Binary Representation Memory Size
h 104 68 01101000 1 Byte (8 bits)
e 101 65 01100101 1 Byte (8 bits)
l 108 6C 01101100 1 Byte (8 bits)
l 108 6C 01101100 1 Byte (8 bits)
o 111 6F 01101111 1 Byte (8 bits)

When you save this file, the computer writes a total of 5 bytes (40 bits) of data to the disk: 01101000 01100101 01101100 01101100 01101111. When you open the file later, the text editor reads those 5 bytes, matches the numbers to the ASCII standard, and renders the word "hello" on the screen.

If you were to open this file in a hex editor, you would see the raw hexadecimal bytes: 68 65 6C 6C 6F. This clean representation explains why plain text files are so small compared to rich text documents (like .docx or .pdf), which must store complex font files, page layouts, colors, and metadata alongside the words.

ASCII vs Unicode

As the internet expanded globally in the 1990s, the limitations of ASCII became a bottleneck. ASCII was designed for English and could only represent 128 characters. It lacked accents, currency symbols like the Euro (€), non-English alphabets (such as Chinese, Cyrillic, or Arabic), and eventually, emojis.

To solve this global incompatibility, the tech industry created Unicode. Unicode is a universal character encoding standard that assigns a unique number (called a code point) to every character in almost every language in the world, plus mathematical symbols and emojis.

Here is a direct comparison between ASCII and Unicode:

Feature ASCII Unicode
Characters Supported 128 characters Over 149,000 assigned characters (up to 1.1 million code points)
Languages Supported English only Almost every written language in human history
Emoji Support No Yes (fully integrated)
UTF-8 Compatibility Yes (It forms the foundation of UTF-8) Yes (UTF-8 is an encoding method for Unicode)
Still Used Today Yes (backward-compatibility is universal) Yes (the modern global standard)
Memory Footprint Always 1 byte (7/8 bits) per character Variable (1 to 4 bytes per character in UTF-8)

The key takeaway is that Unicode did not replace ASCII; it absorbed it. The creators of Unicode designed it so that the first 128 code points are identical to the original ASCII table. This means that any file written in ASCII is automatically a valid Unicode file under the popular UTF-8 encoding standard. This clever design decision prevented millions of legacy systems from breaking when the web migrated to Unicode.

ASCII Table

Below is the complete standard ASCII table containing all 128 codes. We have separated the table into two sections: Control Characters (0–31 and 127), which command text layout and devices, and Printable Characters (32–126), which are the letters, numbers, and symbols you see on your screen.

🖥️ View Printable ASCII Characters Table (Codes 32-126)

These are the characters used in standard English writing, punctuation, digits, and programming syntax. This is the section most commonly referenced by developers and writers looking up character codes.

Dec Hex Binary Char Description
322000100000[Space]Space character
332100100001!Exclamation mark
342200100010"Double quotation mark
352300100011#Number sign (hash)
362400100100$Dollar sign
372500100101%Percent sign
382600100110&Ampersand
392700100111'Single quotation mark (apostrophe)
402800101000(Left parenthesis
412900101001)Right parenthesis
422A00101010*Asterisk
432B00101011+Plus sign
442C00101100,Comma
452D00101101-Hyphen / minus sign
462E00101110.Full stop (period)
472F00101111/Slash (solidus)
4830001100000Digit zero
4931001100011Digit one
5032001100102Digit two
5133001100113Digit three
5234001101004Digit four
5335001101015Digit five
5436001101106Digit six
5537001101117Digit seven
5638001110008Digit eight
5739001110019Digit nine
583A00111010:Colon
593B00111011;Semicolon
603C00111100<Less-than sign
613D00111101=Equal sign
623E00111110>Greater-than sign
633F00111111?Question mark
644001000000@At sign
654101000001AUppercase A
664201000010BUppercase B
674301000011CUppercase C
684401000100DUppercase D
694501000101EUppercase E
704601000110FUppercase F
714701000111GUppercase G
724801001000HUppercase H
734901001001IUppercase I
744A01001010JUppercase J
754B01001011KUppercase K
764C01001100LUppercase L
774D01001101MUppercase M
784E01001110NUppercase N
794F01001111OUppercase O
805001010000PUppercase P
815101010001QUppercase Q
825201010010RUppercase R
835301010011SUppercase S
845401010100TUppercase T
855501010101UUppercase U
865601010110VUppercase V
875701010111WUppercase W
885801011000XUppercase X
895901011001YUppercase Y
905A01011010ZUppercase Z
915B01011011[Left square bracket
925C01011100\Backslash
935D01011101]Right square bracket
945E01011110^Caret / circumflex accent
955F01011111_Underscore
966001100000`Grave accent (backtick)
976101100001aLowercase a
986201100010bLowercase b
996301100011cLowercase c
1006401100100dLowercase d
1016501100101eLowercase e
1026601100110fLowercase f
1036701100111gLowercase g
1046801101000hLowercase h
1056901101001iLowercase i
1066A01101010jLowercase j
1076B01101011kLowercase k
1086C01101100lLowercase l
1096D01101101mLowercase m
1106E01101110nLowercase n
1116F01101111oLowercase o
1127001110000pLowercase p
1137101110001qLowercase q
1147201110010rLowercase r
1157301110011sLowercase s
1167401110100tLowercase t
1177501110101uLowercase u
1187601110110vLowercase v
1197701110111wLowercase w
1207801111000xLowercase x
1217901111001yLowercase y
1227A01111010zLowercase z
1237B01111011{Left curly bracket
1247C01111100|Vertical bar (pipe)
1257D01111101}Right curly bracket
1267E01111110~Tilde
⚙️ View ASCII Control Characters Table (Codes 0-31 & 127)

Control characters are non-printable commands that tell older terminals, printers, and modern text interpreters how to format layout, transfer data, or ring system alarms. Though hidden on screen, they are vital for system automation.

Dec Hex Binary Char Description / Action
00000000000NULNull character (empty character)
10100000001SOHStart of Heading
20200000010STXStart of Text
30300000011ETXEnd of Text
40400000100EOTEnd of Transmission
50500000101ENQEnquiry
60600000110ACKAcknowledge
70700000111BELBell (trigger system beep sound)
80800001000BSBackspace
90900001001HT / TABHorizontal Tab
100A00001010LFLine Feed (new line / move down)
110B00001011VTVertical Tab
120C00001100FFForm Feed (new page / print page)
130D00001101CRCarriage Return (move cursor to start of line)
140E00001110SOShift Out (alternate character set)
150F00001111SIShift In (default character set)
161000010000DLEData Link Escape
171100010001DC1Device Control 1 (XON / resume transfer)
181200010010DC2Device Control 2
191300010011DC3Device Control 3 (XOFF / pause transfer)
201400010100DC4Device Control 4
211500010101NAKNegative Acknowledge
221600010110SYNSynchronous Idle
231700010111ETBEnd of Transmission Block
241800011000CANCancel
251900011001EMEnd of Medium
261A00011010SUBSubstitute (indicates EOF / end of file in MS-DOS)
271B00011011ESCEscape key
281C00011100FSFile Separator
291D00011101GSGroup Separator
301E00011110RSRecord Separator
311F00011111USUnit Separator
1277F01111111DELDelete character

ASCII Developer-Focused Examples

Software developers frequently need to convert letters to their ASCII values and vice versa. Use the interactive block below to view implementation examples in Python, JavaScript, and C:

💻 View ASCII Developer Code Examples

Python Example

# Convert a character to its ASCII decimal number
decimal_val = ord("A")
print(decimal_val)  # Output: 65

# Convert an ASCII decimal number back to its character
character = chr(65)
print(character)    # Output: 'A'

JavaScript Example

// Convert a character to its ASCII decimal number
const code = "A".charCodeAt(0);
console.log(code); // Output: 65

// Convert an ASCII decimal number back to its character
const char = String.fromCharCode(65);
console.log(char); // Output: "A"

C Language Example

#include <stdio.h>

int main() {
    char letter = 'A';
    int code = 65;

    // In C, chars are integers, so you can print them directly as numbers
    printf("ASCII value of %c is %d\n", letter, letter); // Output: ASCII value of A is 65

    // Print an integer as an ASCII character
    printf("Character for code %d is %c\n", code, code);  // Output: Character for code 65 is A

    return 0;
}

ASCII Limitations

Despite its historic success, standard ASCII is severely limited by its 7-bit design, which restricts it to only 128 characters. This worked fine in 1960s America, but as computing became global, ASCII faced critical limitations:

  • No Non-English Support: ASCII cannot represent characters or symbols from foreign languages. It lacks accents (like é, ü, or ñ), non-Latin scripts (like Chinese, Japanese, Korean, Arabic, Cyrillic, or Hindi), and specialized punctuation.
  • No Emojis: Visual symbols like 😀, 🚀, or ❤️ are completely missing, causing systems limited to ASCII to render them as empty blocks or question marks.
  • Fragmentation (Code Pages): Attempts to extend ASCII to 8 bits (256 characters) resulted in incompatible regional standards. A file saved with European characters (ISO-8859-1 / Latin-1) would display as garbage when opened on a computer using Cyrillic encoding (KOI8-R) or MS-DOS CP437.

To fix these limitations, the tech industry created custom extensions, followed by ANSI and EBCDIC encodings, and eventually standardized on Unicode and UTF-8.

ASCII FAQ

Is ASCII binary?

No. ASCII itself is not binary. It is a mapping system (or character set) that translates human letters into decimal numbers (like 'A' to 65). Binary (using 0s and 1s) is simply the numerical base that computers use to store those numbers electronically.

Does UTF-8 replace ASCII?

Not exactly. UTF-8 does not replace ASCII; it extends it. UTF-8 is designed to be 100% backward-compatible with ASCII. The first 128 characters of UTF-8 are identical in code and size (1 byte) to the ASCII table. This means old ASCII files do not need conversion to run in UTF-8 systems.

Why is the uppercase letter 'A' equal to 65?

Because the ASCII standard committee assigned that specific value in the 1960s. The assignment itself is arbitrary, but it was universally standardized so that every computer manufacturer agreed that 65 equals 'A'. Interestingly, uppercase letters start at 65 and lowercase letters start at 97, which is a difference of exactly 32. This was designed intentionally so that a computer could switch cases by toggling a single bit (bit 5).

What is the difference between ASCII and ANSI?

ASCII is a 7-bit standard with 128 characters. ANSI refers to 8-bit character sets (like Windows-1252) that support 256 characters. The first 128 characters of ANSI are identical to ASCII, but the remaining 128 define regional characters like accented letters, symbols, or math signs.

Why do emojis break on old systems?

Emojis require Unicode, specifically encoded in 4 bytes under UTF-8. Older legacy systems that only support standard ASCII are configured to read text in 1-byte chunks, meaning they cannot recognize the multi-byte sequences of emojis, leading to broken block symbols or missing text.

Does ASCII support line breaks and spaces?

Yes. ASCII includes control characters to format text layout. Code 32 represents a standard space, code 10 represents a line feed (new line), and code 13 represents a carriage return. These characters tell systems where to break lines and insert gaps.

Summary: The Legacy of ASCII

ASCII was a monumental milestone in the history of information technology. It was the standard that allowed different machines to speak the same language, paving the way for the internet, standardized programming, and file exchange. However, its limited capacity made it obsolete as a global character set.

As computers became multilingual, a broader solution was required. In our next guide, What Is Unicode? A Beginner's Guide to Modern Text, we will walk you through how Unicode solved ASCII's scaling problem and how it serves as the dictionary for every language, symbol, and emoji online today.

💻

Explore Free Text & Productivity Tools

Need to clean, format, or convert text? Check out our free, privacy-friendly online utilities to clean AI text, remove formatting, and manage character layouts.

View All Tools

Related Articles

July 8, 2026

What Is Unicode? A Beginner's Guide to Modern Text

Unicode is the universal character standard that allows computers to display text, symbols, and emojis from almost every language in the world. Learn what Unicode is, how it works, and why it replaced older standards.

July 9, 2026

What Is UTF-8 Encoding? A Beginner's Guide

UTF-8 is the standard system that allows computers to store, read, and share Unicode text efficiently. Learn what UTF-8 is, how it works, and why it is the default encoding for the modern web.

July 10, 2026

How Secure Are Password Generators? (Complete Guide)

A well-designed password generator is significantly more secure than creating your own password. However, not every password generator follows the same security standards. Learn how secure password generators work and what makes them trustworthy.