ToolNimba
πŸ“ Unit Converters

What Is ASCII? The 7-Bit Code Behind Every Character

Shihab Mia By Shihab Mia July 18, 2026 5 min read

Colorful illustration of letters and symbols transforming into glowing binary numbers on a circuit board

Quick answer

ASCII (American Standard Code for Information Interchange) is a 7-bit character encoding that maps 128 numeric codes, 0 to 127, to characters. Each letter, digit and symbol gets one number: uppercase A is 65, lowercase a is 97, the digit 0 is 48, and a space is 32. Computers store text by storing these numbers.

Every time you type a letter, the computer does not store the shape of the letter. It stores a number. ASCII is the agreement that decides which number stands for which character, so that the "H" you type on one machine shows up as an "H" on another. Published in 1963, it is one of the oldest and most important standards in computing, and it still sits at the heart of the text you are reading right now.

What ASCII actually is

ASCII stands for the American Standard Code for Information Interchange. It is a lookup table: on one side you have a number, on the other side you have a character. Because ASCII uses 7 bits, it can represent 2 to the power of 7, which is exactly 128 distinct codes, numbered 0 through 127.

Those 128 codes split into three useful groups. Codes 0 to 31 are non-printing control characters, instructions like "start a new line" rather than visible symbols. Codes 32 to 126 are the printable characters you can actually see: letters, digits, punctuation and the space. Code 127 is a special control code called delete. If you want to see every code side by side, our ASCII table reference lays out all 128 in one place.

How the 128 codes are organized

The genius of ASCII is that the codes are not random. Related characters sit next to each other in tidy, predictable blocks, which makes many programming tricks simple. Here is the layout:

The main blocks of the ASCII code range

Code rangeWhat it holdsExamples
0 to 31Control characters (non-printing)Tab is 9, newline is 10, carriage return is 13
32SpaceThe blank between words
33 to 47Punctuation and symbols! is 33, # is 35, + is 43
48 to 57Digits 0 to 90 is 48, 5 is 53, 9 is 57
65 to 90Uppercase letters A to ZA is 65, M is 77, Z is 90
97 to 122Lowercase letters a to za is 97, m is 109, z is 122
127DeleteA single control code

Two patterns are worth memorizing. First, the digit characters start at 48, so the character "0" is code 48 and "9" is code 57. Second, uppercase and lowercase letters are exactly 32 codes apart: A is 65 and a is 97, B is 66 and b is 98, and so on. That constant gap of 32 is why converting a letter between upper and lower case is just simple arithmetic for a computer.

Control characters: the invisible codes

The first 32 codes do not print anything. They were designed in the teletype era to control machines, and several are still used constantly today. These are the ones that matter most:

  • Tab (code 9) moves the cursor to the next tab stop.
  • Line Feed (code 10) starts a new line. In code it is often written as \n and called "newline".
  • Carriage Return (code 13) returns to the start of the line. Windows text files use 13 then 10 to end a line.
  • Null (code 0) represents nothing, and in many languages it marks the end of a text string.
  • Escape (code 27) starts special command sequences, for example the codes that color text in a terminal.

You never see these characters as shapes, but they quietly shape every document. When a text file looks fine on a Mac but has odd line breaks on Windows, a control character mismatch is usually the reason.

Worked example: encode the word "Hi"

Encoding text into ASCII means replacing each character with its code. Let us encode the word Hi by hand, then show it in binary, the way a computer stores it.

  1. Take the first character, uppercase H. Look it up: H is code 72.
  2. Take the second character, lowercase i. Look it up: i is code 105.
  3. So "Hi" in ASCII decimal is 72 105.
  4. Now convert each number to 8-bit binary. 72 becomes 01001000 and 105 becomes 01101001.
  5. The computer stores "Hi" as the two bytes 01001000 01101001.

Notice each byte starts with a 0. Because ASCII only needs 7 bits, the top bit of each byte is always 0 for a pure ASCII character. If you would rather not do this by hand, our text to ASCII tool does it instantly, and ASCII to binary takes it the rest of the way. To understand the binary step itself, see how to read binary code.

Extended ASCII and the jump to Unicode

Standard ASCII stops at 127, but a byte holds 8 bits, which can count all the way to 255. That leftover range, codes 128 to 255, is where Extended ASCII lives. It uses the 8th bit to add another 128 characters, such as accented letters (Γ©, Γ±, ΓΌ), currency symbols and box-drawing shapes. The catch is that there was never one single Extended ASCII; different systems filled 128 to 255 with different characters, which caused endless garbled-text problems.

That mess is what Unicode and UTF-8 were created to fix, and here is the elegant part: the first 128 code points of Unicode and UTF-8 are identical to ASCII. The letter A is code 65 in ASCII, in Unicode, and in UTF-8 alike. Any plain-ASCII file is already a valid UTF-8 file with no changes. That backward compatibility is exactly why ASCII, after more than 60 years, is still the foundation modern text is built on. If you often work across number systems, the ideas connect closely to what is hexadecimal, since ASCII codes are frequently written in hex too.

Common mistakes and good to know

  • The character "5" is not the number 5. The digit "5" is ASCII code 53, not 5. Treating a text digit as a real number without converting is a classic bug.
  • Uppercase and lowercase are different codes. "A" is 65 and "a" is 97, so ASCII-based sorting and comparisons are case sensitive unless you handle it.
  • A space is a real character. Code 32 takes up a byte just like a letter, so "hi" and "hi " are not equal.
  • ASCII covers English only. It has no built-in support for Γ©, δΈ­, or emoji. Anything beyond plain English needs Unicode or UTF-8.
  • Line endings differ by system. Old Mac used code 13, Unix uses 10, and Windows uses 13 then 10. This trips up file transfers surprisingly often.
πŸ”€ Try the free tool Text to ASCII Code Converter Free text to ASCII converter: turn any text into ASCII decimal codes instantly. Type Hi to get 72 105, choose space, comma, or newline separators, and copy the result.

ASCII is a small idea with an enormous reach: 128 numbers, a fixed meaning for each, and an agreement everyone follows. That is all it takes to turn the letters, digits and symbols on your screen into data a machine can store, send and share. Understand the table, remember that A is 65 and a is 97, and you understand the layer that every piece of digital text still stands on.

Frequently asked questions

Tools used in this guide

Keep reading