ASCII Table Explained: Codes, Letters and Control Characters

How does a computer store the letter H? It does not store a shape at all. It stores the number 72, and ASCII is the table that makes that agreement.

Quick Answer

ASCII is a character code from the 1960s that gives 128 characters a number from 0 to 127. That is 95 printable characters and 33 control codes. A capital A is 65, a lowercase a is 97, and the gap is 32. UTF-8 keeps the same first 128 codes.

What ASCII Is and Where It Came From

ASCII stands for American Standard Code for Information Interchange. It is a character encoding standard with 128 code points in total. Each one is a number from 0 to 127, so seven bits are enough to store it.

Work began in May 1961, when IBM engineer Bob Bemer sent a proposal to the American Standards Association, now called ANSI. The first edition was published in 1963. A major revision followed in 1967, and further updates continued until 1986.

In 1969, RFC 20 described how to send the code over networks. It suggested standard 7-bit ASCII placed inside an 8-bit byte whose high bit is always 0. If bits and bytes are new to you, our guide to bits vs bytes covers the basics.

The designers also ordered the table for convenient collation, which means alphabetical sorting. IANA prefers the name US-ASCII for it.

Reading the 128 Codes in Three Blocks

The table has three blocks. Codes 0 to 31 are control codes. Codes 32 to 126 are the 95 printable characters. Code 127 is DEL, another control code, which brings the control total to 33. The chart draws the blocks to scale.

The 128 ASCII codes drawn to scale One long horizontal strip of 128 equal slots. The first 32 slots, codes 0 to 31, are control codes in coral. The next 95 slots, codes 32 to 126, are printable characters in teal. Inside that block, digits 48 to 57 are amber, capital letters 65 to 90 are navy, and lowercase letters 97 to 122 are slate blue. The last slot, code 127, is DEL in dark coral. All 128 ASCII codes in one strip Control Digits Capitals Lowercase 0 to 31 48 to 57 65 to 90 97 to 122 127 DEL Printable: codes 32 to 126 (95 codes) Control codes = 0 to 31 plus 127 = 33. Space (32) and punctuation fill the teal gaps.
Every ASCII code fits in one strip of 128 slots.

Inside the printable block, the groups sit in order. Space is 32, digits run from 48 to 57, capitals from 65 to 90, and lowercase from 97 to 122. Punctuation fills the gaps. Because each group forms one solid run, software can test a character’s group with a simple range check. To look up any code or character, use our ASCII converter, which shows decimal and hex side by side.

The Case Trick: Why Capitals Differ by 32

Every lowercase letter sits exactly 32 above its capital. A is 65 and a is 97, a gap of 32. Q is 81 and q is 113, and the gap is 32 again. Z is 90, and adding 32 gives 122, which is z.

Binary shows why. The number 32 is 00100000, a single 1 in one place. Adding it flips just one bit, as the diagram shows. The designers put lowercase letters in columns 6 and 7 of the original chart, so upper and lower case differ by one bit. That simplified case-insensitive matching.

Capital A and lowercase a differ by one bit Two rows of eight squares, one per bit. The top row is capital A, code 65, written 0 1 0 0 0 0 0 1. The bottom row is lowercase a, code 97, written 0 1 1 0 0 0 0 1. Only the third square from the left differs, and it is highlighted in coral. Place values 128, 64, 32, 16, 8, 4, 2 and 1 sit under the squares. One flipped bit turns A into a A = 65 a = 97 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 1 128 64 32 16 8 4 2 1 Only the 32 place changes, so 65 + 32 = 97.
Capital A and lowercase a differ only in the 32 place.

You can change case with plain arithmetic. Subtract 32 from each code in 104 101 108 108 111 and you get 72 69 76 76 79, which spells HELLO. Use this only on letters, because digits and spaces do not follow the same pattern.

Digits, Space and the Control Characters

Digits are the easiest group. The digit 0 has code 48, and the digit 9 has code 57. A digit’s value is its code minus 48. The digit 7 has code 55, and 55 minus 48 is 7. That one subtraction turns a typed digit into its number.

The space has a code too. It is 32, or 20 in hex, and counts as a printable character with no visible glyph. The 33 control codes began on Teletype devices, and most are now obsolete. Three are still common: tab, line feed and carriage return.

Common ASCII codes worth remembering
Item Decimal Hex Group
Tab 9 09 Control
Line feed 10 0A Control
Carriage return 13 0D Control
Space 32 20 Printable
Digit 0 48 30 Printable
Digit 9 57 39 Printable
DEL 127 7F Control

Hex is simply base 16, and the same notation writes web colors. Our guide to hex color codes shows that other use.

Worked Conversions: Hi and Hello!

Converting text is a lookup, one character at a time. H is 72 and i is 105, so Hi is 72 105. In hex that is 48 69. In binary it is 01001000 01101001.

How Hi becomes numbers and bits A two-row flow with four columns: character, decimal, hex and binary. The first row shows H, then 72, then 48, then 01001000. The second row shows i, then 105, then 69, then 01101001. Arrows point left to right between the columns. Hi becomes 72 105, then bits Character Decimal Hex Binary H 72 48 01001000 i 105 69 01101001 Each character fills one byte; the leading 0 is the unused eighth bit.
Each character becomes one decimal code, one hex pair and eight bits.

Now a longer case. Hello! has six characters, and the exclamation mark counts as one. The table lists each step, and the binary column keeps all eight digits, including leading zeros.

Converting Hello! one character at a time
Character Decimal Hex Binary
H 72 48 01001000
e 101 65 01100101
l 108 6C 01101100
l 108 6C 01101100
o 111 6F 01101111
! 33 21 00100001

Read down the decimal column and you get 72 101 108 108 111 33. The converter gives the same six codes, with hex 48 65 6C 6C 6F 21. The longer phrase Hello, World! has 13 characters, because the comma and the space each count. For help moving between decimal, hex and binary, see converting between number bases.

How ASCII Fits Inside Unicode and UTF-8

ASCII is a small part of a much larger system. The first 128 code points of Unicode match ASCII one to one, so capital A is 65 in both. UTF-8 is backward compatible with it. A UTF-8 file using only those characters is identical to an ASCII file. Plain English text therefore survives the move to UTF-8 unchanged.

The difference shows up above 127. ASCII has no code points for accented letters. In Unicode, code 233 is the letter e with an acute accent, and code 8364 is the euro sign. Neither is ASCII, and UTF-8 stores each one in more than one byte.

ASCII compared with UTF-8
Feature ASCII UTF-8
Number of codes 128 1,112,064 valid Unicode code points
Bytes per character One (7 bits used) One to four
Accented letters No code points Supported
Web role Most common encoding until December 2007 Surpassed ASCII then; about 99.1 percent of pages as of 2026

Common ASCII Mistakes to Avoid

Most ASCII errors come from a few mix-ups. Check this list when a conversion looks wrong.

  • Calling codes above 127 ASCII. The table stops at 127. Codes such as 233 belong to Unicode.
  • Mixing decimal and hex. Always name the base, since 48 in decimal is 30 in hex.
  • Forgetting the space. It has a code of its own, which is 32.
  • Treating the digit 0 as code 0. The digit is 48. Code 0 is a control code.
  • Expecting alphabetical sorting. Capitals (65 to 90) come before lowercase (97 to 122), so a plain code-order sort puts Banana before apple before cherry.
  • Pasting accented text into an ASCII-only field. The accented letters have no ASCII code.

When in doubt, check how your own software handles characters beyond 127.

Want to check a code yourself?

Type any text into the ASCII converter to see its decimal and hex codes, or enter codes to get the text back.

FAQs About the ASCII Table

How many characters are in the ASCII table?

There are 128 in total. That is 95 printable characters, plus 33 control codes made up of codes 0 to 31 and code 127 (DEL).

What is the ASCII code for a space?

A space is code 32, which is 20 in hex. It counts as a printable character even though it has no visible glyph.

Why do capital and lowercase letters differ by 32?

Lowercase letters sit in later columns of the chart, so the two cases differ by one bit worth 32. For example, A is 65 and a is 97.

Is the ASCII code for the digit 0 equal to 0?

No. The digit 0 is code 48, or 30 in hex. To get a digit’s value, subtract 48 from its code. Code 0 is a control code.

Is code 233 an ASCII character?

No. ASCII stops at 127. Code 233 is the letter e with an acute accent in Unicode, and UTF-8 stores it in more than one byte.

Is UTF-8 the same as ASCII?

Only for the first 128 characters. Those use one byte with the same binary value as ASCII. Beyond them, UTF-8 uses one to four bytes per character.

Why does Banana sort before apple?

Capital letters have codes 65 to 90, which are lower than the lowercase range of 97 to 122. A plain code-order sort therefore puts capitals first.

Sources and Further Reading

References Used in This Article

This article is general reference. The first 128 codes are fixed, but check your own software for how it handles characters beyond them. Reviewed for accuracy by Prof. Dr. Khalil Mudassar, PhD. Last updated 2026-10-15.


Author

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~ More Posts

Shakeel is the Founder and Editor-in-Chief of MultiCalculators.com, with over 15 years of experience in digital publishing and online tool development. He oversees editorial quality, formula accuracy, and usability to ensure the platform delivers reliable, practical calculators for users worldwide.