Computers only understand 0s and 1s, but we type letters, numbers and symbols. Alphanumeric codes connect the two. Each letter, digit or symbol gets a unique binary pattern, so text can be stored, processed and sent from one machine to another.
The main types are ASCII, EBCDIC and Baudot code. Gray code is usually studied in the same chapter, though it is a numeric code. Unicode is the modern standard that replaced most older schemes.
In these notes you will learn:
- What alphanumeric codes are and why they are needed
- How ASCII, EBCDIC, Baudot and Gray code work, with examples
- How a parity bit detects errors
- The differences between the codes, plus revision points and FAQs
What are alphanumeric codes?
An alphanumeric code (also called a character encoding) represents letters (A–Z, a–z), digits (0–9), punctuation and control functions as binary values. The number of bits decides how many characters the code can hold.
| Bits | Combinations | Example code |
|---|---|---|
| 5 | 2⁵ = 32 | Baudot |
| 7 | 2⁷ = 128 | ASCII |
| 8 | 2⁸ = 256 | EBCDIC, Extended ASCII |
Types of alphanumeric codes
1. ASCII code
ASCII (American Standard Code for Information Interchange) is a 7-bit code with 128 characters, numbered 0 to 127. It is the most widely used alphanumeric code in digital systems.
- 33 control characters (codes 0–31 and 127), such as CR (carriage return), HT (horizontal tab) and EOT (end of transmission).
- 95 printable characters: letters, digits, punctuation and space.
- Sequential order: letters and digits follow a binary progression, so alphabetical sorting works with simple binary comparison.
| Character | Decimal | 7-bit binary |
|---|---|---|
| Space | 32 | 0100000 |
| 0 | 48 | 0110000 |
| 1 | 49 | 0110001 |
| A | 65 | 1000001 |
| a | 97 | 1100001 |
The last four bits of a digit’s ASCII code match its BCD value, so “5” ends in 0101. Uppercase and lowercase letters differ by only one bit (A = 1000001, a = 1100001).
Parity bit and the 8th bit
ASCII uses 7 bits, but data is usually handled in 8-bit bytes. The spare bit is often used as a parity bit for error detection.
- Even parity: the parity bit makes the total number of 1s even. “A” (1000001) has two 1s, so the parity bit is 0.
- Odd parity: the parity bit makes the total number of 1s odd.
- “C” (1000011) has three 1s, so with even parity the parity bit is 1.
Parity can detect a single-bit error but cannot correct it. Some systems use the 8th bit for Extended ASCII (256 characters) instead.

Asynchronous vs synchronous transmission
- Asynchronous: each character is framed by a start bit and a stop bit. It is simple but less efficient.
- Synchronous: characters are sent as a continuous stream with no start/stop bits, so more data fits in the same time.
2. EBCDIC code
EBCDIC (Extended Binary Coded Decimal Interchange Code) is an 8-bit code with 256 possible values. IBM developed it, and it is mostly found on IBM mainframes and legacy business systems.
- The name comes from BCD, because the digits 0–9 are built on the BCD structure.
- Letters are not in one continuous block (there are gaps between A–I, J–R and S–Z), so sorting is less straightforward than in ASCII.
- Examples: “A” = 11000001 (C1 in hex), “a” = 10000001 (81), “0” = 11110000 (F0).
3. Baudot code
Baudot code is a 5-bit code from the telegraph and teleprinter era. Five bits give only 32 combinations, so it uses shift codes: 11111 switches to letters and 11011 switches to figures. This lets it cover 26 letters plus numbers and symbols. It has no lowercase letters.
It is rarely used today, but it is important in the history of data communication.

4. Gray code
Gray code (reflected binary code) is a unit-distance code: only one bit changes between two consecutive values. It is not a true alphanumeric code, but it appears in the same chapter of most digital logic notes.
| Decimal | Binary | Gray |
|---|---|---|
| 0 | 0000 | 0000 |
| 1 | 0001 | 0001 |
| 2 | 0010 | 0011 |
| 3 | 0011 | 0010 |
| 4 | 0100 | 0110 |
| 5 | 0101 | 0111 |
| 6 | 0110 | 0101 |
| 7 | 0111 | 0100 |
| 8 | 1000 | 1100 |
| 9 | 1001 | 1101 |
Binary to Gray conversion: keep the MSB as it is. Each next Gray bit is the XOR of the previous binary bit and the current binary bit.
Example: binary 0110 (6) → 0 | 0⊕1=1 | 1⊕1=0 | 1⊕0=1 → Gray 0101.
Uses: rotary encoders, position sensors, telemetry with slowly changing data, and Karnaugh maps. If two or more bits change between readings, the receiver knows an error has occurred.

ASCII vs EBCDIC vs Baudot vs Unicode
| Feature | ASCII | EBCDIC | Baudot | Unicode (UTF-8) |
|---|---|---|---|---|
| Bits | 7 | 8 | 5 | 8–32 (variable) |
| Characters | 128 | 256 | 32 (with shifts) | 1,000,000+ code points |
| Lowercase | Yes | Yes | No | Yes |
| Used in | Most systems | IBM mainframes | Old teleprinters | Web, apps, all languages |
| Sorting | Sequential | Gaps in letters | Limited | Depends on language |
ASCII vs Unicode: ASCII covers only English characters. Unicode supports almost every language, including Nepali (Devanagari) and emoji. UTF-8 keeps the first 128 characters identical to ASCII, so old ASCII text still works.
Applications of alphanumeric codes
- Keyboards, text files, programming and web pages (ASCII, UTF-8)
- Data exchange between computers and communication devices
- Mainframe banking and business systems (EBCDIC)
- Position sensing in industrial machines (Gray code)
Quick revision points
- ASCII = 7-bit, 128 characters. Extended ASCII = 8-bit, 256 characters.
- EBCDIC = 8-bit, used on IBM mainframes.
- Baudot = 5-bit, uses letter/figure shift.
- Gray code = only one bit changes per step.
- Parity bit = simple single-bit error detection.
- Unicode/UTF-8 = modern standard for all languages.
Frequently asked questions
What is the full form of ASCII?
American Standard Code for Information Interchange.
How many characters are in ASCII?
Standard 7-bit ASCII has 128 characters. Extended ASCII has 256.
What is the difference between ASCII and EBCDIC?
ASCII is a 7-bit code used almost everywhere. EBCDIC is an 8-bit code mostly limited to IBM mainframes.
Is Gray code an alphanumeric code?
Not strictly. It is a unit-distance numeric code, but it is taught with alphanumeric codes.
Why is a parity bit used?
To detect single-bit errors in stored or transmitted data.
Which alphanumeric code is most common today?
ASCII, and UTF-8 (which includes ASCII), are the most common.