Developer

What Is ASCII? 7 Bits for 128 Characters, Control vs. Printable, and A=65

ASCII is the most basic character code, mapping letters, digits, and symbols to numbers (sequences of bits). This article explains what ASCII is, how 7 bits represent 128 characters, the difference between control and printable characters, the A=65 / a=97 / 0=48 rules, extended ASCII, the relationship with Unicode and UTF-8, and how to convert between characters and numbers.

Published: 2026-10-16

Internally, computers handle everything as numbers made of 0s and 1s. So how is a character like "A" or "7" actually stored as a number? The agreement that bridges this gap is a character code, and its starting point was ASCII. This article explains, step by step, what ASCII is, why it has 128 characters, and how mappings like A=65 are decided.

What Is ASCII

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns a unique number to each letter, digit, and symbol. Established in the United States in 1963, it spread widely as a common rule for computers to exchange text. Almost every character code in use today is built as an extension on top of ASCII.

In a word, the role of ASCII is to be a conversion table that maps "characters" to "numbers" one-to-one. For example, the uppercase "A" is assigned 65, and the lowercase "a" is assigned 97. Because a computer cannot store characters themselves, it replaces them with these numbers for storage and transmission, then converts them back to characters when displaying them.

To see exactly which character corresponds to which number, enter a character in the ASCII Converter and convert it to a number. You can also go back from a number to a character, so you can confirm the mapping hands-on.

How 7 Bits Represent 128 Characters

A major feature of ASCII is that each character is represented with 7 bits. A bit is the smallest unit, taking either 0 or 1, and lining up seven of them gives 2 to the 7th power, that is, 128 combinations. Each of these 128 combinations is assigned a number (a character code) from 0 to 127.

2^7 = 128 → code numbers 0–127

Because modern computers often handle data in 8-bit (1-byte) units, ASCII characters are in fact stored in 1 byte. The leftover most significant bit is fixed at 0 in the original standard ASCII. In other words, the lower half of a byte (0–127) is the standard ASCII region.

  • 7 bits: the range that standard ASCII defines, 128 characters from 0 to 127.
  • Most significant bit: 0 in standard ASCII. The remaining 128–255 are used by extended ASCII, described later.

This frame of 128 characters was a clever size that could cover almost everything needed to read and write English: uppercase and lowercase letters, digits, symbols, and special codes for controlling screens and communications, all fit inside it.

Control Characters and Printable Characters

The 128 characters from 0 to 127 fall into two broad groups by nature: control characters and printable characters.

GroupCode rangeContent
Control characters0–31 and 127Commands with no on-screen shape, such as newline and tab
Printable characters32–126Visible characters such as space, symbols, digits, and letters

Control characters are not themselves displayed as characters on screen. For example, code 10 is line feed (LF), code 9 is horizontal tab (TAB), and code 13 is carriage return (CR); these are codes that instruct text formatting or device behavior. They are a legacy of controlling old communication equipment, and some are rarely used today.

Printable characters are the characters we usually see. Code 32 is the space (blank), codes 48–57 are the digits "0"–"9," codes 65–90 are the uppercase "A"–"Z," and codes 97–122 are the lowercase "a"–"z," with various symbols in between. Note that although the space shows "nothing," it is still treated as a genuine printable character.

The A=65, a=97, 0=48 Rules

The ASCII table does not assign numbers haphazardly; the key to its convenience is that it is laid out in a regular order. Remembering the representative ones is helpful when programming.

  • Digit "0" = 48: then "1" = 49, "2" = 50, and so on, ending at "9" = 57.
  • Uppercase "A" = 65: then "B" = 66, and so on, ending at "Z" = 90.
  • Lowercase "a" = 97: then "b" = 98, and so on, ending at "z" = 122.

What is worth noting is the rule that uppercase and lowercase are exactly 32 apart. Adding 32 to "A" (65) gives "a" (97). Inside a computer, you can use this difference of 32 to convert between uppercase and lowercase. Because the alphabet is laid out in consecutive numbers, you can easily write processes such as "subtract 48 from the code to get the numeric value of a digit" or "compare the order to sort alphabetically."

This regularity is no accident; it is the result of a design meant to process characters efficiently. If you enter "A," "a," and "0" in the ASCII Converter and confirm they become 65, 97, and 48, the rule should click into place.

Extended ASCII and the Relationship with Unicode / UTF-8

Because standard ASCII was made for English, it cannot represent accented letters or characters from other languages. So extended ASCII assigns additional characters to the remaining 128–255 region that a single byte (8 bits) can express. However, which characters go in this region differs by region and standard, and many competing schemes appeared. This became a cause of the problem where the same code turns into a different character (garbled text) in a different environment.

Unicode was created to handle every character in the world in a unified way. Unicode is, in effect, a vast ledger that assigns a unique number (a code point) to an enormous set of characters, including kanji and emoji. And the representative method for converting those code points into an actual byte sequence is UTF-8.

What is important here is that UTF-8 is fully compatible with ASCII. Characters with codes 0–127 are represented in UTF-8 by exactly the same single byte as in ASCII. Characters like Japanese are represented with 2 to 4 bytes, but the alphanumeric part stays as ASCII. That is precisely why it can interoperate with old systems without friction, and UTF-8 has become the de facto standard on today's internet. ASCII did not disappear; it lives on as the foundation of modern character codes.

Converting Between Characters and Numbers

Once you understand ASCII, converting between "character and number" becomes familiar. Many programming languages provide a function that turns a character into its code number (e.g., ord) and one that turns a code number back into a character (e.g., chr).

CharacterDecimalHexadecimal
A6541
a9761
04830
(space)3220

As the table shows, character codes are often written not only in decimal but also in hexadecimal. When you look inside a program or its data, characters may appear as a run of hex like "41 61 30." This is because hexadecimal is easier to read given that computers handle data in bytes. When you want to try converting between hex and text, the Hex Text Converter lets you directly confirm what byte sequence a string becomes.

To summarize the flow of conversion, it is a two-stage process: a character is first mapped to a character code (a number), and that number is then expressed in decimal or hexadecimal. By going back and forth—turning characters into numbers with the ASCII Converter, and numbers into a hex sequence with the Hex Text Converter—you can understand in three dimensions how characters are represented inside a computer.

ASCII is the most basic agreement that links characters and numbers, and it is the cornerstone of modern character codes such as Unicode and UTF-8. Seeing and touching the mechanism is the shortcut to understanding, so start by converting familiar characters and feel the regularity of the mapping for yourself.

Please note that this article is intended to provide general information. Character code specifications differ in fine detail by standard and are sometimes revised. If you need accurate information, make your decision after checking the latest official standards and documentation.

FAQ

What is ASCII?

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns a unique number to each letter, digit, and symbol. It represents each character with 7 bits, defining 128 characters from 0 to 127. It is the most basic common rule for computers to store and exchange characters as numbers, and it is the foundation of many modern character codes.

Why does ASCII have 128 characters?

Because ASCII represents each character with 7 bits. Seven bits have 2 to the 7th power, or 128 combinations, each assigned a number from 0 to 127. Modern computers usually handle data in 8-bit (1-byte) units, and the leftover most significant bit is fixed at 0 in standard ASCII. The 128–255 region is used for different characters as extended ASCII.

What is the difference between control and printable characters?

Control characters (codes 0–31 and 127) have no on-screen shape, like newline and tab, and act as codes that instruct device or text behavior. Printable characters (codes 32–126) are visible characters such as space, symbols, digits, and letters. Note that although the space is invisible, it is treated as a printable character.

What rules govern A=65, a=97, and 0=48?

The digits "0"–"9" are 48–57, the uppercase "A"–"Z" are 65–90, and the lowercase "a"–"z" are 97–122, each in consecutive order. In particular, uppercase and lowercase are exactly 32 apart, so adding 32 to "A" gives "a." Thanks to this regularity, you can easily process case conversion and alphabetical sorting.

Are the characters I enter in the ASCII Converter sent to a server?

WAZA TOOLS' ASCII Converter and Hex Text Converter run entirely in your browser, so the characters you enter and the conversion results are never sent to or stored on a server. They work on smartphones too, and you can try converting between characters and numbers as many times as you like, for free.