We study the effect of quadratic differentiation costs in the Hotelling model of endogenous product differentiation. The equilibrium location choices are found to depend on the magnitude of the differentiation costs (relatively to the transportation costs supported by consumers). When the differentiation costs are low, there is maximum differentiation. When they are high, there is partial differentiation, with a degree of differentiation that decreases with the differentiation costs. In any case, the socially optimal degree of differentiation is always lower than the equilibrium level. We also study the case of collusion between firms. If firms can combine locations but not prices, they locate asymmetrically when differentiation costs are high and choose maximum differentiation when they are low. When collusion extends to price setting, there is partial differentiation.