The ability to retain and lock in customers in the face of competition is a major concern for online businesses, especially those that invest heavily in advertising and customer acquisition. In this paper, we develop and implement an approach for measuring the magnitudes of switching costs and brand loyalty for online service providers based on the random utility modeling framework. We then examine how systems usage, service design, and other firm- and individual-level factors affect switching and retention. Using data on the online brokerage industry, we find significant variation (as much as a factor of two) in measured switching costs. We find that customer demographic characteristics have little effect on switching, but that systems usage measures and systems quality are associated with reduced switching. We also find that firm characteristics such as product line breadth and quality reduce switching and may also reduce customer attrition. Overall, we conclude that online brokerage firms appear to have different abilities in retaining customers and have considerable control over their switching costs.