Etymology American English. First recorded reference is to speech of a Kansas Indian (1862); originally to attract attention, probably a variant of Middle English hey, hy (circa 1475). Also an exclamation to call attention. See hey.
1
A friendly, informal, casual greeting said upon someone's arrival.
Hi, how are you?
I just dropped by to say “hi”.
2 more examples
Anna: Pete, hi! Hi, we are here! — Pete: Hi, Anna! Hi, Marsha! — Anna: Hi! — Pete: How are you two? — Marsha: I am great!2016, VOA Learning English (public domain)
When out on the prairie, up galloped an Indian on his pony with his saluting "hi!"1862, Miriam Davis Colt, Went to Kansas, L. Ingalls & Company, →ISBN, page 143:
2
An exclamation to call attention.
I made a speaking trumpet of my hands and commenced to whoop “Ahoy!” and “Hello!” at the top of my lungs. […] The Colonel woke up, and, after asking what in brimstone was the matter, opened his mouth and roared “Hi!” and “Hello!” like the bull of Bashan.1913, Joseph C[rosby] Lincoln, chapter VII, in Mr. Pratt’s Patients, New York, N.Y.; London: D[aniel] Appleton and Company, →OCLC:
'Come back now!' shouted Sam. 'Hi! Come back!' But Gollum had vanished.1954, J. R. R. Tolkien, The Two Towers:
Etymology American English. First recorded reference is to speech of a Kansas Indian (1862); originally to attract attention, probably a variant of Middle English hey, hy (circa 1475). Also an exclamation to call attention. See hey.