American Standard Code for Information Interchange

The American Standard Code for Information Interchange (ASCII) arose out of the need to store nonnumerical data in computers. This nonnumerical data includes but is not limited to the letters of the alphabet and punctuation symbols. Data is stored in computers using the binary numerical system. ASCII standardizes the conversion between binary numbers and nonnumerical data. As you can see in the figure below, the ASCII standard assigns binary number 01000010 to capital letter "B."  The decimal number 66 is also assigned. Note that octal and hexadecimal assignments are also made by ASCII, but not covered here. The various number systems are available to suit the needs of particular computer programs. 

Representation Example

Character
Binary #Octal #
Decimal #Hexadecimal #

01000010

102

66

42

b

01100010 

142

98

62

6

00110110

66

54 

36

Space

00100000

40

32

20

00111111

77

63

3F

Let’s take a look at the character representation of the words I'm Adam. Note the binary notation that corresponds to the decimal notation and the corresponding characters. Even punctuation marks, such as apostrophes and periods, have their own ASCII values. A space (_) is a character in its own right.

Note also that capital "A" and lowercase "a" are distinctly different values, though they are conceptually familiar to us humans.

Within ASCII, numerical values for characters retain order where possible. For example, "a" is 97 and "d" is 100, corresponding to their place in the alphabet. When a computer alphabetizes a list, it is actually sorting it numerically. See the ASCII Character Table in the Resources section below for a more complete look.

Character

Binary

Decimal

01001001

73

00100111 

39

m

01101101

109 

space

 00100000

32

01000001

65

d

01100100 

100

a

01100001

97 

m

00101110

109

00101110

46

Text files: On your computer, there are some files in which only the actual text is relevant. That means the formatting of the text (bolditalicizeunderline, etc.) is not important. These text-only files include things such as

  1. configuration files
  2. program source codes
  3. log files
Sample of ASCII
CharacterDecimalBinary

_

95

1011111

96

1100000

a

97 

1100001

b

98

1100010 

c

99

1100011

100

1100100

e

101 

1100101

f

102

1100110 

These files are generically called ASCII or text files because they contain only ASCII characters. They will often have a .txt extension.

ASCII and formatting: The ASCII standard does not include text formatting such as:

Word processors and other application software use their own proprietary schemes to format text. That is one reason why different word processing programs cannot read each other's files without some type of file conversion. For example, Adobe PDFs and Microsoft Word documents are incompatible because they each use their own file schemes to store non-ASCII standard data such as text, formatting, and pictures.

Examples of text formatting including italics, fonts, size, bolding, underlining, and color.

Characters vs. integers ( a "7" is not a 7): Computers store numbers as either integers (quantities) or characters.

Integers: These are numbers stored as quantities that can have calculations performed on them. If two objects weighed 7 pounds and were added together, the answer, 14 pounds, would be  meaningful. Note that binary and decimal are numerical systems that can indicate quantity. So if we converted 14 pounds which is in decimal to binary, it is represented as 1110 pounds.

Characters: Numbers stored as characters do not indicate a numerical weight. Zip codes and telephone numbers are examples of numbers stored as characters. If two zip codes were added together, the result, although mathematically sensible, would be meaningless as far as zip codes are concerned

The concept of text vs. numbers can be illustrated using a spreadsheet:

Why is the content on B2 right-justified in B2 but left-justified in B3? Because, by convention, numbers are generally right-justified (moved to the right) to align the ones, tens, hundreds, etc., in a list of numbers. By contrast, text is usually aligned to the left because in English, we read from left to right. 

 In an Excel sheet, the number 316364242 entered as a character and integer.

International characters: With all the different languages and systems around the world, hundreds of encoding systems had to be used to assign numbers to all the different characters.

Unicode is a new code replacing ASCII that enables people around the world to use computers in any language, on any platform, and using any program.

Unicode uses 16 bits (or two bytes) instead of 8 bits (or one byte) to represent all characters from all the major languages. The first set of codes in Unicode match the ASCII codes representing common English characters used on computers.