IRC Section 1031 provides an exception and allows you to postpone paying tax on the gain if you reinvest the proceeds in similar property as part of a qualifying like-kind exchange. Gain deferred in a like-kind exchange under IRC Section 1031 is tax-deferred, but it is not tax-free.
Prior to enactment of the 2017 Tax Act, 1031 Exchanges were available for various types of transactions involving capital assets including real estate, collector cars, works of art and other collectibles. Following enactment of the 2017 Tax Act, 1031 Exchanges are now limited exclusively to transactions involving real estate.