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:
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:
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 |
|---|---|---|---|---|
| 32 | 20 | 00100000 | [Space] | Space character |
| 33 | 21 | 00100001 | ! | Exclamation mark |
| 34 | 22 | 00100010 | " | Double quotation mark |
| 35 | 23 | 00100011 | # | Number sign (hash) |
| 36 | 24 | 00100100 | $ | Dollar sign |
| 37 | 25 | 00100101 | % | Percent sign |
| 38 | 26 | 00100110 | & | Ampersand |
| 39 | 27 | 00100111 | ' | Single quotation mark (apostrophe) |
| 40 | 28 | 00101000 | ( | Left parenthesis |
| 41 | 29 | 00101001 | ) | Right parenthesis |
| 42 | 2A | 00101010 | * | Asterisk |
| 43 | 2B | 00101011 | + | Plus sign |
| 44 | 2C | 00101100 | , | Comma |
| 45 | 2D | 00101101 | - | Hyphen / minus sign |
| 46 | 2E | 00101110 | . | Full stop (period) |
| 47 | 2F | 00101111 | / | Slash (solidus) |
| 48 | 30 | 00110000 | 0 | Digit zero |
| 49 | 31 | 00110001 | 1 | Digit one |
| 50 | 32 | 00110010 | 2 | Digit two |
| 51 | 33 | 00110011 | 3 | Digit three |
| 52 | 34 | 00110100 | 4 | Digit four |
| 53 | 35 | 00110101 | 5 | Digit five |
| 54 | 36 | 00110110 | 6 | Digit six |
| 55 | 37 | 00110111 | 7 | Digit seven |
| 56 | 38 | 00111000 | 8 | Digit eight |
| 57 | 39 | 00111001 | 9 | Digit nine |
| 58 | 3A | 00111010 | : | Colon |
| 59 | 3B | 00111011 | ; | Semicolon |
| 60 | 3C | 00111100 | < | Less-than sign |
| 61 | 3D | 00111101 | = | Equal sign |
| 62 | 3E | 00111110 | > | Greater-than sign |
| 63 | 3F | 00111111 | ? | Question mark |
| 64 | 40 | 01000000 | @ | At sign |
| 65 | 41 | 01000001 | A | Uppercase A |
| 66 | 42 | 01000010 | B | Uppercase B |
| 67 | 43 | 01000011 | C | Uppercase C |
| 68 | 44 | 01000100 | D | Uppercase D |
| 69 | 45 | 01000101 | E | Uppercase E |
| 70 | 46 | 01000110 | F | Uppercase F |
| 71 | 47 | 01000111 | G | Uppercase G |
| 72 | 48 | 01001000 | H | Uppercase H |
| 73 | 49 | 01001001 | I | Uppercase I |
| 74 | 4A | 01001010 | J | Uppercase J |
| 75 | 4B | 01001011 | K | Uppercase K |
| 76 | 4C | 01001100 | L | Uppercase L |
| 77 | 4D | 01001101 | M | Uppercase M |
| 78 | 4E | 01001110 | N | Uppercase N |
| 79 | 4F | 01001111 | O | Uppercase O |
| 80 | 50 | 01010000 | P | Uppercase P |
| 81 | 51 | 01010001 | Q | Uppercase Q |
| 82 | 52 | 01010010 | R | Uppercase R |
| 83 | 53 | 01010011 | S | Uppercase S |
| 84 | 54 | 01010100 | T | Uppercase T |
| 85 | 55 | 01010101 | U | Uppercase U |
| 86 | 56 | 01010110 | V | Uppercase V |
| 87 | 57 | 01010111 | W | Uppercase W |
| 88 | 58 | 01011000 | X | Uppercase X |
| 89 | 59 | 01011001 | Y | Uppercase Y |
| 90 | 5A | 01011010 | Z | Uppercase Z |
| 91 | 5B | 01011011 | [ | Left square bracket |
| 92 | 5C | 01011100 | \ | Backslash |
| 93 | 5D | 01011101 | ] | Right square bracket |
| 94 | 5E | 01011110 | ^ | Caret / circumflex accent |
| 95 | 5F | 01011111 | _ | Underscore |
| 96 | 60 | 01100000 | ` | Grave accent (backtick) |
| 97 | 61 | 01100001 | a | Lowercase a |
| 98 | 62 | 01100010 | b | Lowercase b |
| 99 | 63 | 01100011 | c | Lowercase c |
| 100 | 64 | 01100100 | d | Lowercase d |
| 101 | 65 | 01100101 | e | Lowercase e |
| 102 | 66 | 01100110 | f | Lowercase f |
| 103 | 67 | 01100111 | g | Lowercase g |
| 104 | 68 | 01101000 | h | Lowercase h |
| 105 | 69 | 01101001 | i | Lowercase i |
| 106 | 6A | 01101010 | j | Lowercase j |
| 107 | 6B | 01101011 | k | Lowercase k |
| 108 | 6C | 01101100 | l | Lowercase l |
| 109 | 6D | 01101101 | m | Lowercase m |
| 110 | 6E | 01101110 | n | Lowercase n |
| 111 | 6F | 01101111 | o | Lowercase o |
| 112 | 70 | 01110000 | p | Lowercase p |
| 113 | 71 | 01110001 | q | Lowercase q |
| 114 | 72 | 01110010 | r | Lowercase r |
| 115 | 73 | 01110011 | s | Lowercase s |
| 116 | 74 | 01110100 | t | Lowercase t |
| 117 | 75 | 01110101 | u | Lowercase u |
| 118 | 76 | 01110110 | v | Lowercase v |
| 119 | 77 | 01110111 | w | Lowercase w |
| 120 | 78 | 01111000 | x | Lowercase x |
| 121 | 79 | 01111001 | y | Lowercase y |
| 122 | 7A | 01111010 | z | Lowercase z |
| 123 | 7B | 01111011 | { | Left curly bracket |
| 124 | 7C | 01111100 | | | Vertical bar (pipe) |
| 125 | 7D | 01111101 | } | Right curly bracket |
| 126 | 7E | 01111110 | ~ | 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 |
|---|---|---|---|---|
| 0 | 00 | 00000000 | NUL | Null character (empty character) |
| 1 | 01 | 00000001 | SOH | Start of Heading |
| 2 | 02 | 00000010 | STX | Start of Text |
| 3 | 03 | 00000011 | ETX | End of Text |
| 4 | 04 | 00000100 | EOT | End of Transmission |
| 5 | 05 | 00000101 | ENQ | Enquiry |
| 6 | 06 | 00000110 | ACK | Acknowledge |
| 7 | 07 | 00000111 | BEL | Bell (trigger system beep sound) |
| 8 | 08 | 00001000 | BS | Backspace |
| 9 | 09 | 00001001 | HT / TAB | Horizontal Tab |
| 10 | 0A | 00001010 | LF | Line Feed (new line / move down) |
| 11 | 0B | 00001011 | VT | Vertical Tab |
| 12 | 0C | 00001100 | FF | Form Feed (new page / print page) |
| 13 | 0D | 00001101 | CR | Carriage Return (move cursor to start of line) |
| 14 | 0E | 00001110 | SO | Shift Out (alternate character set) |
| 15 | 0F | 00001111 | SI | Shift In (default character set) |
| 16 | 10 | 00010000 | DLE | Data Link Escape |
| 17 | 11 | 00010001 | DC1 | Device Control 1 (XON / resume transfer) |
| 18 | 12 | 00010010 | DC2 | Device Control 2 |
| 19 | 13 | 00010011 | DC3 | Device Control 3 (XOFF / pause transfer) |
| 20 | 14 | 00010100 | DC4 | Device Control 4 |
| 21 | 15 | 00010101 | NAK | Negative Acknowledge |
| 22 | 16 | 00010110 | SYN | Synchronous Idle |
| 23 | 17 | 00010111 | ETB | End of Transmission Block |
| 24 | 18 | 00011000 | CAN | Cancel |
| 25 | 19 | 00011001 | EM | End of Medium |
| 26 | 1A | 00011010 | SUB | Substitute (indicates EOF / end of file in MS-DOS) |
| 27 | 1B | 00011011 | ESC | Escape key |
| 28 | 1C | 00011100 | FS | File Separator |
| 29 | 1D | 00011101 | GS | Group Separator |
| 30 | 1E | 00011110 | RS | Record Separator |
| 31 | 1F | 00011111 | US | Unit Separator |
| 127 | 7F | 01111111 | DEL | Delete 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.