February 21, 2022

A Brief History of the ASCII Bell Code (ASCII 7)

While doing some research into ASCII, I came across the control code 7 - otherwise known as the Bell code, and was fascinated by the history and use of it.

About ASCII

If you used a computer between 2000 and 2012, you’re probably familiar with ASCII at least through the concept of ASCII art - images represented through characters typed on your keyboard. ASCII however has a much more complex history, and is well in use today beyond text-based images.

ASCII stands for the American Standard Code for Information Exchange, and was created in the 60s as a method for allowing machines to exchange information in a standardized format. Some of the first machines to use it were teleprinters - electromechanical devices that could send and receive text messages across copper wires.

Example teletype machine

ASCII, a simple method for exchanging capital letters, later expanded to include lower case, punctionation, and special control codes. The advantage of ASCII is that it allows characters to be sent with 8 bits of information.

If you google “ASCII table”, you’ll find a table representing characters that are described by ASCII, and different ways to interpret them.

Let’s take for example the capital letter “J”. With an ASCII table, we can see that the binary representation of it (8 bits) is 1001010. The hexidecimal representation is 4A, and the decimal representation is 74.

The Bell Code

The bell code (BEL) is represented by the decimal number 7, hexidecimal number 7, and the binary number 0000111. It’s purpose was to alert an operator’s attention to something - potentially an incoming message.

To see an example of a teletype machine using the bell character, check out this video:

While lagely not used anymore with modern machines, it still exists in modern ASCII and can still be heard depending on the system you’re using.

If you’re using a mac to read this, to hear the modern version of the BEL character, open your terminal, paste the following, and hit enter.

printf '\a'

On my macbook it can be heard as a small thud sound. Though depending on your machine, it may make a different sound. Some machines even make the sound with no speakers attached.

While not used much anymore - it’s an interesting bit of computer history, and a reminder as to how much of modern computing still maintains its relations to telegraphy.

Let's Work Together

I help organizations solve complex technical challenges, in the simplest ways possible.