Alfred Lewis Vail (September 25, 1807 – January 18, 1859) was an American machinist and inventor. Along with Samuel Morse, Vail was central in developing and commercializing American telegraphy between 1837 and 1844. Vail and Morse were the first two telegraph operators on Morse's first experimental line between Washington, DC, and Baltimore, and Vail took charge of building and managing several early telegraph lines between 1845 and 1848. He was also responsible for several technical innovations of Morse's system, particularly the sending key and improved recording registers and relay magnets. Vail left the telegraph industry in 1848 because he believed that the managers of Morse's lines did not fully value his contributions. His last assignment, superintendent of the Washington and New Orleans Telegraph Company, paid him only $900 a year, leading Vail to write to Morse, "I have made up my mind to leave the Telegraph to take care of itself, since it cannot take care of me. I shall, in a few months, leave Washington for New Jersey, ... and bid adieu to the subject of the Telegraph for some more profitable business."
Vail's parents were Bethiah Youngs (1778–1847) and Stephen Vail (1780–1864). Vail was born in Morristown, New Jersey, where his father was an entrepreneur and industrialist who built the Speedwell Ironworks into one of the most innovative iron works of its time. Their son and Alfred's brother was George Vail, a noted politician.
Alfred attended public schools before taking a job as a machinist at the iron works. He enrolled in New York University to study theology in 1832, where he was an active and successful student and a member of the Eucleian Society, graduating in 1836. Visiting his alma mater on September 2, 1837, he happened to witness one of Samuel F. B. Morse's early telegraph experiments. He became fascinated by the technology and negotiated an arrangement with Morse to develop the technology at Speedwell at his own expense in return for 25% of the proceeds. Alfred split his share with his brother George Vail. When Morse took on Francis O. J. Smith, a congressman from Maine, as a partner, he reduced the Vails' share to one-eighth. Morse retained patent rights to everything Vail developed.
After having secured his father's financial backing, Vail refined Morse's crude prototype to make it suitable for public demonstration and commercial operation. The first successful completion of a transmission with this system was at the Speedwell Iron Works on January 6, 1838, across two miles (3 km) of wiring. The message read "A patient waiter is no loser." Over the next few months Morse and Vail demonstrated the telegraph to Philadelphia's Franklin Institute, members of Congress, and President Martin Van Buren and his cabinet. Demonstrations such as these were crucial to Morse's obtaining a Congressional appropriation of $30,000 to build his first line in 1844 from Washington to Baltimore.
Vail retired from the telegraph operations in 1848 and moved back to Morristown. He spent his last ten years conducting genealogical research. Since Vail shared a one-eighth interest in Morse's telegraph patents with his brother George, Vail realized far less financial gain from his work on the telegraph than Morse and others.
His papers and equipment were subsequently donated by his son Stephen to the Smithsonian Institution and New Jersey Historical Society.
Vail's cousin was Theodore N. Vail, who became the first president of American Telephone & Telegraph.
Alfred Vail and Samuel Morse collaborated in the invention of Morse code. A controversy exists over the role of each in the invention. The argument for Vail being the original inventor is laid out by several scholars.
The argument offered by supporters of Morse claims that Morse originally devised a cipher code similar to that used in existing semaphore telegraphs, by which words were assigned three- or four-digit numbers and entered into a codebook. The sending operator converted words to these number groups and the receiving operator converted them back to words using this codebook. Morse spent several months compiling this code dictionary. It is said by Morse supporters that Vail, in public and private writings, never claimed the code for himself. According to one researcher, in a February 1838 letter to his father, Judge Stephen Vail, Alfred wrote, "Professor Morse has invented a new plan of an alphabet, and has thrown aside the Dictionaries." In an 1845 book Vail wrote describing Morse's telegraph, he also attributed the code to Morse.
A US Army base has been named in his honor. Camp Vail in Eatontown, New Jersey, later renamed Fort Monmouth, part of Camp Vail was an Army housing complex. After World War II the families of servicemen and civilian Army employees negotiated with the Army to purchase the development, which was later named Alfred Vail Mutual Association, and due to the work of the Town Clerk the residents retained the rights to the original Charter of Shrewsbury Township Est. 1693. This housing development exists to this day under that name. An elementary school near the Speedwell Works, in Morristown, New Jersey, is named "Alfred Vail."