To successfully navigate our social world, we keep track of other individuals’ relations to ourselves and to each other. But how does the brain encode this information? To answer this question, we mined participants’ social media (FacebookTM) profiles to objectively characterize the relations between individuals in their real-life social networks. Under fMRI, participants answered questions on each of these individuals. Using representational similarity analysis, we identified social network structure coding in the default-mode network (medial prefrontal, medial parietal and lateral parietal cortices). When regressing out subjective factors (ratings of personal affiliation, appearance and personality), social network structure information was uniquely found in the retrosplenial complex, a region implicated in spatial processing. In contrast, information on individuals’ personality traits and affiliation to the subjects was found in the medial prefrontal and parietal cortices, respectively. These findings demonstrate a cortical division between representation of structural, trait-based and self-referenced social knowledge.