Skip to content
Calculadora Capital

Capital Gains Reinvestment Calculator

Selling the home you live in and buying another one to live in is the case where Portuguese law forgives the IRS on the capital gain: the reinvestment exclusion of article 10 of the IRS Code. What most people get wrong is the base of the calculation: it is not enough to reinvest the gain, you must reinvest the sale value minus the mortgage repaid on the home sold, and whatever is paid with a new loan does not count. This calculator shows how much you must reinvest to be fully exempt, what part of the gain is excluded if you reinvest less, and how much IRS you save compared with not reinvesting.

The capital gain is the profit on the sale after adjusting the purchase value for inflation and deducting costs and works. Compute it first in the property capital gains calculator and bring the result here.

Only your own money applied in the new main home counts: the price of the new home minus any new mortgage. The loan repaid is the outstanding mortgage on the home you sold, paid off at the sale.

IRS due with the reinvestment
€3,500.00
IRS saving
€7,000.00

To exclude the whole gain you would need to reinvest a further €50,000.00 within the legal window.

How the tax is reached

Amount to reinvest (sale − loan repaid)€150,000.00
Reinvestment considered€100,000.00
Share reinvested66.7%
Gain excluded€40,000.00
Gain still taxable€20,000.00
Taxable portion (50% of the remaining gain)€10,000.00
IRS with reinvestment (35%)€3,500.00
IRS without reinvestment€10,500.00
IRS saving€7,000.00

Only money applied without new credit counts as reinvestment: the part of the new home paid with a new mortgage does not enter the calculation.

The reinvestment must happen between 24 months before and 36 months after the sale, and the intention must be declared in Anexo G of that year's IRS return.

The home you sold must have been your main permanent residence for the 12 months before the sale, and the new home must become it within the legal deadlines, in Portugal, the EU or the European Economic Area.

The calculator applies the proportional exclusion rule for residents in mainland Portugal. It does not compute the regime for people aged 65+ or retired (reinvestment into a life insurance contract, pension fund or PPR within 6 months), which the article explains.

Educational estimate, not financial advice. The marginal IRS rate depends on your total income (mandatory aggregation); always confirm final figures with the tax authority or a certified accountant.

What the reinvestment exclusion is

Article 10(5) of the IRS Code excludes from taxation the gain on selling a property that was the main permanent home of the taxpayer or their household, as long as the sale value, minus the repayment of any loan taken to buy the home sold, is reinvested in acquiring another main permanent home, a plot for construction, or in building, enlarging or improving another property for that purpose, in Portugal, another EU state or the European Economic Area. It is not automatic: it has conditions and deadlines.

The maths: what you actually must reinvest

The reinvestment base is not the gain, it is the sale value. From the sale you deduct only the repayment, made at that moment, of the loan that had been taken to buy the home sold. Example: you sold for €250,000 and repaid €100,000 of that home’s mortgage; the amount to reinvest for full exclusion is €150,000, even if the gain is only €60,000. This is the most common mistake: thinking it is enough to reinvest the profit.

Partial reinvestment: the exclusion is proportional

If you reinvest less than the required amount, you do not lose everything: article 10(12) excludes the proportional part of the gain. Reinvesting €100,000 when the law required €150,000 excludes two thirds of the gain; the remaining third follows the normal regime, meaning 50% of it is added to your income and taxed at the progressive IRS rates (mandatory aggregation). The calculator applies exactly this proportion.

A new mortgage does not count as reinvestment

The tax authority’s position is that reinvesting means applying the money from the sale, not taking on new debt. If the new home costs €300,000 and you take a €200,000 mortgage, only the €100,000 of your own funds count as reinvested. That is why the calculator asks for the amount applied without new credit: the price of the new home minus the new loan.

The deadlines and the declaration

The reinvestment must happen between 24 months before and 36 months after the sale date; buying the new home first and selling the old one later also qualifies, as long as the sale happens within the following 24 months. The intention to reinvest, even partially, must be declared in Anexo G of the IRS return for the year of the sale. After reinvesting, the new home must become the taxpayer’s or the household’s residence within 12 months; for construction or works, the property (or the changes) must be registered in the matriz within 48 months of the sale.

The eligibility conditions

The home sold must have been the main permanent residence of the taxpayer or household, proven by the fiscal domicile, for the 12 months before the sale (a condition introduced by the Mais Habitação package). The new home must be in Portugal, the EU or an EEA country with tax information exchange, and the taxpayer must establish their fiscal domicile there. If you declare the intention and then fail to reinvest within the deadline, or fail to use the property as your main home, the benefit is lost and the IRS on that gain becomes due, with the legal additions.

Aged 65+ or retired: the alternative without buying a home

Anyone who, at the date of the sale, is retired or at least 65 years old (the taxpayer, their spouse or partner) can exclude the gain without buying another home: it is enough to apply the sale value, minus the loan repayment, into a life-insurance financial contract, an open pension fund, the public capitalisation scheme or a pan-European personal pension product (PEPP), within 6 months of the sale (article 10(10)). The calculator does not compute this variant, but the proportion works the same way.

What stays out of this estimate

The calculator starts from the gain already computed: working out the gain itself (inflation-adjusted purchase value, costs and works) is the property capital gains calculator. Out of scope: non-residents, the exact marginal rate through aggregation (hence the input), the transitional regime for properties bought before 1989 (exempt) and the temporary Mais Habitação regime that allowed, only for sales from 2022 to 2024, using gains from other properties to repay the mortgage on the main home, which has ended.

Worked example

Imagine you sold your home for €250,000, repaid the remaining €100,000 of its mortgage at the sale and computed a gain of €60,000. The amount to reinvest for full exclusion is €250,000 − €100,000 = €150,000. You bought the new home applying €100,000 of your own funds (the rest with a new mortgage, which does not count): you reinvested two thirds of the required amount, so €40,000 of the gain is excluded and €20,000 remains taxable. Of that, 50% (€10,000) is added to your income; at a 35% marginal rate you pay €3,500 of IRS instead of the €10,500 you would pay without reinvesting: a €7,000 saving. To pay nothing, you would need to reinvest a further €50,000 within the window.

Frequently asked questions

Do I have to reinvest the gain or the full sale value?
The sale value, not just the profit. The law requires reinvesting the sale value minus the repayment of the mortgage taken to buy the home sold. If you sold for €250,000 and repaid €100,000 of the loan, you must reinvest €150,000 for full exclusion, even if the gain is much smaller.
How long do I have to reinvest?
Between 24 months before and 36 months after the sale date. You can therefore buy the new home first and sell the old one later, as long as the sale happens within the following 24 months. The intention to reinvest is declared in Anexo G of the IRS return for the year of the sale.
Does buying the new home with a mortgage count as reinvestment?
No. Only money applied without new credit counts: the tax authority’s position is that the part financed by a new loan is not reinvested sale proceeds. If the new home costs €300,000 and the new mortgage is €200,000, the reinvestment considered is €100,000.
What if I only reinvest part of the amount?
The exclusion is proportional (article 10(12) of the IRS Code). Reinvesting 60% of the required amount excludes 60% of the gain; the remaining 40% follows the normal regime, in which 50% of the gain is added to your income and taxed at the progressive rates.
Does repaying the mortgage on another home count as reinvestment?
Not today. A temporary Mais Habitação regime allowed, for sales from 2022 to 2024, applying gains from other properties to repay the mortgage on the main home (your own or your descendants’), but it has ended. Under the permanent regime, what is deducted is only the repayment of the loan on the very home sold, made at the sale.
What happens if I declare the intention and then do not reinvest?
The benefit is lost. If the reinvestment does not happen within the 36 months, or the new home does not become your main permanent residence within 12 months of the reinvestment, the IRS on the gain becomes due, with the legal additions. Declaring the intention does not force you to reinvest everything, but whatever you do not reinvest is taxed.
I sold a home I had lived in for less than a year. Do I qualify?
As a rule, no. Since the Mais Habitação package, the property sold must have been the main permanent home of the taxpayer or household, proven by the fiscal domicile, for the 12 months before the sale.
I am over 65 and do not want to buy another home. Can I avoid the IRS?
Yes. Anyone who at the date of the sale is retired or aged 65 or over (the taxpayer, spouse or partner) can apply the sale value, minus the loan repayment, into a life-insurance financial contract, an open pension fund, the public capitalisation scheme or a PEPP, within 6 months of the sale. The exclusion is equally proportional to the amount applied.

Related calculators & reading

Embed this calculator

Paste this code on your site to show the calculator. It includes an attribution link.

Language
Theme
Colour

Preview

Free to use. The code auto-adjusts its height.

Sources

Author: Thorben Rasmus Idel · Reviewed by: Nahar Geva · Last reviewed: 2026-08-01