ToolNimba
๐Ÿ“ Unit Converters

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

Shihab Mia By Shihab Mia July 18, 2026 8 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, not the shapes of the letters.

What ASCII actually is

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 the "H" you type on one machine shows up as an "H" on another. First published in 1963 by the American Standards Association (the predecessor of ANSI), it is one of the oldest surviving standards in computing, and it still sits underneath the text you are reading right now.

ASCII stands for the American Standard Code for Information Interchange. It is a lookup table: on one side a number, on the other side a character. Because ASCII uses 7 bits, it can represent 2 to the power of 7, exactly 128 distinct codes, numbered 0 through 127. The full technical definition still lives on in RFC 20, the 1969 internet standards document that formally specified ASCII for network interchange.

How are the 128 ASCII codes organized?

The 128 codes are not random. Related characters sit next to each other in tidy, predictable blocks, which is what makes many programming tricks possible. 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.

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, digit characters start at 48, so the character "0" is code 48 and "9" is code 57, meaning the text digit and its numeric value are 48 apart. 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 through the alphabet. That constant gap of 32 is why converting a letter between upper and lower case is just simple arithmetic for a computer, not a lookup in a separate table.

Why does A equal 65 in ASCII?

The layout was not an accident. The committee behind the 1963 standard, whose work is often credited to IBM engineer Bob Bemer, deliberately ordered the blocks so sorting and comparing text would be cheap on the limited hardware of the era. Control codes came first for machine instructions, punctuation came next from older telegraph codes, and digits were placed before letters, with uppercase before lowercase, so a plain numeric comparison of codes would also sort text sensibly. That single choice is why "Apple" sorts before "apple" using nothing more than subtraction, and why a program can test if a character is an uppercase letter just by checking whether its code falls between 65 and 90.

What are ASCII control characters?

The first 32 codes, plus code 127, 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 you open. When a text file looks fine on a Mac but has odd line breaks on Windows, or when a file diff shows every line as changed for no visible reason, a control character mismatch is usually the cause.

How do you convert text to ASCII?

Encoding text into ASCII means replacing each character with its code. Let us encode the word Hi by hand, then show it in binary and hex, the ways a computer actually stores and displays 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. Convert each number to 8-bit binary. 72 becomes 01001000 and 105 becomes 01101001.
  5. Convert each number to hexadecimal instead. 72 becomes 0x48 and 105 becomes 0x69, which is why some tools display "Hi" as 48 69.
  6. 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. That spare bit is exactly what Extended ASCII later borrowed, covered below. 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, or if you would rather convert whole sentences straight to bits, how to convert text to binary walks through it end to end.

What is the difference between ASCII and 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 (e with an accent, n with a tilde, u with an umlaut), 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 when files moved between machines.

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 needed. 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, especially in error messages and debuggers.

Where is ASCII still used today?

ASCII rarely gets top billing anymore, but it is working quietly underneath far more of the internet than most people realize:

  • Programming language syntax. Keywords, operators and variable names in almost every language are restricted to ASCII letters, digits and a handful of punctuation marks, even in languages that fully support Unicode elsewhere.
  • URLs and domain names. Web addresses are built from ASCII characters; non-ASCII domain names get converted through Punycode so browsers can route them using plain ASCII underneath.
  • Email and HTTP headers. Message headers, MIME boundaries and HTTP status lines are specified in ASCII, which is why non-ASCII subject lines and filenames get specially encoded before they travel.
  • Configuration files and protocols. Formats like JSON, CSV and INI files, along with protocols like SMTP and FTP, use ASCII control characters and printable characters as their structural backbone.
  • Git and version control. Commit hashes, branch names and diff markers are pure ASCII, which keeps them portable across every operating system and terminal.
๐Ÿ”ค 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.

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 it first is a classic bug, especially when reading data from a file.
  • Uppercase and lowercase are different codes. "A" is 65 and "a" is 97, so ASCII-based sorting and comparisons are case sensitive unless you deliberately normalize the case first.
  • A space is a real character. Code 32 takes up a byte just like a letter, so "hi" and "hi " are not equal, and trailing spaces can silently break exact-match comparisons.
  • ASCII covers English only. It has no built-in support for accented letters, Chinese characters, or emoji. Anything beyond plain English needs Unicode or UTF-8.
  • Line endings differ by system. Old Mac used code 13 alone, Unix and Linux use 10 alone, and Windows uses 13 then 10 together. This trips up file transfers and code diffs surprisingly often.
  • "ASCII" and "plain text" are not the same thing. A plain text file saved as UTF-8 can still contain non-ASCII characters; plain text just means no formatting markup, not that every byte is under 128.

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

What does ASCII stand for?

ASCII stands for the American Standard Code for Information Interchange. It is a 7-bit character encoding standard, first published in 1963, that assigns a unique number from 0 to 127 to each letter, digit, punctuation mark and control instruction, so computers can store and exchange text consistently.

How many characters does ASCII have?

Standard ASCII defines 128 codes, numbered 0 to 127, because it uses 7 bits (2 to the power of 7 equals 128). Of these, codes 0 to 31 and 127 are non-printing control characters, while codes 32 to 126 are the 95 printable characters, including letters, digits, symbols and the space.

What is the ASCII code for A?

Uppercase A is ASCII code 65. Lowercase a is code 97, exactly 32 higher. This constant gap of 32 applies to every letter, so B is 66 and b is 98. That predictable offset is why computers can switch letter case using simple arithmetic on the codes instead of a separate lookup table.

What is the difference between ASCII and Unicode?

ASCII is a 7-bit code with only 128 characters, enough for English text. Unicode is a far larger standard covering over a million code points for every writing system plus emoji. Crucially, Unicode's first 128 code points match ASCII exactly, so ASCII is a subset of Unicode and stays fully compatible.

Is ASCII still used today?

Yes. ASCII remains the foundation of modern text because the first 128 characters of UTF-8, the dominant encoding on the web, are identical to ASCII. Any plain-ASCII file is already valid UTF-8. Programming languages, URLs, email headers and version control systems still rely on ASCII codes every day.

What are ASCII control characters?

Control characters are ASCII codes 0 to 31 plus 127 that give instructions instead of printing a symbol. Common ones include tab (9), line feed or newline (10), and carriage return (13). They were designed to control early teletype machines and still govern line breaks and formatting in text files today.

Tools used in this guide

Keep reading