How to balance capital gains in income taxes in a record year for the stock market | Financial markets

At this point in the year, it is clear that 2025 will be a year of widespread capital gains. Some are almost unprecedented, such as the 50% appreciation accumulated by gold or the 37% appreciation of the Ibex, which aims to become the best year since 1997. Another question is what the investor will decide to do with that gain, whether to accumulate it as part of a long-term strategy or give in to the temptation to take profits, taking advantage of an opportunity that may be unique. But those who decide to sell should know that the profit will be subject to a tax of between 19% and 30%, although there are also some options to reduce the tax burden as much as possible.

First of all, it’s not about selling for the sake of selling. Revaluations made over the year could encourage this, or at least reduce exposure in positions that have been most profitable and now cause some dizziness. Despite this, the experts’ advice is not to lose medium and long-term financial objectives and to remain faithful to each person’s risk profile. “Decisions must be made in a global perspective. Taxation is important, but it must always go beyond each investor’s financial and personal plan,” says Paula Satrústegui, wealth advisory partner at Abante. For those who are determined to realize capital gains, the main recommendation is to seize the opportunity to offset the losses of past years.

Therefore, if you are carrying forward uncompensated capital losses from previous years and are thinking of making a refund, it may be time to do so, as this will reduce your taxable profits balance. In the 2025 tax return it will be possible to offset this year’s capital losses and the negative declarations that still accumulate in the previous four years. It will be the last chance to make up for losses still lingering from 2021 and an opportunity to take advantage of losses in 2022 – a disastrous year for investing – which so far have not been used to offset subsequent gains.

Capital gains versus losses

The offsetting of profits and losses follows a pattern that needs to be known when doing tax planning for a refund. On the one hand, the returns on movable capital are calculated in the tax return and within the savings base. That is, the balance of profits or losses left from the collection of dividends, coupon payments on fixed income securities, sales of fixed income assets, and insurance returns. For example, losses on a bond can offset gains from collecting dividends and therefore reduce the balance that must be taxed.

Instead, the balance of capital gains or losses resulting from the sale of shares, derivatives, investment funds or a property is calculated. In this case, stock market losses serve to reduce the taxable gain on the sale of a home. Once both blocks are defined, capital gains can be offset by negative returns on capital, with a maximum of 25%. And vice versa. And if the balance remains negative, there will be four financial years to be able to use those losses to offset future profits.

Disabilities emerge

Losses from this year, or from the previous four and still waiting to be offset, are therefore the most useful way to reduce the tax burden on capital gains, even if capital losses cannot be generated on purpose. That is, the Treasury will ensure that the taxpayer does not sell an asset and buy it shortly afterwards. Therefore, if shares, bonds or investment funds are sold at a loss, it will not be possible to apply compensation for losses if the same assets were purchased in the two months before or in the two months after the date of such sale. The duration is one year for unlisted securities. “One option could be to not buy back the same asset, but rather a similar one so as not to lose the investment position,” they point out from TawDown. For example, replacing the investment in a stock that you decide to sell with an ETF.

Sell ​​the oldest one first

The investor should also note that when canceling a position in a stock portfolio or fund, the capital gain – or loss – will be calculated based on the oldest position. It’s about the beginning first in, first out(FIFO for its acronym in English) according to which the first thing purchased will be sold first, a rule that takes on particular relevance for tax purposes when, for example, periodic contributions are paid to an investment fund. “It is normal that the entire investment is not made at once but rather over time, and after a year like this, on a global level, a considerable capital gain may have accumulated, especially if the first investment is old. With each reimbursement we analyze which elements to save first”, acknowledge financial sources.

In this sense, it can be useful for a fund investor to transfer those older shares into another fund – in which he accumulates more capital gains and for which he will not have to pay taxes until the final redemption – and sell those that remain in the fund, with fewer accumulated profits, and which, therefore, become the oldest. In investment funds it is possible to switch between products without paying taxes, which gives you some leeway to defer the time of paying taxes. And when moving from one fund to another, the FIFO criterion is also applied, whereby the oldest shareholding, the one purchased first, will always be transferred to another vehicle.

Time to sell

Taxes for collecting this year’s profits will be paid next spring, when it’s time to file your tax return. The exception is for savings products where withholding tax is applied, as in the case of deposits. So, for example, someone who is thinking of selling a house or a stock portfolio with a large capital gain could very well choose to do so on January 1, 2026 to buy time before actually paying taxes. “In this way the taxation will be deferred for a year and a half, since it will include the capital gain in the 2026 declaration, to be presented between April and June 2027”, underlines the REAF. Until then, if you wish, you can reinvest the proceeds of the sale and maximize your capital.

From this year there is a higher maximum rate based on savings, which went from 28% in force in 2024 to 30%. Therefore, for profits exceeding 300,000 euros, the applicable tax is 30%. The minimum, 19%, is for profits that do not reach 6,000 euros.

Investments abroad

At TaxDown they point out that at this time of year there are frequent questions about how to pay taxes if a good has been sold outside Spain. The key here is the taxpayer’s tax residence: it will be determined to be Spain if he or she stays in the country for more than 183 days during the year. “This is what those who have contracted investment products via platforms abroad need to keep in mind,” explains Marta Rayaces, tax expert at TaxDown. And between January and March next year you will have to present form 720 from the Revenue Agency if the value of assets abroad exceeds 50 thousand euros.

Tax-free capital gains

Profits obtained from the sale of financial or real estate assets are taxed at a rate of between 19% and 30%, but there is an exemption from paying taxes when it comes to the sale of the main residence. Therefore, capital gains arising from the sale of the main residence are tax-free, provided that the total amount obtained is reinvested in the purchase of a new house to live in within a period of two years from the date of transfer. To be considered habitual residence for tax purposes, the taxpayer must have lived there for at least three years from the time of acquisition.

The exemption from paying taxes is total when the person selling the main residence is 65 years of age or older. It is not necessary to reinvest the amount obtained in any other asset and, for tax purposes, it is considered habitual residence even if the sale is made two years after it ceased to be habitual residence, according to REAF. For example, when an elderly person changes address – to a shared house or a residence – and sells what has been their habitual residence for the following two years.

When the taxpayer is 65 years of age or older, he will not pay taxes on the capital gain obtained from the sale of other types of real estate or financial assets – in addition to his habitual residence – if he allocates the total amount of the sale into a life annuity, up to a maximum of 240,000 euros and within a maximum period of six months. For example, as explained in Abante, a couple in which both have already turned 65 who buys a house for 250,000 and resells it for 500,000, obtains a capital gain of 250,000 euros, of which they will correspond to 125,000 euros each. If they reinvested it in a lifetime annuity, the first €240,000 per holder would be tax-free, which would make 96% of the income tax-free.