Many stories date the first use of hello (with that spelling) to around the time of the invention of the telephone in 1876. It was, however, used in print in Roughing It by Mark Twain in 1872 (written between 1870 and 1871), so its first use must have predated the telephone:
A miner came out and said: 'Hello!'
Earlier uses can be found back to 1849 and 1846:
We meet the boys here, and it is "Hello, George," or "Hello, Jim." We slap the judge of the Supreme Court on the back with a "Hello, Joe, how are you?"
—Charles Edwards Lester
It was listed in dictionaries by 1883.
The word was extensively used in literature by the 1860s.
According to the Oxford English Dictionary, hello is an alteration of hallo, hollo, which came from Old High German "halâ, holâ, emphatic imper[ative] of halôn, holôn to fetch, used esp[ecially] in hailing a ferryman." It also connects the development of hello to the influence of an earlier form, holla, whose origin is in the French holà (roughly, 'whoa there!', from French là 'there').
The word hello has also been credited to Thomas Edison, specifically as a way to greet someone when answering the telephone; according to one source, he expressed his surprise with a misheard Hullo. Alexander Graham Bell initially used Ahoy-hoy (as used on ships) as a telephone greeting. However, in 1877, Edison wrote to T.B.A. David, the president of the Central District and Printing Telegraph Company of Pittsburgh:
Friend David, I do not think we shall need a call bell as Hello! can be heard 10 to 20 feet away. What you think? Edison - P.S. first cost of sender & receiver to manufacture is only $7.00.
By 1889, central telephone exchange operators were known as 'hello-girls' due to the association between the greeting and the telephone.
Hello may also be derived from Hullo. Hullo was in use before hello and was used as a greeting and also an expression of surprise....