The concept of friend and friendship are critical to both theoretical and empirical studies of social relations, social media and social networks. Measuring the closeness among friends is a big issue for developing online social networking services (SNS) such as Facebook. This paper will address this issue by proposing a technique for ranking friendship closeness in SNS. The technique consists of an algorithm for ranking need-driven friendship closeness and an algorithm for behaviour-based friendship closeness in online social networking sites. The former is based on Maslow’s hierarchy of needs, while the latter is based on behaviours of users on Facebook and TOPSIS. Examples provided illustrate the viability of the proposed algorithms. The research in this paper shows that ranking friendship closeness will facilitate understanding of needs and behaviours of friends and friendships in SNS. The proposed approach will facilitate research and development of social media, social commerce, social networks, and SNS.