Phylogenetic analysis of pathogens is an increasingly powerful way to reduce the spread of epidemics, including HIV. As a result, phylogenetic approaches are becoming embedded in public health and research programmes, as well as outbreak responses, presenting unique ethical, legal, and social issues that are not adequately addressed by existing bioethics literature. We formed a multidisciplinary working group to explore the ethical issues arising from the design of, conduct in, and use of results from HIV phylogenetic studies, and to propose recommendations to minimise the associated risks to both individuals and groups. We identified eight key ethical domains, within which we highlighted factors that make HIV phylogenetic research unique. In this Review, we endeavoured to provide a framework to assist researchers, public health practitioners, and funding institutions to ensure that HIV phylogenetic studies are designed, done, and disseminated in an ethical manner. Our conclusions also have broader relevance for pathogen phylogenetics.