你好 is fairly formal. Among friends, Chinese people more often greet each other with 嗨 (hāi), 嘿 (hēi), or casual questions like 吃了吗?(Have you eaten?).
culture
Literally "you good," 你好 reflects the Chinese greeting style of wishing the other person well. The polite form 您好 (nín hǎo) is used with elders or in formal situations.
grammar
To greet a group, say 你们好 (nǐmen hǎo). To greet someone specific by role, place the title first: 老师你好, 同学们好.