Skip to main content

Section 4.9 Representing Letters with ASCII

ASCII art is images drawn only using the ASCII characters. Shading is created by using characters like @ for dark areas and - for lighter ones. Below is the Mona Lisa as ASCII Art; the font size is 2 points to make the image more apparent, but if you zoom in you will see the individual characters.
--/-,\,\v\,|)/v/m@@@@@@K@@@@@@@@@@@@@@@@@@@@@@@bK!v!-( )-!.[/cT
--'.-- -/,id@@@*P!`          \'Z8@@@@@@@@@@@@@@@@@@@@@i.\\'.\.c
',`,`\'-,-J@@5`-           -- `-iYA@@@@@@@@@@b@@@@@@@@@_\-|-\c-
'. -.,`/.G@@K- `               - )7KM@@@@@@@@@@@@@@@@@@@c-----/
- `-  --i@@Ai                    -!ZZ@@@@@@@@@@@@@@@@@@@b! \`|-`
 `-,'- G@@@[,                    '.D8K@@@@@@@@@@@@@@@@@@@[/-,-/.
-` .-/v@@@A)                      -)ZdMd@@@@@@@@@@@@@@@@@@\' _\
- ` ,iVJ@@@!                     '-!(K5K@@@@@@@@@@@@@@@@@@[(/s[.
  - i\G@@@Z-                    ' ! -i55ZZ@@@@@@@@@@@@@@@@@)(4)`
 , -|b@@@@!\                     '  ` |-tYG@@@@@@@@@@@@@@@@XNYZ-
   tt@@@@A-,                        '  `)(d@@@@@@@@@@@@@@@@D)8A[
   )8@@@@@\                         ,-'-/Kd@@@@@@@@@@@@@@@@@KD@[
  ]]Z@@@@d|-              ,ii.c,, -.icLZKK@@@@@@8@K@@@@@@@@@(@8[
  KN8@@@@@( .i!vGG_      J4Kb8ZKb@bbK@d@88@@@@@@@b@@@@@@@@@@dK@-
 )/8K@@@K@b@dP~~~T4(    Jd@@7`___s@M@@@@MM8d@@@d@@@@@@@@@@@@LM8[
\!48@K@@@@8@@d*@@@bVi   bAKLY~~@@@@@@*ff/\NM8@@@@@@@@@@@@@@@db@[
,\\Kb@@@d@.~t` !*~!`.  -MA)    '~'.).` `,'K@@@@@@@@@@@@@@@@@AKb[
,`8M@@@@@@ -`,,gvZ``    A//-  ..c\+\`    i]d@@@@@@M@@@@@@@@@@@8[
i\@8@K@@@D              \!'             !iZ8@@@8A@@@@@8d@b@@@8M[
e8d5@@@@@@             '!-             '-)8@@@@@@@@@@@@@@@@@@M8i
8dZ8@M@@@@-             v  ,          ,\tK@@@@@@@@@@@@A@@@@@@Z2|
@b@AK@@@b@[              //           cctbA@@@AK@@d@@d@@@K@@@bmi
@@8@M@8@@@P-            -=/.         /iD8d@@@@@@@@@@@@@@A@@@d@@[
@8@@@MA@@@@\-      .   _)g2i        -((dKK@@@@@d@@@@d@@K@@@@@@K[
@@@bAK@@K@@)i     'c,,Kb@@bK       )X)Kb@M@@d@@@Mb@@A@d@@@@@@8@[
@K@b@@@@A@AA/i-     ~M@@@@Mc    .,\c=)D8d@@b@@@d@@@@@@@@@@8d@@A[
@@@@Mb@@@@@@('c\`     PPK((,i]v|-\-v)8XNAdMK@@@@@@@b@@MK@A@@@@@[
@@8@@MK@d@A@L!--c)s_, ,(ZsbLb@\`- .-N]/KM@@@@@@@d@@@A@@@@@@@@d@[
@@Kb@@@K@b@@@/-  !''~~Vff*N5f -` -,\))KK@@@@@@@MK@@d@@@M8d@b@@@[
@b@@@KAK@@@@@@2--    ,,_JJ/i)/- |/v)NK@8d@@@@@@@@@@8@@@@@@@@M@K[
@@8d@K@@@b@@@@@d!,   'VV\)\\)\7(-)4Jb@8@A@@@K@d@@@@@@@8@@@@@@@@[
M@@@@8@@K@Kb@@@d@v.       `-\\/v)88b@M@A@K@@M@@@A@@M@8@@A@d@8@M[
Zb@d@M@K@@@@@@@@@@m       -)!/stbb@b@@A@b@@@@@Kb@@@@@@@b@@@K@@@[
K@@d@@@@@d@M@8@@@@@Ks   ,-/vJD@@8d@K@@@@@@8@@@@@@@@@@MK@@@b@@M@[
8M8@@@A@@@A@@8@@@@@@@@@KDLt! !,-|t'(-\\!,\/,\!ZJG@@@d@Md@@@G@@@[
And then there is asciimation, which needs to be seen
to be believed.
To represent things other than integers, we need to find a way to map the data we wish to represent onto binary strings. These mappings can be completely arbitrary. If we want to represent a choice between apples, bananas, oranges, and pears (perhaps as the fruit choices in a menu) we could recognize that it requires 2 bits to represent 4 things (as \(2^2 = 4\)) and pick one two-bit pattern for each item. Perhaps we would declare that 00: apples, 01: bananas, 10: oranges, and 11: pears. We could also pick any other assignments, as long as we were consistent about it and everyone agreed to use the same system, it would not matter if 00 meant apples or bananas.
ASCII is such a system for mapping text, like the letter ’a’, onto a binary number, like the value 01100001. For different programs to be able to read each other’s files, they must agree on what this 01100001 means. That is the point of ASCII - a common system for representing text as binary values, used by almost every program that works with text. When you make a plain text file in a simple text editing program like Notepad, you are working with ASCII text. (More complex programs like Word that feature different formatting options are not ASCII-based). It should not matter if you save a text file with a program on a Macintosh and open it with a different program on a Windows machine; as long as they both “speak” ASCII, they will agree on what the file contains.
ASCII needs to represent all the common symbols used in text files: letters (capital and lower case), punctuation, digits, and special control symbols like “tab”. An ASCII table
shows all the mappings of numbers to characters. You can use the slider below to view various parts of the ASCII table.

Scroll me:

Note 4.9.1.

Some key things about ASCII codes:
  • The codes from 0-31 (00000000-00011111) are all invisible symbols like “tab” or “end of line”.
  • The capital letters range from 65-90 (01000001-01011010)
  • The lowercase letters start at 97 (01100001). That means a computer often thinks ’A’ is less than ’a’.
  • Originally, the ASCII codes only covered 7 bits (up to 127). All the codes above 127 were added later, and there are multiple versions of what they mean. Often they are used for things like accented characters.

Checkpoint 4.9.2.

What letter or symbol does 01100110 map to on the ASCII table?

Checkpoint 4.9.3.

What binary number corresponds to the plus symbol on the ASCII table?
You have attempted of activities on this page.