Individual tree heights are needed in many situations, including estimation of 2 tree volume, dominant height and simulation of tree growth. However, height measurements 3 are tedious compared to tree diameter, and therefore height-diameter (H-D) models are 4 commonly used for prediction of tree height. Previous studies have fitted H-D models 5 using approaches that include plot-specific predictors in the models and do not include 6 them. In both these approaches, aggregation of the observations to sample plots has usually 7 been taken into account through random effects, but this has not always been done. In this 8 paper, we discuss the resulting four alternative model formulations and report an extensive 9 comparison of 16 nonlinear functions in this context using a total of 28 datasets. The datasets 10 represent a wide range of tree species, regions and ecological zones, consisting of about 11 126 000 measured trees from 3717 sample plots. Specific R-functions for model fitting 12 and prediction were developed to enable such an extensive model fitting and comparison 13 study. Suggestions on model selection, model fitting procedures, and prediction are given 14 and interpretation of predictions from different models are discussed. No uniformly best 15 function, model formulation and model fitting procedure was found. However, a 2-parameter 16 Näslund's and Curtis' function provided satisfactory fit in most datasets for the plot-specific 17 H-D relationship. Model fitting and height imputation procedures developed for this study are 18 provided in an R-package for later use.19