The Wiener index is analyzed for random recursive trees and random binary search trees in the uniform probabilistic models. We obtain the expectations, asymptotics for the variances, and limit laws for this parameter. The limit distributions are characterized as the projections of bivariate measures that satisfy certain fixed-point equations. Covariances, asymptotic correlations, and bivariate limit laws for the Wiener index and the internal path length are given. AMS subject classifications. Primary: 60F05, 05C12; secondary: 05C05, 68Q25. Key words. Wiener index, weak convergence, distance (in a graph), random binary search tree, random recursive tree, contraction method, bivariate limit law.