Morse code represents characters through signals of different lengths and pauses, allowing text to travel by telegraph. Samuel Morse, Alfred Vail, and others contributed to its development.

The 1844 telegraph demonstration between Washington and Baltimore became famous. The later International Morse code differs in some respects from the early American version.

Samuel Morse and Alfred Vail

The American artist Samuel Morse, the American physicist Joseph Henry, and mechanical engineer Alfred Vail developed an electrical telegraph system. The simple "on or off" nature of its signals made it desirable to find a method of transmitting natural language using only electrical pulses and the silence between them. Around 1837, Morse therefore developed such a method, an early forerunner to the modern International Morse code.

The Morse system for telegraphy was designed to make indentations on a paper tape when electric currents were received. Morse's original telegraph receiver used a mechanical clockwork to move a paper tape. When an electrical current was received, an electromagnet engaged an armature that pushed a stylus onto the moving paper tape, making an indentation on the tape. When the current was interrupted, a spring retracted the stylus and that portion of the moving tape remained unmarked.

In his earliest design for a code, Morse had planned to transmit only numerals, and to use a codebook to look up each word according to the number which had been sent. However, the code was soon expanded by Alfred Vail in 1840 to include letters and special characters, so it could be used more generally. Vail estimated the English language letter frequency by counting the movable type he found in the type cases of a local newspaper in Morristown, New Jersey. The shorter marks were called "dots" and the longer ones "dashes", and the letters most commonly used were assigned the shortest sequences of dots and dashes.

This code, first used in 1844, was what later became known as Morse landline code, American Morse code, or Railroad Morse; railroads in the U.S. had largely phased out Morse telegraphy by the mid-1950s, although a few lines remained in use while trained operators were still available.

Gerke's refinement of Morse's code

The Morse code, as specified in the current international standard, International Morse Code Recommendation, ITU-R M.1677-1, was derived from a much-improved proposal by Friedrich Gerke in 1848 that became known as the "Hamburg alphabet", its only real defect being the use of an excessively long code ( ▄ ▄▄▄ ▄ ▄ ▄ and later the equal duration code ▄▄▄ ▄▄▄ ▄▄▄ ) for the frequently used vowel O.

Gerke changed many of the codepoints, in the process doing away with the different length dashes and different inter-element spaces of American Morse, leaving only two coding elements, the dot and the dash. Codes for German umlauted vowels and CH were introduced. Gerke's code was adopted in Germany and Austria in 1851.

This finally led to the International Morse code in 1865. The International Morse code adopted most of Gerke's codepoints. The codes for O and P were taken from a code system developed by Steinheil. A new codepoint was added for J since Gerke did not distinguish between I and J. Changes were also made to X, Y, and Z. The codes for the digits 0–9 in International Morse were completely revised from both Vail's original and Gerke's revised encodings. This left only four codes identical to the original Morse code, namely E, H, K, and N; and K and N had their original short dahs extended to full length.

Operator-led change from graphical to audible code

In the original Morse telegraph system, the receiver's armature made a clicking noise as it moved in and out of position to mark the paper tape. Early telegraph operators soon learned that they could translate the clicks directly into dots and dashes, and write these down by hand, thus making the paper tape unnecessary. When Morse code was adapted to radio communication, the dots and dashes were sent as short and long tone pulses.

Later telegraphy training found that people become more proficient at receiving Morse code when it is taught "like a language", with each code perceived as a whole "word" instead of a sequence of separate dots and dashes, such as might be shown on a page.