Hi is a common greeting, particularly in North America. It is less formal then hello, and a bit more formal than hey.
Hi, hy, or hye, has been used as an exclamation to gain someone's attention since at least the 1400s. (The word "hey!" usually fills this function today.) While anyone might use it to yell at a friend, it had rude overtones as it was also the sort of thing you might shout at a donkey, or a watchman might yell at thief he was chasing.
It wasn't until the 1900s in America that it started being used regularly as a greeting in addition to an attention getter. The OED says that it was used in this sense as early as 1862, but this is still in a 'calling to someone' sense: "Then out on the prairie, up galloped an Indian on his pony with his saluting 'hi!'". (We went to Kansas by Miriam Davis Colt.) It wasn't until 1951 that the OED gives a example of 'hi' being used in a sense that was clearly and unambiguously only a greeting: "'Hi,' he said... like he was terrifically bored" (The catcher in the rye by J. D. Salinger). (It's important to remember that the OED concerns itself only with the written word, and it is almost certain that 'hi' was in common usage in the spoken language before 1951.)
These days 'hi' can be found used throughout the English speaking world as a greeting. It is still always a step down from hello, and it hasn't (as far as I am aware) entered into other languages as 'hello' has. Hello, by the way, also started out as a shout used to gain someones attention; its comparative formality is most likely due to the fact that it has an extra syllable.
mkb says re hi: I have heard dutch people using "hi" as a greeting as well.
Berek says re Dutch people and hi: the Dutch use English phrases, etc. quite a lot - their English language tv is subtitled not dubbed.
filoraene says re hi: Dutch people use hoi, hallo, or he as a greeting, never hi (at least not in any dialect I am aware of).
Nora says re hi: I've heard my Hungarian relatives also use hi but not as often as "hallo" formuated form hello. See ya (Szia) is also very popular...