In bioinformatics, neighbor-joining is a bottom-up clustering method used for the creation of phylogenetic treess. Usually used for trees based on DNA or protein sequence data, the algorithm requires knowledge of the distance between each pair of taxa (e.g. species or sequences) in the tree.

Neighbor-joining is based on the Minimum Evolution criterion for phylogenetic trees, i.e. the topology that gives the least total branch length is preferred at each step of the algorithm. However, neighbor-joining may not find the true tree topology with least total branch length because it is a greedy algorithm that constructs the tree in a step-wise fashion. Even though it is sub-optimal in this sense, it has been extensively tested and usually finds a tree that is quite close to the optimal tree.

The main virtue of neighbor-joining is its efficiency. It can be used on very large data sets for which other means of phylogenetic analysis (e.g. minimum evolution, maximum parsimony, maximum likelihood) are computationally prohibitive. Unlike the UPGMA algorithm for phylogenetic tree reconstruction, neighbor-joining does not assume that all lineages evolve at the same rate (molecular clock hypothesis) and produces an unrooted tree.