Taxes have a first-order effect on investors' trading decisions and portfolio choices and on the equilibrium pricing of assets. In this review, we investigate how certain features of the tax code impact investors and asset markets. We begin by considering how tax heterogeneity across investors and across securities can lead to market segmentation and discuss the nature of equilibrium prices and allocations with tax clienteles. We then turn our attention to the optimal trading of assets when the tax on capital gains and losses is deferred until the asset is sold. In the absence of portfolio considerations, the optimal trading policies are driven entirely by the desire of investors to minimize the tax cost of owning assets. We next focus on an investor's lifetime portfolio choice problem with capital gains taxes and discuss how the investor's optimal trading decisions and portfolio choices are influenced by both tax and diversification motives. Our discussion includes consideration of nonfinancial income, tax-deferred investment opportunities, and multiple risky assets.