We develop a two-stage model for versioning products with respect to both vertical and horizontal attributes. At first, a firm positions its top-quality "flagship" product in a market with an imperfectly known distribution of tastes and reservation prices. In the second stage, the firm learns these consumer characteristics and has the option of extending its product line by versioning the flagship product using pure horizontal differentiation, quality degrading, or both. The firm's nonconvex versioning problem is solved analytically for the two-product case. We find that ex ante extending the product line through vertical differentiation is optimal for low marginal cost of quality (development cost); otherwise pure horizontal differentiation is superior. Given quasilinear consumer preferences and a uniform distribution of consumer characteristics, versioning with respect to both horizontal and vertical attributes is never optimal. Under delayed differentiation the optimal policy is contingent on the observed demand realization and may lead to horizontal cannibalization and price dispersion for equal-quality products. The firm tends to increase its investment in product quality unless it adopts a state-contingent policy of horizontal versioning for high and vertical versioning for low demand realizations. Following a state-contingent policy, the optimal upfront development effort may be significantly lower than under full ex-ante commitment. The option value of delayed differentiation is generally nonmonotonic in the firm's development cost.