What is taxed is not the sale price but the property gain: sale proceeds minus investment costs. Investment costs include the original purchase price, value-enhancing investments (e.g. an extension, a new kitchen as an improvement, but not pure maintenance) and certain incidental costs such as transfer tax, notary and broker fees. Value-preserving repairs are deductible for income tax, not here – the clean distinction is central and should be documented with receipts.
The real estate capital gains tax is a cantonal or municipal tax, and the systems differ greatly. Almost everywhere, however, the rule is: the longer the holding period, the lower the tax rate. For a short holding period – e.g. sale after one to two years – many cantons levy hefty surcharges to curb speculation. For a very long holding period the rate falls markedly. The gain is often taxed separately and progressively; the effective burden can range from a few percent up to 40 % or more of the gain (no guarantee, strongly canton-dependent).
An important instrument is tax deferral. If you sell your owner-occupied home and buy a new, similarly used home within a reasonable period (replacement purchase), the tax can be deferred to the extent the proceeds are reinvested. In cases of inheritance, gift or matrimonial property division the tax is usually also deferred and only due on the later sale. Deferral is not an exemption: the latent tax burden moves with the property.
Affected are all who sell a property at a profit – private individuals and, depending on the canton and tax system, sometimes companies. Before a sale it is worth calculating the taxable gain with receipts for purchase price and investments and checking the deadlines for any replacement purchase. As the rules are cantonally complex, advice from a fiduciary or tax professional is usually sensible – especially for larger gains or a short holding period.