A bell code (sometimes bell character) is a device
control code
In computing and telecommunication, a control character or non-printing character (NPC) is a code point (a number) in a character set, that does not represent a written symbol. They are used as in-band signaling to cause effects other than ...
originally sent to ring a small electromechanical bell on
tickers
Ticker can mean:
* Ticker tape, the paper strip output by a stock ticker machine
* Ticker symbol, codes used to uniquely identify publicly traded companies on a stock market
* News ticker, a small screen space on television news dedicated ...
and other
teleprinter
A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point (telecommunications), point-to-point and point- ...
s and teletypewriters to alert operators at the other end of the line, often of an incoming message. Though tickers punched the bell codes into their
tapes, printers generally do not print a character when the bell code is received. Bell codes are usually represented by the label "
BEL
". They have been used since 1870 (initially in
Baudot code
The Baudot code is an early character encoding for telegraphy invented by Émile Baudot in the 1870s. It was the predecessor to the International Telegraph Alphabet No. 2 (ITA2), the most common teleprinter code in use until the advent of ASCII. ...
).
To maintain backward compatibility, video display
terminal
Terminal may refer to:
Computing Hardware
* Terminal (electronics), a device for joining electrical circuits together
* Terminal (telecommunication), a device communicating over a line
* Computer terminal, a set of primary input and output devic ...
s (VDTs) that replaced teletypewriters included speakers or buzzers to perform the same function, as did the personal computers that followed. Modern
terminal emulator
A terminal emulator, or terminal application, is a computer program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term ''terminal'' covers all remote ter ...
s often integrate the warnings to the desktop environment (e.g., the
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
Terminal
Terminal may refer to:
Computing Hardware
* Terminal (electronics), a device for joining electrical circuits together
* Terminal (telecommunication), a device communicating over a line
* Computer terminal, a set of primary input and output devic ...
will play the system warning sound) and also often offer a silent ''visual bell'' feature that flashes the terminal window briefly.
Representations
In
ASCII
ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
and
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
the character with the value 7 is BEL. It can be referred to as control-G or in
caret notation
Caret notation is a notation for control characters in ASCII. The notation assigns to control-code 1, sequentially through the alphabet to assigned to control-code 26 (0x1A). For the control-codes outside of the range 1–26, the ...
. Unicode also includes a character for the visual representation of the bell code, "symbol for bell" (␇) at
U+2407
, and graphic for the control code (⍾) at
U+237E
.
In the 5-bit Baudot codes, BEL is represented by the number 11 (
0x0B
) when in "figures" mode.
In the programming languages
C (created in 1972) and
Python (created in 1991), the bell character can be placed in a string or character constant with
\a
. ('a' stands for "alert" or "audible" and was chosen because
\b
was already used for the
backspace character.)
Usage

On
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems, or on
MS-DOS
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few oper ...
or
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
, a user can cause the equivalent of ringing the bell to happen by typing at the
command prompt
Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows ( Windows NT family and Windows CE family), and ReactOS operating systems. On Windows CE .NET 4.2, Wi ...
the command:
echo ^G
where the is produced by holding down and typing . On Unix the user may need to type + first to "quote" the .
On POSIX systems, one may also use:
printf '\a'
and in the
Bash shell, one may use ANSI-C quoting:
ANSI-C quoting
/ref>
echo $'\a'
An alternative is to use the tput
In computing, tput is a standard Unix operating system command which makes use of terminal capabilities.
Depending on the system, ''tput'' uses the terminfo or termcap database, as well as looking into the environment for the terminal type.
...
command, which as a part of the ncurses
ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing " GUI-li ...
library is available on most Unix/Linux operating systems:
tput bel
A program can get the same result by printing the BEL character to a terminal.
On modern systems this may not make a noise; it may instead make a visual indication such as flashing the screen, or do nothing at all.
See also
* C0 and C1 control codes
The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a curso ...
(ISO 646
ISO/IEC 646 is a set of ISO/ IEC standards, described as ''Information technology — ISO 7-bit coded character set for information interchange'' and developed in cooperation with ASCII at least since 1964. Since its first edition in ...
)
References
ATIS Telcom Glossary
Free On-Line Dictionary of Computing, 'bell'
{{DEFAULTSORT:Bell Character
Control characters